1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Show message when no capabilities available

This commit is contained in:
James Booth 2014-09-21 23:21:48 +01:00
parent f04ed28886
commit 9f7a8cea81
2 changed files with 9 additions and 8 deletions

View File

@ -286,15 +286,15 @@ _cons_show_caps(const char * const fulljid, Resource *resource)
{ {
ProfWin *console = wins_get_console(); ProfWin *console = wins_get_console();
cons_show(""); cons_show("");
Capabilities *caps = caps_lookup(fulljid);
if (caps) {
const char *resource_presence = string_from_resource_presence(resource->presence); const char *resource_presence = string_from_resource_presence(resource->presence);
int presence_colour = win_presence_colour(resource_presence); int presence_colour = win_presence_colour(resource_presence);
win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", fulljid); win_save_vprint(console, '-', NULL, NO_EOL, presence_colour, "", "%s", fulljid);
win_save_print(console, '-', NULL, NO_DATE, 0, "", ":"); win_save_print(console, '-', NULL, NO_DATE, 0, "", ":");
Capabilities *caps = caps_lookup(fulljid);
if (caps) {
// show identity // show identity
if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) { if ((caps->category != NULL) || (caps->type != NULL) || (caps->name != NULL)) {
win_save_print(console, '-', NULL, NO_EOL, 0, "", "Identity: "); win_save_print(console, '-', NULL, NO_EOL, 0, "", "Identity: ");
@ -342,6 +342,9 @@ _cons_show_caps(const char * const fulljid, Resource *resource)
feature = g_slist_next(feature); feature = g_slist_next(feature);
} }
} }
} else {
cons_show("No capabilities found for %s", fulljid);
} }
cons_alert(); cons_alert();

View File

@ -199,9 +199,7 @@ caps_create_sha1_str(xmpp_stanza_t * const query)
curr = g_slist_next(curr); curr = g_slist_next(curr);
} }
log_debug("Generating capabilities hash for: %s", s->str);
char *result = p_sha1_hash(s->str); char *result = p_sha1_hash(s->str);
log_debug("Hash: %s", result);
g_string_free(s, TRUE); g_string_free(s, TRUE);
g_slist_free_full(identities, g_free); g_slist_free_full(identities, g_free);