From bdde1d884c9c380770ea7487e1ce520d8c132308 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 29 Jul 2001 01:46:34 +0000 Subject: [PATCH] /NOTIFY, /NOTIFY -list: Added "The notify list is empty" message git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1669 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/notifylist/fe-notifylist.c | 12 ++++++++++-- src/fe-common/irc/notifylist/module-formats.c | 1 + src/fe-common/irc/notifylist/module-formats.h | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/fe-common/irc/notifylist/fe-notifylist.c b/src/fe-common/irc/notifylist/fe-notifylist.c index dd4cbd2f..0afff392 100644 --- a/src/fe-common/irc/notifylist/fe-notifylist.c +++ b/src/fe-common/irc/notifylist/fe-notifylist.c @@ -89,8 +89,11 @@ static void cmd_notify_show(void) GSList *nicks, *offline, *tmp; IRC_SERVER_REC *server; - if (notifies == NULL) + if (notifies == NULL) { + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + IRCTXT_NOTIFY_LIST_EMPTY); return; + } /* build a list containing only the nicks */ nicks = NULL; @@ -164,7 +167,12 @@ static void notifylist_print(NOTIFYLIST_REC *rec) static void cmd_notifylist_show(void) { - g_slist_foreach(notifies, (GFunc) notifylist_print, NULL); + if (notifies == NULL) { + printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE, + IRCTXT_NOTIFY_LIST_EMPTY); + } else { + g_slist_foreach(notifies, (GFunc) notifylist_print, NULL); + } } static void cmd_notify(const char *data) diff --git a/src/fe-common/irc/notifylist/module-formats.c b/src/fe-common/irc/notifylist/module-formats.c index 0b29406e..0c1f3b2a 100644 --- a/src/fe-common/irc/notifylist/module-formats.c +++ b/src/fe-common/irc/notifylist/module-formats.c @@ -36,6 +36,7 @@ FORMAT_REC fecommon_irc_notifylist_formats[] = { "notify_online", "On $0: {hilight $1}", 2, { 0, 0 } }, { "notify_offline", "Offline: $0", 1, { 0 } }, { "notify_list", "$0: $1 $2 $3", 4, { 0, 0, 0, 0 } }, + { "notify_list_empty", "The notify list is empty", 0 }, { NULL, NULL, 0 }, }; diff --git a/src/fe-common/irc/notifylist/module-formats.h b/src/fe-common/irc/notifylist/module-formats.h index e934def3..712310c8 100644 --- a/src/fe-common/irc/notifylist/module-formats.h +++ b/src/fe-common/irc/notifylist/module-formats.h @@ -12,7 +12,8 @@ enum { IRCTXT_NOTIFY_UNIDLE, IRCTXT_NOTIFY_ONLINE, IRCTXT_NOTIFY_OFFLINE, - IRCTXT_NOTIFY_LIST + IRCTXT_NOTIFY_LIST, + IRCTXT_NOTIFY_LIST_EMPTY }; extern FORMAT_REC fecommon_irc_notifylist_formats[];