Управлять изменениями реестра в истинном внешнем веб-приложении и отключать для пользователей?

У меня есть веб-приложение, которое представляет собой игру, и только после определенного количества очков люди могут стать друзьями и должны автоматически добавляться в список друзей друг друга.

Попытка выяснить, как обрабатывать списки в Ejabberd, как это

  • запретить любому пользователю добавлять кого-либо самостоятельно
  • позволить веб-приложению обрабатывать только изменения в списках ( buddylist )

Использование клиентской библиотеки JS, такой как strophe, не будет безопасным. Мне нужен серверный метод добавления пользователей в список друг друга. Любые мысли о том, как это сделать с Ejabberd?

РЕДАКТИРОВАТЬ: Хорошо, кажется, что mod_rest для ejabberd дает полный доступ к (всем?) методам ejabbard.


person Rubytastic    schedule 11.09.2012    source источник


Ответы (1)


Итак, после того, как я оказался на правильном пути, мне удалось понять это за час.

  • установить ejabberd
  • установить mod_rest
  • установить mod_admin_extra

команда:

ejabberdctl help process_rosteritems

:

Command Name: process_rosteritems

  Arguments: action::string
             subs::string
             asks::string
             users::string
             contacts::string

  Returns: res::rescode

  Tags: roster 

  Description: List or delete rosteritems that match filtering options 

Explanation of each argument:
 - action: what to do with each rosteritem that matches all the filtering options
 - subs: subscription type
 - asks: pending subscription
 - users: the JIDs of the local user
 - contacts: the JIDs of the contact in the roster

Allowed values in the arguments:
 ACTION = list | delete
 SUBS = SUB[:SUB]* | any
 SUB = none | from | to | both
 ASKS = ASK[:ASK]* | any
 ASK = none | out | in
 USERS = JID[:JID]* | any
 CONTACTS = JID[:JID]* | any
 JID = characters valid in a JID, and can use the globs: *, ?, ! and [...]

This example will list roster items with subscription 'none', 'from' or 'to' that have any ask property, of local users which JID is in the virtual host 'example.org' 
and that the contact JID is either a bare server name (without user part) or that has a user part and the server part contains the word 'icq':
 list none:from:to any *@example.org *:*@*icq* 
person Rubytastic    schedule 11.09.2012