From e6667aed7aaa5e60b3ded91aa5a6c28bf6da3314 Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 17 Aug 2022 12:53:29 +0200 Subject: Implement roster to chat view transition --- data.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'data.c') diff --git a/data.c b/data.c index e2bfc30..c0a0592 100644 --- a/data.c +++ b/data.c @@ -64,3 +64,24 @@ void add_roster_item(const char* jid, const char* subscription, const char* name item->page_widget = gui_add_chat(); } + +void* data_get_chat_page(void* roster_item_widget) { + + if (roster == NULL) { + printf("Empty roster!\n"); + exit(1); + } else { + roster_item_t* current = roster; + while (1) { + if (current->widget == roster_item_widget) { + return current->page_widget; + } + if (current->next == NULL) { + printf("Could not find matching roster item!\n"); + exit(1); + } + current = current->next; + } + } + +} -- cgit v1.2.3-70-g09d2