about summary refs log tree commit diff stats
path: root/src/xmpp/iq.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-02-17 16:39:37 +0000
committerJames Booth <boothj5@gmail.com>2013-02-17 16:39:37 +0000
commite955df889445b7d30b02aaaf7f0bd92b7044f67a (patch)
tree0c5ae2ed1a2808d06388f0952bf1e6e44f79e7a5 /src/xmpp/iq.c
parent91289b8d8d08635e6ced62f1280c1eb2bdbfd87e (diff)
downloadprofani-tty-e955df889445b7d30b02aaaf7f0bd92b7044f67a.tar.gz
Colour title on /caps and /software output
Diffstat (limited to 'src/xmpp/iq.c')
-rw-r--r--src/xmpp/iq.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index b98d3bc6..4858482c 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -29,7 +29,9 @@
 
 #include "common.h"
 #include "contact_list.h"
+#include "jid.h"
 #include "log.h"
+#include "muc.h"
 #include "profanity.h"
 #include "xmpp/capabilities.h"
 #include "xmpp/connection.h"
@@ -207,7 +209,19 @@ _iq_handle_version_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza
         os_str = xmpp_stanza_get_text(os);
     }
 
-    prof_handle_version_result(jid, name_str, version_str, os_str);
+    PContact contact;
+    Jid *jidp = jid_create(jid);
+    if (muc_room_is_active(jidp)) {
+        contact = muc_get_participant(jidp->barejid, jidp->resourcepart);
+    } else {
+        contact = contact_list_get_contact(jidp->barejid);
+    }
+
+    Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
+    const char *presence = string_from_resource_presence(resource->presence);
+    prof_handle_version_result(jid, presence, name_str, version_str, os_str);
+
+    jid_destroy(jidp);
 
     return 1;
 }