mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-08-01 22:56:22 +00:00
Use offline presence for software version responses from non contacts
fixes #714
This commit is contained in:
@@ -983,6 +983,7 @@ _version_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
|
|||||||
presence = string_from_resource_presence(occupant->presence);
|
presence = string_from_resource_presence(occupant->presence);
|
||||||
} else {
|
} else {
|
||||||
PContact contact = roster_get_contact(jidp->barejid);
|
PContact contact = roster_get_contact(jidp->barejid);
|
||||||
|
if (contact) {
|
||||||
Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
|
Resource *resource = p_contact_get_resource(contact, jidp->resourcepart);
|
||||||
if (!resource) {
|
if (!resource) {
|
||||||
ui_handle_software_version_error(jidp->fulljid, "Unknown resource");
|
ui_handle_software_version_error(jidp->fulljid, "Unknown resource");
|
||||||
@@ -992,6 +993,9 @@ _version_result_handler(xmpp_conn_t *const conn, xmpp_stanza_t *const stanza,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
presence = string_from_resource_presence(resource->presence);
|
presence = string_from_resource_presence(resource->presence);
|
||||||
|
} else {
|
||||||
|
presence = "offline";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_show_software_version(jidp->fulljid, presence, name_str, version_str, os_str);
|
ui_show_software_version(jidp->fulljid, presence, name_str, version_str, os_str);
|
||||||
|
|||||||
Reference in New Issue
Block a user