about summary refs log tree commit diff stats
path: root/src/xmpp/bookmark.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2016-05-23 23:53:44 +0100
committerJames Booth <boothj5@gmail.com>2016-05-23 23:53:44 +0100
commit6559263b2fed1edc6b004dc3e50697600e450b9b (patch)
tree7b17f7d326ada6abb958e362fd76c8b4abc019f7 /src/xmpp/bookmark.c
parent0edd4309257a8372761f44cbd576b027d1b9766c (diff)
downloadprofani-tty-6559263b2fed1edc6b004dc3e50697600e450b9b.tar.gz
Option to bookmark room invites
issue #813
Diffstat (limited to 'src/xmpp/bookmark.c')
-rw-r--r--src/xmpp/bookmark.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c
index 0f88a129..8c859a92 100644
--- a/src/xmpp/bookmark.c
+++ b/src/xmpp/bookmark.c
@@ -240,6 +240,24 @@ bookmark_autocomplete_reset(void)
     }
 }
 
+gboolean
+bookmark_exists(const char *const room)
+{
+    GSList *bookmarks = autocomplete_create_list(bookmark_ac);
+    GSList *curr = bookmarks;
+    while (curr) {
+        if (strcmp(curr->data, room) == 0) {
+            g_slist_free_full(bookmarks, g_free);
+            return TRUE;
+        } else {
+            curr = g_slist_next(curr);
+        }
+    }
+    g_slist_free_full(bookmarks, g_free);
+
+    return FALSE;
+}
+
 static int
 _bookmark_result_id_handler(xmpp_stanza_t *const stanza, void *const userdata)
 {