summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-08-31 16:13:18 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-08-31 16:13:18 +0000
commitb532986e5b6931fa485c387b61fb5d04184c7198 (patch)
tree1b9fec8b5f04f18aa8494ebe5afdc5eb70efd31c /src
parent6019a5cd15d8aad1f78b415fe3aa468ee1131e7a (diff)
downloadirssi-b532986e5b6931fa485c387b61fb5d04184c7198.zip
changed /FORMAT default_event -> default_event_server (sorry for breaking
some themes, this is just so much better name for it :) and added a new default_event, which is the format for default numeric events from your current server. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2909 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/fe-common/irc/fe-events-numeric.c14
-rw-r--r--src/fe-common/irc/module-formats.c3
-rw-r--r--src/fe-common/irc/module-formats.h1
3 files changed, 9 insertions, 9 deletions
diff --git a/src/fe-common/irc/fe-events-numeric.c b/src/fe-common/irc/fe-events-numeric.c
index a7977c03..038c28de 100644
--- a/src/fe-common/irc/fe-events-numeric.c
+++ b/src/fe-common/irc/fe-events-numeric.c
@@ -808,6 +808,7 @@ static void print_event_received(IRC_SERVER_REC *server, const char *data,
const char *nick, int target_param)
{
char *target, *args, *ptr;
+ int format;
g_return_if_fail(data != NULL);
@@ -841,14 +842,11 @@ static void print_event_received(IRC_SERVER_REC *server, const char *data,
g_memmove(ptr+1, ptr+2, strlen(ptr+1));
}
- if (nick == NULL || server->real_address == NULL ||
- strcmp(nick, server->real_address) == 0)
- printtext(server, target, MSGLEVEL_CRAP, "%s", args);
- else {
- printformat(server, target, MSGLEVEL_CRAP,
- IRCTXT_DEFAULT_EVENT, nick, args,
- current_server_event);
- }
+ format = nick == NULL || server->real_address == NULL ||
+ strcmp(nick, server->real_address) == 0 ?
+ IRCTXT_DEFAULT_EVENT : IRCTXT_DEFAULT_EVENT_SERVER;
+ printformat(server, target, MSGLEVEL_CRAP, format,
+ nick, args, current_server_event);
g_free(args);
}
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index df22f18b..841ac4ca 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -153,7 +153,8 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "kill_server", "You were {error killed} by {server $0} {reason $1} {comment Path: $2}", 3, { 0, 0, 0 } },
{ "error", "{error ERROR} $0", 1, { 0 } },
{ "unknown_mode", "Unknown mode character $0", 1, { 0 } },
- { "default_event", "[$0] $1", 3, { 0, 0, 0 } },
+ { "default_event", "$1", 3, { 0, 0, 0 } },
+ { "default_event_server", "[$0] $1", 3, { 0, 0, 0 } },
/* ---- */
{ NULL, "Misc", 0 },
diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h
index 91e3b448..d8e5a081 100644
--- a/src/fe-common/irc/module-formats.h
+++ b/src/fe-common/irc/module-formats.h
@@ -125,6 +125,7 @@ enum {
IRCTXT_ERROR,
IRCTXT_UNKNOWN_MODE,
IRCTXT_DEFAULT_EVENT,
+ IRCTXT_DEFAULT_EVENT_SERVER,
IRCTXT_FILL_11,