about summary refs log tree commit diff stats
path: root/src/xmpp
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-02-02 01:05:52 +0000
committerJames Booth <boothj5@gmail.com>2014-02-02 01:05:52 +0000
commit95c48a0f477d6ee7eb928cd9f11c3fa363754447 (patch)
tree82c21b6a99afcc71b72a1d21f7348ce2ff08e55f /src/xmpp
parent9d957e5f937e415875a310585e5e1e2a538d0499 (diff)
downloadprofani-tty-95c48a0f477d6ee7eb928cd9f11c3fa363754447.tar.gz
Test message when removing autojoin for non existent bookmark
Diffstat (limited to 'src/xmpp')
-rw-r--r--src/xmpp/bookmark.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c
index 0ed58ecb..e31a5795 100644
--- a/src/xmpp/bookmark.c
+++ b/src/xmpp/bookmark.c
@@ -61,6 +61,10 @@ bookmark_request(void)
 static gboolean
 _bookmark_add(const char *jid, const char *nick, gboolean autojoin)
 {
+    gboolean added = TRUE;
+    if (autocomplete_contains(bookmark_ac, jid)) {
+        added = FALSE;
+    }
     /* TODO: send request */
     /* TODO: manage bookmark_list */
 
@@ -68,12 +72,16 @@ _bookmark_add(const char *jid, const char *nick, gboolean autojoin)
     autocomplete_remove(bookmark_ac, jid);
     autocomplete_add(bookmark_ac, jid);
 
-    return FALSE;
+    return added;
 }
 
 static gboolean
 _bookmark_remove(const char *jid, gboolean autojoin)
 {
+    gboolean removed = FALSE;
+    if (autocomplete_contains(bookmark_ac, jid)) {
+        removed = TRUE;
+    }
     /* TODO: manage bookmark_list */
     if (autojoin) {
         /* TODO: just set autojoin=0 */
@@ -82,7 +90,7 @@ _bookmark_remove(const char *jid, gboolean autojoin)
         autocomplete_remove(bookmark_ac, jid);
     }
 
-    return FALSE;
+    return removed;
 }
 
 static const GList *