mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Renamed ID attribute for capabilities disco info request
This commit is contained in:
parent
e2bc9bde74
commit
e7202120cb
@ -445,7 +445,7 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
|
|||||||
g_slist_free_full(features, free);
|
g_slist_free_full(features, free);
|
||||||
g_slist_free_full(identities, (GDestroyNotify)_identity_destroy);
|
g_slist_free_full(identities, (GDestroyNotify)_identity_destroy);
|
||||||
}
|
}
|
||||||
} else if ((id != NULL) && (g_str_has_prefix(id, "disco"))) {
|
} else if ((id != NULL) && (g_str_has_prefix(id, "capsreq"))) {
|
||||||
log_debug("Response to query: %s", id);
|
log_debug("Response to query: %s", id);
|
||||||
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
|
xmpp_stanza_t *query = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_QUERY);
|
||||||
char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE);
|
char *node = xmpp_stanza_get_attribute(query, STANZA_ATTR_NODE);
|
||||||
@ -456,7 +456,7 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
|
|||||||
char *caps_key = NULL;
|
char *caps_key = NULL;
|
||||||
|
|
||||||
// xep-0115
|
// xep-0115
|
||||||
if (g_strcmp0(id, "disco") == 0) {
|
if (g_strcmp0(id, "capsreq") == 0) {
|
||||||
log_debug("xep-0115 supported capabilities");
|
log_debug("xep-0115 supported capabilities");
|
||||||
caps_key = strdup(node);
|
caps_key = strdup(node);
|
||||||
|
|
||||||
@ -480,7 +480,7 @@ _iq_handle_discoinfo_result(xmpp_conn_t * const conn, xmpp_stanza_t * const stan
|
|||||||
// non supported hash, or legacy caps
|
// non supported hash, or legacy caps
|
||||||
} else {
|
} else {
|
||||||
log_debug("Unsupported hash, or legacy capabilities");
|
log_debug("Unsupported hash, or legacy capabilities");
|
||||||
caps_key = strdup(id + 6);
|
caps_key = strdup(id + 8);
|
||||||
log_debug("Caps key: %s", caps_key);
|
log_debug("Caps key: %s", caps_key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,8 +37,6 @@
|
|||||||
#include "xmpp/stanza.h"
|
#include "xmpp/stanza.h"
|
||||||
#include "xmpp/xmpp.h"
|
#include "xmpp/xmpp.h"
|
||||||
|
|
||||||
#include "ui/ui.h"
|
|
||||||
|
|
||||||
static GHashTable *sub_requests;
|
static GHashTable *sub_requests;
|
||||||
|
|
||||||
#define HANDLE(ns, type, func) xmpp_handler_add(conn, func, ns, \
|
#define HANDLE(ns, type, func) xmpp_handler_add(conn, func, ns, \
|
||||||
@ -484,7 +482,7 @@ _get_caps_key(xmpp_stanza_t * const stanza)
|
|||||||
log_debug("Node string: %s.", node);
|
log_debug("Node string: %s.", node);
|
||||||
if (!caps_contains(caps_key)) {
|
if (!caps_contains(caps_key)) {
|
||||||
log_debug("Capabilities not cached for '%s', sending discovery IQ.", caps_key);
|
log_debug("Capabilities not cached for '%s', sending discovery IQ.", caps_key);
|
||||||
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, "disco", from, node);
|
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, "capsreq", from, node);
|
||||||
xmpp_send(conn, iq);
|
xmpp_send(conn, iq);
|
||||||
xmpp_stanza_release(iq);
|
xmpp_stanza_release(iq);
|
||||||
} else {
|
} else {
|
||||||
@ -507,7 +505,7 @@ _get_caps_key(xmpp_stanza_t * const stanza)
|
|||||||
log_debug("Node string: %s.", node);
|
log_debug("Node string: %s.", node);
|
||||||
if (!caps_contains(caps_key)) {
|
if (!caps_contains(caps_key)) {
|
||||||
log_debug("Capabilities not cached for '%s', sending discovery IQ.", from);
|
log_debug("Capabilities not cached for '%s', sending discovery IQ.", from);
|
||||||
GString *id = g_string_new("disco_");
|
GString *id = g_string_new("capsreq_");
|
||||||
g_string_append(id, from_hash_str);
|
g_string_append(id, from_hash_str);
|
||||||
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, id->str, from, node);
|
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, id->str, from, node);
|
||||||
xmpp_send(conn, iq);
|
xmpp_send(conn, iq);
|
||||||
@ -536,7 +534,7 @@ _get_caps_key(xmpp_stanza_t * const stanza)
|
|||||||
log_debug("Node string: %s.", node);
|
log_debug("Node string: %s.", node);
|
||||||
if (!caps_contains(caps_key)) {
|
if (!caps_contains(caps_key)) {
|
||||||
log_debug("Capabilities not cached for '%s', sending discovery IQ.", from);
|
log_debug("Capabilities not cached for '%s', sending discovery IQ.", from);
|
||||||
GString *id = g_string_new("disco_");
|
GString *id = g_string_new("capsreq_");
|
||||||
g_string_append(id, from_hash_str);
|
g_string_append(id, from_hash_str);
|
||||||
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, id->str, from, node);
|
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, id->str, from, node);
|
||||||
xmpp_send(conn, iq);
|
xmpp_send(conn, iq);
|
||||||
|
Loading…
Reference in New Issue
Block a user