diff options
author | James Booth <boothj5@gmail.com> | 2013-06-02 00:06:05 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-06-02 00:06:05 +0100 |
commit | 01bdc6ae5ac83331ac76beb71cdd0f11e5bb58ca (patch) | |
tree | 3c2d443d3ed89ddc37c9b28b2fe335b5190ea568 /src/xmpp/stanza.c | |
parent | 518b6721fffa447a05a7af4363be14f69811b4d0 (diff) | |
download | profani-tty-01bdc6ae5ac83331ac76beb71cdd0f11e5bb58ca.tar.gz |
Added /roster remove command
Diffstat (limited to 'src/xmpp/stanza.c')
-rw-r--r-- | src/xmpp/stanza.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/xmpp/stanza.c b/src/xmpp/stanza.c index 78d85c18..59a89671 100644 --- a/src/xmpp/stanza.c +++ b/src/xmpp/stanza.c @@ -90,6 +90,29 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, } xmpp_stanza_t * +stanza_create_roster_remove_set(xmpp_ctx_t *ctx, const char * const barejid) +{ + xmpp_stanza_t *iq = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(iq, STANZA_NAME_IQ); + xmpp_stanza_set_type(iq, STANZA_TYPE_SET); + + xmpp_stanza_t *query = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(query, STANZA_NAME_QUERY); + xmpp_stanza_set_ns(query, XMPP_NS_ROSTER); + + xmpp_stanza_t *item = xmpp_stanza_new(ctx); + xmpp_stanza_set_name(item, STANZA_NAME_ITEM); + xmpp_stanza_set_attribute(item, STANZA_ATTR_JID, barejid); + xmpp_stanza_set_attribute(item, STANZA_ATTR_SUBSCRIPTION, "remove"); + + xmpp_stanza_add_child(query, item); + xmpp_stanza_add_child(iq, query); + + return iq; + +} + +xmpp_stanza_t * stanza_create_roster_set(xmpp_ctx_t *ctx, const char * const jid, const char * const handle, GSList *groups) { |