Show "request pending" in /sub show, when request has been sent

This commit is contained in:
James Booth
2012-11-27 22:26:42 +00:00
parent 4b460100ad
commit 2f2fa8de66
8 changed files with 42 additions and 18 deletions

View File

@@ -760,7 +760,15 @@ _roster_handler(xmpp_conn_t * const conn,
const char *jid = xmpp_stanza_get_attribute(item, STANZA_ATTR_JID);
const char *name = xmpp_stanza_get_attribute(item, STANZA_ATTR_NAME);
const char *sub = xmpp_stanza_get_attribute(item, STANZA_ATTR_SUBSCRIPTION);
gboolean added = contact_list_add(jid, name, "offline", NULL, sub);
gboolean pending_out = FALSE;
const char *ask = xmpp_stanza_get_attribute(item, STANZA_ATTR_ASK);
if ((ask != NULL) && (strcmp(ask, "subscribe") == 0)) {
pending_out = TRUE;
}
gboolean added = contact_list_add(jid, name, "offline", NULL, sub,
pending_out);
if (!added) {
log_warning("Attempt to add contact twice: %s", jid);