1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Merge remote-tracking branch 'SamWhited/otr_no_store_carbons'

This commit is contained in:
James Booth 2015-07-01 21:09:45 +01:00
commit 10eb0bbbf8
3 changed files with 29 additions and 0 deletions

View File

@ -213,6 +213,8 @@ message_send_chat_otr(const char * const barejid, const char * const msg)
} }
stanza_attach_carbons_private(ctx, message); stanza_attach_carbons_private(ctx, message);
stanza_attach_hints_no_copy(ctx, message);
stanza_attach_hints_no_store(ctx, message);
if (prefs_get_boolean(PREF_RECEIPTS_REQUEST)) { if (prefs_get_boolean(PREF_RECEIPTS_REQUEST)) {
stanza_attach_receipt_request(ctx, message); stanza_attach_receipt_request(ctx, message);

View File

@ -305,6 +305,30 @@ stanza_attach_carbons_private(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza)
return stanza; return stanza;
} }
xmpp_stanza_t *
stanza_attach_hints_no_copy(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza)
{
xmpp_stanza_t *no_copy = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(no_copy, "no-copy");
xmpp_stanza_set_ns(no_copy, STANZA_NS_HINTS);
xmpp_stanza_add_child(stanza, no_copy);
xmpp_stanza_release(no_copy);
return stanza;
}
xmpp_stanza_t *
stanza_attach_hints_no_store(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza)
{
xmpp_stanza_t *no_store = xmpp_stanza_new(ctx);
xmpp_stanza_set_name(no_store, "no-store");
xmpp_stanza_set_ns(no_store, STANZA_NS_HINTS);
xmpp_stanza_add_child(stanza, no_store);
xmpp_stanza_release(no_store);
return stanza;
}
xmpp_stanza_t * xmpp_stanza_t *
stanza_attach_receipt_request(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza) stanza_attach_receipt_request(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza)
{ {

View File

@ -158,6 +158,7 @@
#define STANZA_NS_CAPTCHA "urn:xmpp:captcha" #define STANZA_NS_CAPTCHA "urn:xmpp:captcha"
#define STANZA_NS_PUBSUB "http://jabber.org/protocol/pubsub" #define STANZA_NS_PUBSUB "http://jabber.org/protocol/pubsub"
#define STANZA_NS_CARBONS "urn:xmpp:carbons:2" #define STANZA_NS_CARBONS "urn:xmpp:carbons:2"
#define STANZA_NS_HINTS "urn:xmpp:hints"
#define STANZA_NS_FORWARD "urn:xmpp:forward:0" #define STANZA_NS_FORWARD "urn:xmpp:forward:0"
#define STANZA_NS_RECEIPTS "urn:xmpp:receipts" #define STANZA_NS_RECEIPTS "urn:xmpp:receipts"
#define STANZA_NS_SIGNED "jabber:x:signed" #define STANZA_NS_SIGNED "jabber:x:signed"
@ -195,6 +196,8 @@ xmpp_stanza_t* stanza_create_chat_state(xmpp_ctx_t *ctx,
xmpp_stanza_t * stanza_attach_state(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza, const char * const state); xmpp_stanza_t * stanza_attach_state(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza, const char * const state);
xmpp_stanza_t * stanza_attach_carbons_private(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza); xmpp_stanza_t * stanza_attach_carbons_private(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza);
xmpp_stanza_t * stanza_attach_hints_no_copy(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza);
xmpp_stanza_t * stanza_attach_hints_no_store(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza);
xmpp_stanza_t * stanza_attach_receipt_request(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza); xmpp_stanza_t * stanza_attach_receipt_request(xmpp_ctx_t *ctx, xmpp_stanza_t *stanza);
xmpp_stanza_t* stanza_create_message(xmpp_ctx_t *ctx, char *id, xmpp_stanza_t* stanza_create_message(xmpp_ctx_t *ctx, char *id,