diff options
author | James Booth <boothj5@gmail.com> | 2014-02-02 00:59:32 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-02-02 00:59:32 +0000 |
commit | 9d957e5f937e415875a310585e5e1e2a538d0499 (patch) | |
tree | e9ae1206b88a75cbade4cf8035d4396d3cec7bc3 /src | |
parent | 92b85bb7f121dd5ad852b9c0702e9fccc4ef6d18 (diff) | |
download | profani-tty-9d957e5f937e415875a310585e5e1e2a538d0499.tar.gz |
Show message on /bookmark remove when bookmark does not exist
Diffstat (limited to 'src')
-rw-r--r-- | src/command/commands.c | 12 | ||||
-rw-r--r-- | src/xmpp/bookmark.c | 4 | ||||
-rw-r--r-- | src/xmpp/xmpp.h | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/src/command/commands.c b/src/command/commands.c index d07d15cc..368a644b 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1781,11 +1781,15 @@ cmd_bookmark(gchar **args, struct cmd_help_t help) cons_show("Bookmark updated for %s.", jid); } } else if (strcmp(cmd, "remove") == 0) { - bookmark_remove(jid, autojoin); - if (autojoin) { - cons_show("Autojoin disabled for %s.", jid); + gboolean removed = bookmark_remove(jid, autojoin); + if (removed) { + if (autojoin) { + cons_show("Autojoin disabled for %s.", jid); + } else { + cons_show("Bookmark removed for %s.", jid); + } } else { - cons_show("Bookmark removed for %s.", jid); + cons_show("No bookmark exists for %s.", jid); } } else { cons_show("Usage: %s", help.usage); diff --git a/src/xmpp/bookmark.c b/src/xmpp/bookmark.c index 11fe95c8..0ed58ecb 100644 --- a/src/xmpp/bookmark.c +++ b/src/xmpp/bookmark.c @@ -71,7 +71,7 @@ _bookmark_add(const char *jid, const char *nick, gboolean autojoin) return FALSE; } -static void +static gboolean _bookmark_remove(const char *jid, gboolean autojoin) { /* TODO: manage bookmark_list */ @@ -81,6 +81,8 @@ _bookmark_remove(const char *jid, gboolean autojoin) /* TODO: send request */ autocomplete_remove(bookmark_ac, jid); } + + return FALSE; } static const GList * diff --git a/src/xmpp/xmpp.h b/src/xmpp/xmpp.h index 31ddfccd..fdbcb500 100644 --- a/src/xmpp/xmpp.h +++ b/src/xmpp/xmpp.h @@ -133,7 +133,7 @@ Capabilities* (*caps_get)(const char * const caps_str); void (*caps_close)(void); gboolean (*bookmark_add)(const char *jid, const char *nick, gboolean autojoin); -void (*bookmark_remove)(const char *jid, gboolean autojoin); +gboolean (*bookmark_remove)(const char *jid, gboolean autojoin); const GList * (*bookmark_get_list)(void); char * (*bookmark_find)(char *search_str); void (*bookmark_autocomplete_reset)(void); |