mirror of
https://github.com/profanity-im/profanity.git
synced 2024-12-04 14:46:46 -05:00
Log errors on caps responses
This commit is contained in:
parent
ce43af616e
commit
c343b3ecef
@ -354,6 +354,20 @@ _caps_response_handler(xmpp_conn_t *const conn, xmpp_stanza_t * const stanza,
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *type = xmpp_stanza_get_type(stanza);
|
||||
// handle error responses
|
||||
if (g_strcmp0(type, STANZA_TYPE_ERROR) == 0) {
|
||||
char *error_message = stanza_get_error_message(stanza);
|
||||
log_warning("Error received for capabilities response from %s: ", from, error_message);
|
||||
free(error_message);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (query == NULL) {
|
||||
log_warning("No query element found.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE);
|
||||
if (node == NULL) {
|
||||
log_warning("No node attribute found");
|
||||
|
@ -726,12 +726,6 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
|
||||
log_debug("Room presence received from %s", from_jid->fulljid);
|
||||
|
||||
// send disco info for capabilities, if not cached
|
||||
if (stanza_contains_caps(stanza)) {
|
||||
log_info("Presence contains capabilities.");
|
||||
_handle_caps(stanza);
|
||||
}
|
||||
|
||||
status_str = stanza_get_status(stanza, NULL);
|
||||
|
||||
if ((type != NULL) && (strcmp(type, STANZA_TYPE_UNAVAILABLE) == 0)) {
|
||||
@ -747,6 +741,12 @@ _muc_user_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanza,
|
||||
handle_room_member_offline(from_room, from_nick, "offline", status_str);
|
||||
}
|
||||
} else {
|
||||
// send disco info for capabilities, if not cached
|
||||
if (stanza_contains_caps(stanza)) {
|
||||
log_info("Presence contains capabilities.");
|
||||
_handle_caps(stanza);
|
||||
}
|
||||
|
||||
char *show_str = stanza_get_show(stanza, "online");
|
||||
if (!muc_get_roster_received(from_room)) {
|
||||
muc_add_to_roster(from_room, from_nick, show_str, status_str);
|
||||
|
Loading…
Reference in New Issue
Block a user