[Telepathy-commits] [telepathy-salut/master] Ignore ichats type notification message
Sjoerd Simons
sjoerd.simons at collabora.co.uk
Thu Oct 30 12:35:57 PDT 2008
---
src/text-helper.c | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/text-helper.c b/src/text-helper.c
index c43bc20..70422a1 100644
--- a/src/text-helper.c
+++ b/src/text-helper.c
@@ -158,9 +158,24 @@ text_helper_parse_incoming_message (GibberXmppStanza *stanza,
{
const gchar *type;
GibberXmppNode *node;
+ GibberXmppNode *event;
*from = gibber_xmpp_node_get_attribute (stanza->node, "from");
type = gibber_xmpp_node_get_attribute (stanza->node, "type");
+ /* Work around iChats strange way of doing typing notification */
+ event = gibber_xmpp_node_get_child_ns (stanza->node, "x",
+ GIBBER_XMPP_NS_EVENT);
+
+ if (event != NULL)
+ {
+ /* If the event has a composing and an id child, this is a typing
+ * notification and it should be dropped */
+ if (gibber_xmpp_node_get_child (event, "composing") != NULL &&
+ gibber_xmpp_node_get_child (event, "id") != NULL)
+ {
+ return FALSE;
+ }
+ }
/*
* Parse body if it exists.
*/
--
1.5.6.5
More information about the Telepathy-commits
mailing list