about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2015-08-05 01:01:46 +0100
committerJames Booth <boothj5@gmail.com>2015-08-05 01:01:46 +0100
commit0b7c79ac13b80b12c776437b8ad603a808583686 (patch)
tree075d34ddf1d081c5b628eff83ff3c63aca2c6159 /src/xmpp
parentac3e7dd9e899013ca08ed7fbe3b0cfcbd823f7bd (diff)
downloadprofani-tty-0b7c79ac13b80b12c776437b8ad603a808583686.tar.gz
Use original JID in software version request in MUC
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/iq.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c
index 3221fc2c..58eded8c 100644
--- a/src/xmpp/iq.c
+++ b/src/xmpp/iq.c
@@ -886,18 +886,17 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
         os_str = xmpp_stanza_get_text(os);
     }
 
-    Jid *jidp = jid_create(jid);
+    if (g_strcmp0(jid, (char*)userdata) != 0) {
+        log_warning("From attribute specified different JID, using original JID.");
+    }
+
+    Jid *jidp = jid_create((char*)userdata);
     const char *presence = NULL;
     if (muc_active(jidp->barejid)) {
         Occupant *occupant = muc_roster_item(jidp->barejid, jidp->resourcepart);
         presence = string_from_resource_presence(occupant->presence);
     } else {
         PContact contact = roster_get_contact(jidp->barejid);
-        if (!contact) {
-            jid_destroy(jidp);
-            jidp = jid_create((char*)userdata);
-            contact = roster_get_contact(jidp->barejid);
-        }
         Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
         presence = string_from_resource_presence(resource->presence);
     }