Show message on /bookmark remove when bookmark does not exist
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 *
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user