Changing roster handle with no argument clears handle

This commit is contained in:
James Booth
2013-05-19 03:27:59 +01:00
parent d9cb8c100f
commit 1c41a46dce
3 changed files with 14 additions and 6 deletions

View File

@@ -104,7 +104,11 @@ stanza_create_roster_set(xmpp_ctx_t *ctx, const char * const jid,
xmpp_stanza_t *item = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(item, STANZA_NAME_ITEM);
xmpp_stanza_set_attribute(item, STANZA_ATTR_JID, jid);
xmpp_stanza_set_attribute(item, STANZA_ATTR_NAME, handle);
if (handle != NULL) {
xmpp_stanza_set_attribute(item, STANZA_ATTR_NAME, handle);
} else {
xmpp_stanza_set_attribute(item, STANZA_ATTR_NAME, "");
}
xmpp_stanza_add_child(query, item);
xmpp_stanza_add_child(iq, query);