summaryrefslogtreecommitdiff
path: root/src/rexmpp_roster.c
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2020-07-04 11:48:43 +0300
committerdefanor <defanor@uberspace.net>2020-07-04 11:48:43 +0300
commitc09bb4e4434667debc0e28d25b5a358ef4ffb498 (patch)
tree03fd85ad0986b68288417e7e0a94c4b9193e4238 /src/rexmpp_roster.c
parentf9c2810adb8e19a228535ea7c8b131a5e8b6928e (diff)
Fill weechat nicklists
The server buffer's nicklist is filled with roster items, and MUC buffers' nicklists are filled with active MUC participants. No MUC role indications, groups, or contact presence tracking yet.
Diffstat (limited to 'src/rexmpp_roster.c')
-rw-r--r--src/rexmpp_roster.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rexmpp_roster.c b/src/rexmpp_roster.c
index 8479c14..3d62613 100644
--- a/src/rexmpp_roster.c
+++ b/src/rexmpp_roster.c
@@ -81,6 +81,9 @@ rexmpp_err_t rexmpp_modify_roster (rexmpp_t *s, xmlNodePtr item) {
if (subscription != NULL) {
free(subscription);
}
+ if (s->roster_modify_cb != NULL) {
+ s->roster_modify_cb(s, item);
+ }
return ret;
}
@@ -93,6 +96,15 @@ void rexmpp_roster_set (rexmpp_t *s, xmlNodePtr query) {
}
s->roster_ver = xmlGetProp(query, "ver");
s->roster_items = xmlCopyNodeList(xmlFirstElementChild(query));
+ if (s->roster_modify_cb != NULL) {
+ xmlNodePtr item;
+ for (item = xmlFirstElementChild(query);
+ item != NULL;
+ item = xmlNextElementSibling(item))
+ {
+ s->roster_modify_cb(s, item);
+ }
+ }
}
void rexmpp_roster_cache_read (rexmpp_t *s) {