diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-24 15:50:48 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-05-28 13:32:08 +0200 |
commit | 9cdcd094234ebfe40429d827c2ec2b6bb5d917a6 (patch) | |
tree | 8aeed836e8bd276089993c23f988f76e35c5aa92 /wocky/wocky-pep-service.c | |
parent | 51ee0b1e860c99ae8dbaa58909d247ab54d834c1 (diff) |
pep-service: discard suspicious event messsages (fdo #28232)
For some reason recent ejabberd are sending 'error' messages when we publish
to a PEP node. That's probably an ejabberd bug (EJAB-1239) but Wocky should
ignore those rather than parsing them as actual PEP updates.
Diffstat (limited to 'wocky/wocky-pep-service.c')
-rw-r--r-- | wocky/wocky-pep-service.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wocky/wocky-pep-service.c b/wocky/wocky-pep-service.c index 4d5ad89..8146937 100644 --- a/wocky/wocky-pep-service.c +++ b/wocky/wocky-pep-service.c @@ -213,6 +213,7 @@ msg_event_cb (WockyPorter *porter, WockyPepServicePrivate *priv = self->priv; const gchar *from; WockyBareContact *contact; + WockyStanzaSubType sub_type; from = wocky_node_get_attribute (wocky_stanza_get_top_node (stanza), "from"); @@ -222,6 +223,16 @@ msg_event_cb (WockyPorter *porter, return FALSE; } + wocky_stanza_get_type_info (stanza, NULL, &sub_type); + + /* type of the message is supposed to be 'headline' but old ejabberd + * omits it */ + if (sub_type != WOCKY_STANZA_SUB_TYPE_NONE && + sub_type != WOCKY_STANZA_SUB_TYPE_HEADLINE) + { + return FALSE; + } + contact = wocky_contact_factory_ensure_bare_contact ( priv->contact_factory, from); |