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

Tidy up roster loop

This commit is contained in:
James Booth 2012-02-19 19:56:03 +00:00
parent 5a421b011e
commit ae1e037d0c

View File

@ -193,10 +193,11 @@ static int _roster_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz
query = xmpp_stanza_get_child_by_name(stanza, "query");
cons_highlight_show("Roster:");
for (item = xmpp_stanza_get_children(query); item;
item = xmpp_stanza_get_next(item)) {
item = xmpp_stanza_get_children(query);
while (item != NULL) {
name = xmpp_stanza_get_attribute(item, "name");
jid = xmpp_stanza_get_attribute(item, "jid");
if (name != NULL) {
char line[2 + strlen(name) + 2 + strlen(jid) + 1 + 1];
sprintf(line, " %s (%s)", name, jid);
@ -207,6 +208,8 @@ static int _roster_handler(xmpp_conn_t * const conn, xmpp_stanza_t * const stanz
sprintf(line, " %s", jid);
cons_show(line);
}
item = xmpp_stanza_get_next(item);
}
}