From 01bdc6ae5ac83331ac76beb71cdd0f11e5bb58ca Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 2 Jun 2013 00:06:05 +0100 Subject: Added /roster remove command --- src/xmpp/stanza.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/xmpp/stanza.c') 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 @@ -89,6 +89,29 @@ stanza_create_message(xmpp_ctx_t *ctx, const char * const recipient, return msg; } +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) -- cgit 1.4.1-2-gfad0