Назад | Перейти на главную страницу

Множественный аргумент в команде ejabberdctl process_rosteritems

Ребята, и особенно Badlop :) Мне нужна ваша помощь, есть вопросы. Как я могу добавить еще аргумент в команду process_rosteritems, например, такую ​​команду:

ejabberdctl process_rosteritems list none out any user@jabber.com

И мне нужно 2 одновременных матча, например user@jabber.com & user3@jabber.com Примерно так:

ejabberdctl process_rosteritems list none out any user@jabber.com&user3@jabber.com

Как я могу изменить команду, чтобы она соответствовала 2 аргументам (одновременные совпадения)?

Если вы используете mnesia для mod_roster, то это возможно для некоторых аргументов (SUBS, ASKS, USERS и CONTACTS). Символ для разделения нескольких элементов :. С хранилищем SQL это невозможно ... но в этом случае вы, вероятно, все равно можете использовать какой-либо SQL-запрос.

Например, чтобы получить пользователей с контактами user1 или user2:

$ ejabberdctl process_rosteritems list any any any user1@localhost:user2@localhost
user3@localhost user1@localhost
user1@localhost user2@localhost
user2@localhost user1@localhost

Как упоминалось в документации по команде:

$ ejabberdctl help process_rosteritems

  Command Name: process_rosteritems

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

  Returns: response::[ pairs::{ user::string,
                                contact::string } ]

  Tags:  roster

  Description:  List/delete rosteritems that match filter

 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

 *** Mnesia: 

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*

 *** SQL:

Allowed values in the arguments:
 ACTION = list | delete
 SUBS = any | none | from | to | both
 ASKS = any | none | out | in
 USERS = JID
 CONTACTS = JID
 JID = characters valid in a JID, and can use the globs: _ and %

This example will list roster items with subscription 'to' that have any ask property, of local users which JID is in the
virtual host 'example.org' and that the contact JID's server part contains the word 'icq':
 list to any %@example.org %@%icq%