about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/jabber.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/jabber.c b/src/jabber.c
index 966c6b3b..1d8a3dde 100644
--- a/src/jabber.c
+++ b/src/jabber.c
@@ -256,8 +256,20 @@ _jabber_message_handler(xmpp_conn_t * const conn,
     xmpp_stanza_t * const stanza, void * const userdata)
 {
     xmpp_stanza_t *body = xmpp_stanza_get_child_by_name(stanza, "body");
-    if(body == NULL)
+
+    // if no message, check for chatstates
+    if (body == NULL) {
+        if (xmpp_stanza_get_child_by_name(stanza, "active") != NULL) {
+            // active
+        } else if (xmpp_stanza_get_child_by_name(stanza, "composing") != NULL) {
+            // composing
+            char *from = xmpp_stanza_get_attribute(stanza, "from");
+            cons_show(from);
+            cons_show("is composing a message");
+        }
+        
         return 1;
+    }
 
     char *type = xmpp_stanza_get_attribute(stanza, "type");
     if(strcmp(type, "error") == 0)