mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 21:46:21 +00:00
Merge branch 'master' into pgp
This commit is contained in:
@@ -638,18 +638,14 @@ _private_chat_handler(xmpp_stanza_t * const stanza, const char * const fulljid)
|
|||||||
xmpp_free(ctx, message);
|
xmpp_free(ctx, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static gboolean
|
||||||
_chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
|
_handle_carbons(xmpp_stanza_t * const stanza)
|
||||||
{
|
{
|
||||||
// ignore if type not chat or absent
|
xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS);
|
||||||
char *type = xmpp_stanza_get_type(stanza);
|
if (!carbons) {
|
||||||
if (!(g_strcmp0(type, "chat") == 0 || type == NULL)) {
|
return FALSE;
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if carbon message
|
|
||||||
xmpp_stanza_t *carbons = xmpp_stanza_get_child_by_ns(stanza, STANZA_NS_CARBONS);
|
|
||||||
if (carbons) {
|
|
||||||
char *name = xmpp_stanza_get_name(carbons);
|
char *name = xmpp_stanza_get_name(carbons);
|
||||||
if ((g_strcmp0(name, "received") == 0) || (g_strcmp0(name, "sent")) == 0) {
|
if ((g_strcmp0(name, "received") == 0) || (g_strcmp0(name, "sent")) == 0) {
|
||||||
xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(carbons, STANZA_NS_FORWARD);
|
xmpp_stanza_t *forwarded = xmpp_stanza_get_child_by_ns(carbons, STANZA_NS_FORWARD);
|
||||||
@@ -687,8 +683,26 @@ _chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * con
|
|||||||
jid_destroy(jid_from);
|
jid_destroy(jid_from);
|
||||||
jid_destroy(jid_to);
|
jid_destroy(jid_to);
|
||||||
jid_destroy(my_jid);
|
jid_destroy(my_jid);
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_chat_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, void * const userdata)
|
||||||
|
{
|
||||||
|
// ignore if type not chat or absent
|
||||||
|
char *type = xmpp_stanza_get_type(stanza);
|
||||||
|
if (!(g_strcmp0(type, "chat") == 0 || type == NULL)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check if carbon message
|
||||||
|
gboolean res = _handle_carbons(stanza);
|
||||||
|
if (res) {
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ignore handled namespaces
|
// ignore handled namespaces
|
||||||
|
|||||||
Reference in New Issue
Block a user