From d82f48718bc6c69d734d0306867b866efc2f9719 Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 17 Aug 2022 11:39:16 +0200 Subject: Implement datastructure for roster --- limox.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'limox.c') diff --git a/limox.c b/limox.c index 123ca53..5bdaa7b 100644 --- a/limox.c +++ b/limox.c @@ -11,6 +11,7 @@ #include #include +#include // the state of limox @@ -66,9 +67,9 @@ static int roster_handler(xmpp_conn_t *conn, xmpp_stanza_t *stanza, for (xmpp_stanza_t* item = xmpp_stanza_get_children(query); item; item = xmpp_stanza_get_next(item)) { - gui_add_roster_item(xmpp_stanza_get_attribute(item, "jid"), - xmpp_stanza_get_attribute(item, "subscription"), - xmpp_stanza_get_attribute(item, "name")); + add_roster_item(xmpp_stanza_get_attribute(item, "jid"), + xmpp_stanza_get_attribute(item, "subscription"), + xmpp_stanza_get_attribute(item, "name")); } return 1; @@ -207,7 +208,8 @@ void limox_disconnect(void) { if (conn != NULL && xmpp_conn_is_connected(conn)) { xmpp_disconnect(conn); while (xmpp_conn_is_connected(conn)) { - xmpp_run_once(ctx, 200); + xmpp_run_once(ctx, 200); // TODO avoid with additional + // state "disconnecting" } if (!xmpp_conn_release(conn)) { printf("DEBUG: Could not free connection!\n"); -- cgit v1.2.3-70-g09d2