1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Rename caps_contains -> caps_cache_contains

This commit is contained in:
James Booth 2016-08-13 23:45:58 +01:00
parent 9cecef5609
commit e776ef9b68
4 changed files with 6 additions and 6 deletions

View File

@ -196,7 +196,7 @@ caps_map_jid_to_ver(const char *const jid, const char *const ver)
}
gboolean
caps_contains(const char *const ver)
caps_cache_contains(const char *const ver)
{
return (g_key_file_has_group(cache, ver));
}

View File

@ -52,7 +52,7 @@ void caps_init(void);
void caps_add_by_ver(const char *const ver, EntityCapabilities *caps);
void caps_add_by_jid(const char *const jid, EntityCapabilities *caps);
void caps_map_jid_to_ver(const char *const jid, const char *const ver);
gboolean caps_contains(const char *const ver);
gboolean caps_cache_contains(const char *const ver);
GList* caps_get_features(void);

View File

@ -742,7 +742,7 @@ _caps_response_id_handler(xmpp_stanza_t *const stanza, void *const userdata)
} else {
log_info("Valid SHA-1 hash found: %s", given_sha1);
if (caps_contains(given_sha1)) {
if (caps_cache_contains(given_sha1)) {
log_info("Capabilties already cached: %s", given_sha1);
} else {
log_info("Capabilities not cached: %s, storing", given_sha1);
@ -870,7 +870,7 @@ _caps_response_legacy_id_handler(xmpp_stanza_t *const stanza, void *const userda
// nodes match
if (g_strcmp0(expected_node, node) == 0) {
log_info("Legacy capabilities, nodes match %s", node);
if (caps_contains(node)) {
if (caps_cache_contains(node)) {
log_info("Capabilties already cached: %s", node);
} else {
log_info("Capabilities not cached: %s, storing", node);

View File

@ -553,7 +553,7 @@ _handle_caps(const char *const jid, XMPPCaps *caps)
if (g_strcmp0(caps->hash, "sha-1") == 0) {
log_info("Hash %s supported", caps->hash);
if (caps->ver) {
if (caps_contains(caps->ver)) {
if (caps_cache_contains(caps->ver)) {
log_info("Capabilities cache hit: %s, for %s.", caps->ver, jid);
caps_map_jid_to_ver(jid, caps->ver);
} else {
@ -666,7 +666,7 @@ _send_caps_request(char *node, char *caps_key, char *id, char *from)
if (node) {
log_debug("Node string: %s.", node);
if (!caps_contains(caps_key)) {
if (!caps_cache_contains(caps_key)) {
log_debug("Capabilities not cached for '%s', sending discovery IQ.", from);
xmpp_stanza_t *iq = stanza_create_disco_info_iq(ctx, id, from, node);
iq_send_stanza(iq);