summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-24 12:39:52 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-10-24 12:39:52 +0200
commitf8f7c04633a37c627b4cca6aba7f65e78960adea (patch)
tree6d4538dceb9e7545184647dfbf8c968e47c43702 /src/plugins/irc
parent64c227b5138f12533a658dc744066d6ea1907e77 (diff)
downloadweechat-f8f7c04633a37c627b4cca6aba7f65e78960adea.zip
Display IRC server errors in appropriate buffer (channel or private if found)
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-protocol.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 0b938c6d6..09fa4bc60 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -181,6 +181,7 @@ irc_protocol_cmd_error (struct t_irc_server *server, const char *command,
{
int first_arg;
char *chan_nick, *args;
+ struct t_irc_channel *ptr_channel;
IRC_PROTOCOL_MIN_ARGS(4);
@@ -202,10 +203,14 @@ irc_protocol_cmd_error (struct t_irc_server *server, const char *command,
if (args[0] == ':')
args++;
- weechat_printf_tags (server->buffer,
+ ptr_channel = NULL;
+ if (chan_nick)
+ ptr_channel = irc_channel_search (server, chan_nick);
+
+ weechat_printf_tags ((ptr_channel) ? ptr_channel->buffer : server->buffer,
irc_protocol_tags (command, "irc_error"),
"%s%s%s%s",
- irc_buffer_get_server_prefix (server, "network"),
+ (ptr_channel) ? weechat_prefix ("network") : irc_buffer_get_server_prefix (server, "network"),
(chan_nick) ? chan_nick : "",
(chan_nick) ? ": " : "",
args);