diff options
author | Timo Sirainen <cras@irssi.org> | 2001-08-13 14:00:57 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-08-13 14:00:57 +0000 |
commit | f370a3cc2e5079d99a5ec3416c796052f969cf37 (patch) | |
tree | 1dba1e597baee48cd67ff0a1131141ae08ffd214 /src | |
parent | ad33787379b6e7cc93192afda0ba0064d360332a (diff) | |
download | irssi-f370a3cc2e5079d99a5ec3416c796052f969cf37.zip |
/INVITELIST prints "Invite list is empty" message and complains about not
being synced. Changed level to CLIENTNOTICE when printing the "no bans"
message.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1744 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/irc/fe-irc-commands.c | 17 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.c | 1 | ||||
-rw-r--r-- | src/fe-common/irc/module-formats.h | 1 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 482bc040..2ec00b1b 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -211,7 +211,7 @@ static void bans_show_channel(IRC_CHANNEL_REC *channel, IRC_SERVER_REC *server) cmd_return_error(CMDERR_CHAN_NOT_SYNCED); if (channel->banlist == NULL && channel->ebanlist == NULL) { - printformat(server, channel->name, MSGLEVEL_CRAP, + printformat(server, channel->name, MSGLEVEL_CLIENTNOTICE, IRCTXT_NO_BANS, channel->name); return; } @@ -302,8 +302,19 @@ static void cmd_invitelist(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC channel = irc_channel_find(server, data); if (channel == NULL) cmd_return_error(CMDERR_CHAN_NOT_FOUND); - for (tmp = channel->invitelist; tmp != NULL; tmp = tmp->next) - printformat(server, channel->name, MSGLEVEL_CRAP, IRCTXT_INVITELIST, channel->name, tmp->data); + if (!channel->synced) + cmd_return_error(CMDERR_CHAN_NOT_SYNCED); + + if (channel->invitelist == NULL) { + printformat(server, channel->name, MSGLEVEL_CLIENTNOTICE, + IRCTXT_NO_INVITELIST, channel->name); + } else { + for (tmp = channel->invitelist; tmp != NULL; tmp = tmp->next) { + printformat(server, channel->name, MSGLEVEL_CRAP, + IRCTXT_INVITELIST, + channel->name, tmp->data); + } + } } static void cmd_join(const char *data, IRC_SERVER_REC *server) diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c index c2136c70..2cae6518 100644 --- a/src/fe-common/irc/module-formats.c +++ b/src/fe-common/irc/module-formats.c @@ -73,6 +73,7 @@ FORMAT_REC fecommon_irc_formats[] = { { "banlist_long", "$0 - {channel $1}: ban {ban $2} {comment by {nick $3}, $4 secs ago}", 5, { 1, 0, 0, 0, 1 } }, { "ebanlist", "{channel $0}: ban exception {ban $1}", 2, { 0, 0 } }, { "ebanlist_long", "{channel $0}: ban exception {ban $1} {comment by {nick $2}, $3 secs ago}", 4, { 0, 0, 0, 1 } }, + { "no_invitelist", "Invite list is empty in channel {channel $0}", 1, { 0 } }, { "invitelist", "{channel $0}: invite {ban $1}", 2, { 0, 0 } }, { "no_such_channel", "{channel $0}: No such channel", 1, { 0 } }, { "channel_synced", "Join to {channel $0} was synced in {hilight $1} secs", 2, { 0, 2 } }, diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h index 08bc1550..6722ede1 100644 --- a/src/fe-common/irc/module-formats.h +++ b/src/fe-common/irc/module-formats.h @@ -50,6 +50,7 @@ enum { IRCTXT_BANLIST_LONG, IRCTXT_EBANLIST, IRCTXT_EBANLIST_LONG, + IRCTXT_NO_INVITELIST, IRCTXT_INVITELIST, IRCTXT_NO_SUCH_CHANNEL, IRCTXT_CHANNEL_SYNCED, |