escalus icon indicating copy to clipboard operation
escalus copied to clipboard

[ Roster] How can I manipulate user roster ?

Open hamdijmii1992 opened this issue 9 years ago • 0 comments

I tried to manipulate user roster with escalus API. After diving a little bit in Escalus code I found some functions that have relations with my need like:

escalus_pred:roster_contains escalus_pred:count_roster_items escalus_pred:get_roster_items escalus_stanza:roster_get escalus_stanza:roster_add_contact

I tried for example to use one of them to count roster item as follows:

escalus_pred:count_roster_items(0,{xmlel,<<"iq">>,[{<<"type">>,<<"get">>},{<<"id">>,<<"230c60e893af03efbcf2fed3b8cdd585">>}],[{xmlel,<<"query">>,[{<<"from">>,<<"carol@localhost">>},{<<"xmlns">>,<<"jabber:iq:roster">>}],[]}]}).

I have a doubt if my stanza element is well formatted, also I have another question about getting roster items, Should I use escalus_pred:get_roster_items ?

hamdijmii1992 avatar Dec 14 '16 09:12 hamdijmii1992