mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-31 06:06:22 +00:00
Tidy up roster loop
This commit is contained in:
7
jabber.c
7
jabber.c
@@ -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");
|
query = xmpp_stanza_get_child_by_name(stanza, "query");
|
||||||
cons_highlight_show("Roster:");
|
cons_highlight_show("Roster:");
|
||||||
|
|
||||||
for (item = xmpp_stanza_get_children(query); item;
|
item = xmpp_stanza_get_children(query);
|
||||||
item = xmpp_stanza_get_next(item)) {
|
while (item != NULL) {
|
||||||
name = xmpp_stanza_get_attribute(item, "name");
|
name = xmpp_stanza_get_attribute(item, "name");
|
||||||
jid = xmpp_stanza_get_attribute(item, "jid");
|
jid = xmpp_stanza_get_attribute(item, "jid");
|
||||||
|
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
char line[2 + strlen(name) + 2 + strlen(jid) + 1 + 1];
|
char line[2 + strlen(name) + 2 + strlen(jid) + 1 + 1];
|
||||||
sprintf(line, " %s (%s)", name, jid);
|
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);
|
sprintf(line, " %s", jid);
|
||||||
cons_show(line);
|
cons_show(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item = xmpp_stanza_get_next(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user