Add XEP-0280 support

This commit is contained in:
Olivier LE MOAL
2015-02-02 11:10:05 +01:00
parent 5c9dd2802a
commit 48f9f3b3b0
17 changed files with 161 additions and 1 deletions

View File

@@ -198,6 +198,44 @@ stanza_create_bookmarks_pubsub_add(xmpp_ctx_t *ctx, const char * const jid,
}
#endif
xmpp_stanza_t *
stanza_enable_carbons(xmpp_ctx_t *ctx){
xmpp_stanza_t *iq = xmpp_stanza_new(ctx);
char *id = create_unique_id(NULL);
xmpp_stanza_set_name(iq, STANZA_NAME_IQ);
xmpp_stanza_set_type(iq, STANZA_TYPE_SET);
xmpp_stanza_set_id(iq, id);
free(id);
xmpp_stanza_t *carbons_enable = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(carbons_enable, STANZA_NAME_ENABLE);
xmpp_stanza_set_ns(carbons_enable, STANZA_NS_CARBONS);
xmpp_stanza_add_child(iq, carbons_enable);
return iq;
}
xmpp_stanza_t *
stanza_disable_carbons(xmpp_ctx_t *ctx){
xmpp_stanza_t *iq = xmpp_stanza_new(ctx);
char *id = create_unique_id(NULL);
xmpp_stanza_set_name(iq, STANZA_NAME_IQ);
xmpp_stanza_set_type(iq, STANZA_TYPE_SET);
xmpp_stanza_set_id(iq, id);
free(id);
xmpp_stanza_t *carbons_disable = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(carbons_disable, STANZA_NAME_DISABLE);
xmpp_stanza_set_ns(carbons_disable, STANZA_NS_CARBONS);
xmpp_stanza_add_child(iq, carbons_disable);
return iq;
}
xmpp_stanza_t *
stanza_create_chat_state(xmpp_ctx_t *ctx, const char * const fulljid, const char * const state)
{