1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Fixed error with /otr start with carbons enabled

This commit is contained in:
James Booth 2015-03-14 16:37:33 +00:00
parent e5bb12a0d6
commit 2fc7937dcd

View File

@ -452,9 +452,11 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
} }
// check if carbon message // check if carbon message
xmpp_stanza_t *received = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS); xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS);
if(received != NULL){ if(carbons) {
xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(received, STANZA_NS_FORWARD); char *name = xmpp_stanza_get_name(carbons);
if (g_strcmp0(name, "received") == 0) {
xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(carbons, STANZA_NS_FORWARD);
xmpp_stanza_t *message = xmpp_stanza_get_child_by_name(forwarded, STANZA_NAME_MESSAGE); xmpp_stanza_t *message = xmpp_stanza_get_child_by_name(forwarded, STANZA_NAME_MESSAGE);
xmpp_ctx_t *ctx = connection_get_ctx(); xmpp_ctx_t *ctx = connection_get_ctx();
@ -493,6 +495,7 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
jid_destroy(my_jid); jid_destroy(my_jid);
return 1; return 1;
} }
}
// ignore handled namespaces // ignore handled namespaces
xmpp_stanza_t *conf = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CONFERENCE); xmpp_stanza_t *conf = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CONFERENCE);