diff options
Diffstat (limited to 'src/xmpp/iq.c')
-rw-r--r-- | src/xmpp/iq.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/xmpp/iq.c b/src/xmpp/iq.c index 4a354a23..10355332 100644 --- a/src/xmpp/iq.c +++ b/src/xmpp/iq.c @@ -493,16 +493,17 @@ _version_result_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza, os_str = xmpp_stanza_get_text(os); } - PContact contact; Jid *jidp = jid_create(jid); - if (muc_room_is_active(jidp->barejid)) { - contact = muc_get_participant(jidp->barejid, jidp->resourcepart); + 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 { - contact = roster_get_contact(jidp->barejid); + PContact contact = roster_get_contact(jidp->barejid); + Resource *resource = p_contact_get_resource(contact, jidp->resourcepart); + presence = string_from_resource_presence(resource->presence); } - Resource *resource = p_contact_get_resource(contact, jidp->resourcepart); - const char *presence = string_from_resource_presence(resource->presence); handle_software_version_result(jid, presence, name_str, version_str, os_str); jid_destroy(jidp); |