diff options
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -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; + } + } + +} |