Compare commits
1 Commits
c9455d27ba
...
fix/disco-
| Author | SHA1 | Date | |
|---|---|---|---|
|
d914e42ff6
|
@@ -749,14 +749,21 @@ connection_get_user(void)
|
|||||||
return connection_get_jid()->localpart;
|
return connection_get_jid()->localpart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NULL 'from' means the server (RFC 6120 §8.1.2.1)
|
||||||
|
static const char*
|
||||||
|
_get_from_via_jid(const char* const jid)
|
||||||
|
{
|
||||||
|
return jid ? jid : conn.domain;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
connection_features_received(const char* const jid)
|
connection_features_received(const char* const jid)
|
||||||
{
|
{
|
||||||
log_info("[CONNECTION] connection_features_received %s", jid);
|
const char* key = _get_from_via_jid(jid);
|
||||||
const char* key = jid ? jid : conn.domain; // g_str_hash crashes on NULL; NULL 'from' means the server (RFC 6120 §8.1.2.1)
|
|
||||||
if (!key) {
|
if (!key) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
log_info("[CONNECTION] connection_features_received %s", key);
|
||||||
if (g_hash_table_remove(conn.requested_features, key) && g_hash_table_size(conn.requested_features) == 0) {
|
if (g_hash_table_remove(conn.requested_features, key) && g_hash_table_size(conn.requested_features) == 0) {
|
||||||
sv_ev_connection_features_received();
|
sv_ev_connection_features_received();
|
||||||
}
|
}
|
||||||
@@ -765,7 +772,7 @@ connection_features_received(const char* const jid)
|
|||||||
GHashTable*
|
GHashTable*
|
||||||
connection_get_features(const char* const jid)
|
connection_get_features(const char* const jid)
|
||||||
{
|
{
|
||||||
const char* key = jid ? jid : conn.domain;
|
const char* key = _get_from_via_jid(jid);
|
||||||
if (!key || !conn.features_by_jid) {
|
if (!key || !conn.features_by_jid) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user