diff options
author | xengineering <me@xengineering.eu> | 2022-08-17 11:39:16 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2022-08-17 11:39:16 +0200 |
commit | d82f48718bc6c69d734d0306867b866efc2f9719 (patch) | |
tree | 6f0d3798018af0c41729810c55546b89450e16f3 /limox.c | |
parent | 94cca91f9c0036a5ceb95ff4099d2cdc3d9265af (diff) | |
download | limox-d82f48718bc6c69d734d0306867b866efc2f9719.tar limox-d82f48718bc6c69d734d0306867b866efc2f9719.tar.zst limox-d82f48718bc6c69d734d0306867b866efc2f9719.zip |
Implement datastructure for roster
Diffstat (limited to 'limox.c')
-rw-r--r-- | limox.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -11,6 +11,7 @@ #include <gui.h> #include <limox.h> +#include <data.h> // 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"); |