summaryrefslogtreecommitdiff
path: root/src/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-09 15:50:04 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-09 15:50:04 +0000
commit41ff80bb3e2425b2cf1f930681d1e3682349f1d7 (patch)
tree171059609024d712d8fb28b2086801fcf415da5b /src/irc
parentf4d7561660912422b010a2aaa1323086cc80d681 (diff)
downloadirssi-41ff80bb3e2425b2cf1f930681d1e3682349f1d7.zip
You can specify the format of the /WALL text with /SET wall_format,
default is "[Wall/#channel] text". The WALL is also printed to screen. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@303 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/irc')
-rw-r--r--src/irc/core/irc-commands.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/irc/core/irc-commands.c b/src/irc/core/irc-commands.c
index b2571896..77e678e9 100644
--- a/src/irc/core/irc-commands.c
+++ b/src/irc/core/irc-commands.c
@@ -547,7 +547,7 @@ static void cmd_wall_hash(gpointer key, NICK_REC *nick, GSList **nicks)
static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
{
- char *params, *channame, *msg;
+ char *params, *channame, *msg, *args;
CHANNEL_REC *chanrec;
GSList *tmp, *nicks;
@@ -565,11 +565,17 @@ static void cmd_wall(const char *data, IRC_SERVER_REC *server, WI_IRC_REC *item)
nicks = NULL;
g_hash_table_foreach(chanrec->nicks, (GHFunc) cmd_wall_hash, &nicks);
+ args = g_strconcat(chanrec->name, " ", msg, NULL);
+ msg = parse_special_string(settings_get_str("wall_format"), server, item, args, NULL);
+ g_free(args);
+
for (tmp = nicks; tmp != NULL; tmp = tmp->next) {
NICK_REC *rec = tmp->data;
- irc_send_cmdv(server, "NOTICE %s :%s", rec->nick, msg);
+ if (g_strcasecmp(rec->nick, server->nick) != 0)
+ irc_send_cmdv(server, "NOTICE %s :%s", rec->nick, msg);
}
+ g_free(msg);
g_slist_free(nicks);
g_free(params);
@@ -772,6 +778,7 @@ void irc_commands_init(void)
settings_add_str("misc", "quit_message", "leaving");
settings_add_int("misc", "knockout_time", 300);
+ settings_add_str("misc", "wall_format", "[Wall/$0] $1");
knockout_tag = g_timeout_add(KNOCKOUT_TIMECHECK, (GSourceFunc) knockout_timeout, NULL);