summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2022-08-17 12:53:29 +0200
committerxengineering <me@xengineering.eu>2022-08-19 12:13:49 +0200
commite6667aed7aaa5e60b3ded91aa5a6c28bf6da3314 (patch)
tree8e61c3ad3aa701cc13fca1f6f33e8eb95d932f63 /data.c
parentc584fa579ab1ce12e162580a6e443b9035dd3f88 (diff)
downloadlimox-e6667aed7aaa5e60b3ded91aa5a6c28bf6da3314.tar
limox-e6667aed7aaa5e60b3ded91aa5a6c28bf6da3314.tar.zst
limox-e6667aed7aaa5e60b3ded91aa5a6c28bf6da3314.zip
Implement roster to chat view transition
Diffstat (limited to 'data.c')
-rw-r--r--data.c21
1 files changed, 21 insertions, 0 deletions
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;
+ }
+ }
+
+}