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

Fixed invalid resource error

This commit is contained in:
James Booth 2013-02-17 19:28:25 +00:00
parent 893242d361
commit 657d1d4a49

View File

@ -1918,8 +1918,16 @@ _cmd_caps(gchar **args, struct cmd_help_t help)
cons_show("You must provide a full jid to the /caps command."); cons_show("You must provide a full jid to the /caps command.");
} else { } else {
PContact pcontact = contact_list_get_contact(jid->barejid); PContact pcontact = contact_list_get_contact(jid->barejid);
Resource *resource = p_contact_get_resource(pcontact, jid->resourcepart); if (pcontact == NULL) {
cons_show_caps(jid->fulljid, resource); cons_show("Contact not found in roster: %s", jid->barejid);
} else {
Resource *resource = p_contact_get_resource(pcontact, jid->resourcepart);
if (resource == NULL) {
cons_show("Could not find resource %s, for contact %s", jid->barejid, jid->resourcepart);
} else {
cons_show_caps(jid->fulljid, resource);
}
}
} }
} else { } else {
cons_show("You must provide a jid to the /caps command."); cons_show("You must provide a jid to the /caps command.");