summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/alias.c2
-rw-r--r--src/common/command.c718
-rw-r--r--src/common/completion.c20
-rw-r--r--src/common/fifo.c12
-rw-r--r--src/common/session.c10
-rw-r--r--src/common/weechat.c20
-rw-r--r--src/common/weeconfig.c18
-rw-r--r--src/common/weeconfig.h2
-rw-r--r--src/gui/curses/gui-curses-chat.c72
-rw-r--r--src/gui/curses/gui-curses-color.c112
-rw-r--r--src/gui/curses/gui-curses-infobar.c16
-rw-r--r--src/gui/curses/gui-curses-input.c98
-rw-r--r--src/gui/curses/gui-curses-keyboard.c10
-rw-r--r--src/gui/curses/gui-curses-main.c14
-rw-r--r--src/gui/curses/gui-curses-nicklist.c48
-rw-r--r--src/gui/curses/gui-curses-status.c191
-rw-r--r--src/gui/curses/gui-curses-window.c26
-rw-r--r--src/gui/gtk/gui-gtk-color.c58
-rw-r--r--src/gui/gtk/gui-gtk-input.c12
-rw-r--r--src/gui/gtk/gui-gtk-main.c131
-rw-r--r--src/gui/gtk/gui-gtk-nicklist.c2
-rw-r--r--src/gui/gtk/gui-gtk-window.c20
-rw-r--r--src/gui/gtk/gui-gtk.h22
-rw-r--r--src/gui/gui-action.c84
-rw-r--r--src/gui/gui-buffer.c72
-rw-r--r--src/gui/gui-buffer.h73
-rw-r--r--src/gui/gui-color.h130
-rw-r--r--src/gui/gui-common.c102
-rw-r--r--src/gui/gui-keyboard.c6
-rw-r--r--src/gui/gui-keyboard.h3
-rw-r--r--src/gui/gui-log.c30
-rw-r--r--src/gui/gui-window.c11
-rw-r--r--src/gui/gui.h8
-rw-r--r--src/irc/irc-channel.c40
-rw-r--r--src/irc/irc-dcc.c388
-rw-r--r--src/irc/irc-display.c145
-rw-r--r--src/irc/irc-ignore.c15
-rw-r--r--src/irc/irc-mode.c14
-rw-r--r--src/irc/irc-nick.c68
-rw-r--r--src/irc/irc-recv.c956
-rw-r--r--src/irc/irc-send.c276
-rw-r--r--src/irc/irc-server.c128
-rw-r--r--src/irc/irc.h119
-rw-r--r--src/plugins/plugins-config.c4
-rw-r--r--src/plugins/plugins-interface.c22
-rw-r--r--src/plugins/plugins.c56
46 files changed, 2170 insertions, 2214 deletions
diff --git a/src/common/alias.c b/src/common/alias.c
index 245ea8286..b08eef96c 100644
--- a/src/common/alias.c
+++ b/src/common/alias.c
@@ -164,7 +164,7 @@ alias_get_final_command (t_weechat_alias *alias)
if (alias->running)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s circular reference when calling alias \"/%s\"\n"),
WEECHAT_ERROR, alias->alias_name);
diff --git a/src/common/command.c b/src/common/command.c
index 80dc43e7e..595ce45cf 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -426,7 +426,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
switch (rc)
{
case 0: /* plugin handler KO */
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s command \"%s\" failed\n"),
WEECHAT_ERROR, command + 1);
@@ -446,7 +446,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
{
if (ptr_alias->running == 1)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s circular reference when calling alias \"/%s\"\n"),
WEECHAT_ERROR, ptr_alias->alias_name);
@@ -552,7 +552,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
if (weechat_commands[i].min_arg ==
weechat_commands[i].max_arg)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
NG_("%s wrong argument count for %s command \"%s\" "
"(expected: %d arg)\n",
@@ -565,7 +565,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
NG_("%s wrong argument count for %s command \"%s\" "
"(expected: between %d and %d arg)\n",
@@ -596,7 +596,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
if (return_code < 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s command \"%s\" failed\n"),
WEECHAT_ERROR, command + 1);
@@ -622,7 +622,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
{
if (irc_commands[i].min_arg == irc_commands[i].max_arg)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf
(NULL,
NG_("%s wrong argument count for IRC command \"%s\" "
@@ -636,7 +636,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf
(NULL,
NG_("%s wrong argument count for IRC command \"%s\" "
@@ -654,7 +654,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
if ((irc_commands[i].needs_connection) &&
((!server) || (!server->is_connected)))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s command \"%s\" needs a server connection!\n"),
WEECHAT_ERROR, irc_commands[i].command_name);
@@ -663,7 +663,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
if (channel && channel->dcc_chat)
{
- irc_display_prefix (server, channel->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, channel->buffer, GUI_PREFIX_ERROR);
gui_printf (channel->buffer,
_("%s command \"%s\" can not be "
"executed on DCC CHAT buffer\n"),
@@ -688,7 +688,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
(server, channel, (ptr_args2) ? ptr_args2 : ptr_args);
if (return_code < 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s command \"%s\" failed\n"),
WEECHAT_ERROR, command + 1);
@@ -724,7 +724,7 @@ exec_weechat_command (t_irc_server *server, t_irc_channel *channel, char *string
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown command \"%s\" (type /help for help). "
"To send unknown commands to IRC server, enable option "
@@ -748,33 +748,33 @@ user_message_display (t_irc_server *server, t_gui_buffer *buffer, char *text)
{
t_irc_nick *ptr_nick;
- if ((CHANNEL(buffer)->type == CHANNEL_TYPE_PRIVATE)
- || (CHANNEL(buffer)->type == CHANNEL_TYPE_DCC_CHAT))
+ if ((GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT))
{
irc_display_nick (buffer, NULL, server->nick,
- MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0);
+ GUI_MSG_TYPE_NICK, 1, GUI_COLOR_WIN_NICK_SELF, 0);
gui_printf_type (buffer,
- MSG_TYPE_MSG,
+ GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
text);
}
else
{
- ptr_nick = irc_nick_search (CHANNEL(buffer), server->nick);
+ ptr_nick = irc_nick_search (GUI_CHANNEL(buffer), server->nick);
if (ptr_nick)
{
irc_display_nick (buffer, ptr_nick, NULL,
- MSG_TYPE_NICK, 1, -1, 0);
+ GUI_MSG_TYPE_NICK, 1, -1, 0);
gui_printf_type (buffer,
- MSG_TYPE_MSG,
+ GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
text);
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot find nick for sending message\n"),
WEECHAT_ERROR);
@@ -797,7 +797,7 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
if (!server->is_connected)
{
- irc_display_prefix (server, buffer, PREFIX_ERROR);
+ irc_display_prefix (server, buffer, GUI_PREFIX_ERROR);
gui_printf (buffer, _("%s you are not connected to server\n"),
WEECHAT_ERROR);
return;
@@ -808,7 +808,7 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
saved_char = '\0';
max_length = 512 - 16 - 65 - 10 - strlen (server->nick) -
- strlen (CHANNEL(buffer)->name);
+ strlen (GUI_CHANNEL(buffer)->name);
if (max_length > 0)
{
@@ -833,7 +833,8 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
}
}
- irc_server_sendf_queued (server, "PRIVMSG %s :%s", CHANNEL(buffer)->name, text);
+ irc_server_sendf_queued (server, "PRIVMSG %s :%s",
+ GUI_CHANNEL(buffer)->name, text);
user_message_display (server, buffer, text);
if (next)
@@ -916,22 +917,22 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
if ((ptr_cmd[0] == '/') && (ptr_cmd[1] == '/'))
ptr_cmd++;
- if (server && (!BUFFER_IS_SERVER(buffer)))
+ if (server && (!GUI_BUFFER_IS_SERVER(buffer)))
{
command_with_colors = (char *)gui_color_encode ((unsigned char *)ptr_cmd,
cfg_irc_colors_send);
- if (CHANNEL(buffer)->dcc_chat)
+ if (GUI_CHANNEL(buffer)->dcc_chat)
{
- if (((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat))->sock < 0)
+ if (((t_irc_dcc *)(GUI_CHANNEL(buffer)->dcc_chat))->sock < 0)
{
- irc_display_prefix (server, buffer, PREFIX_ERROR);
+ irc_display_prefix (server, buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (buffer, "%s DCC CHAT is closed\n",
WEECHAT_ERROR);
}
else
{
- irc_dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat),
+ irc_dcc_chat_sendf ((t_irc_dcc *)(GUI_CHANNEL(buffer)->dcc_chat),
"%s\r\n",
(command_with_colors) ? command_with_colors : ptr_cmd);
user_message_display (server, buffer,
@@ -948,7 +949,7 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
}
else
{
- irc_display_prefix (NULL, (server) ? server->buffer : NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, (server) ? server->buffer : NULL, GUI_PREFIX_ERROR);
gui_printf_nolog ((server) ? server->buffer : NULL,
_("This window is not a channel!\n"));
}
@@ -997,7 +998,7 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
pos++;
if (!pos[0])
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
WEECHAT_ERROR, "alias");
return -1;
@@ -1007,13 +1008,13 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
if (weelist_add (&index_commands, &last_index_command, arguments,
WEELIST_POS_SORT))
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Alias \"%s\" => \"%s\" created\n"),
arguments, pos);
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("Failed to create alias \"%s\" => \"%s\" "
"(not enough memory)\n"),
arguments, pos);
@@ -1029,13 +1030,13 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
gui_printf (NULL, _("Alias:\n"));
gui_printf (NULL, " %s %s=>%s %s\n",
ptr_alias->alias_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_alias->alias_command);
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No alias found.\n"));
}
}
@@ -1052,14 +1053,14 @@ weechat_cmd_alias (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, " %s %s=>%s %s\n",
ptr_alias->alias_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_alias->alias_command);
}
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No alias defined.\n"));
}
}
@@ -1075,51 +1076,51 @@ weechat_cmd_buffer_display_info (t_gui_buffer *buffer)
{
switch (buffer->type)
{
- case BUFFER_TYPE_STANDARD:
- if (BUFFER_IS_SERVER(buffer))
+ case GUI_BUFFER_TYPE_STANDARD:
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- if (SERVER(buffer))
+ if (GUI_SERVER(buffer))
gui_printf (NULL, _("%sServer: %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
- SERVER(buffer)->name);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
+ GUI_SERVER(buffer)->name);
else
gui_printf (NULL, _("%snot connected\n"),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
- else if (BUFFER_IS_CHANNEL (buffer))
+ else if (GUI_BUFFER_IS_CHANNEL (buffer))
gui_printf (NULL, _("%sChannel: %s%s %s(server: %s%s%s)\n"),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- CHANNEL(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
- SERVER(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT));
- else if (BUFFER_IS_PRIVATE (buffer))
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_CHANNEL(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
+ GUI_SERVER(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
+ else if (GUI_BUFFER_IS_PRIVATE (buffer))
gui_printf (NULL, _("%sPrivate with: %s%s %s(server: %s%s%s)\n"),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- CHANNEL(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
- SERVER(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
+ GUI_CHANNEL(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
+ GUI_SERVER(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
else
gui_printf (NULL, _("%sunknown\n"),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
break;
- case BUFFER_TYPE_DCC:
+ case GUI_BUFFER_TYPE_DCC:
gui_printf (NULL, "%sDCC\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL));
break;
- case BUFFER_TYPE_RAW_DATA:
+ case GUI_BUFFER_TYPE_RAW_DATA:
gui_printf (NULL, _("%sraw IRC data\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL));
break;
default:
gui_printf (NULL, _("%sunknown\n"),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
break;
}
}
@@ -1154,10 +1155,10 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
gui_printf (NULL, "%s[%s%d%s] ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_buffer->number,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
weechat_cmd_buffer_display_info (ptr_buffer);
}
}
@@ -1169,7 +1170,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
if (argc < 2)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s missing arguments for \"%s\" command\n"),
WEECHAT_ERROR, "buffer");
free_exploded_string (argv);
@@ -1193,7 +1194,7 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
else
{
/* invalid number */
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect buffer number\n"),
WEECHAT_ERROR);
free_exploded_string (argv);
@@ -1207,22 +1208,22 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
if ((!buffer->next_buffer)
&& (buffer == gui_buffers)
&& ((!buffer->all_servers)
- || (!SERVER(buffer))))
+ || (!GUI_SERVER(buffer))))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s can not close the single buffer\n"),
WEECHAT_ERROR);
free_exploded_string (argv);
return -1;
}
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- if (SERVER(buffer))
+ if (GUI_SERVER(buffer))
{
- if (SERVER(buffer)->channels)
+ if (GUI_SERVER(buffer)->channels)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s can not close server buffer while channels "
"are open\n"),
@@ -1230,8 +1231,8 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
free_exploded_string (argv);
return -1;
}
- irc_server_disconnect (SERVER(buffer), 0);
- ptr_server = SERVER(buffer);
+ irc_server_disconnect (GUI_SERVER(buffer), 0);
+ ptr_server = GUI_SERVER(buffer);
if (!buffer->all_servers)
{
gui_buffer_free (buffer, 1);
@@ -1249,11 +1250,11 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (CHANNEL(buffer)
- && (CHANNEL(buffer)->type == CHANNEL_TYPE_DCC_CHAT))
+ if (GUI_CHANNEL(buffer)
+ && (GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT))
{
- ptr_server = SERVER(buffer);
- ptr_channel = CHANNEL(buffer);
+ ptr_server = GUI_SERVER(buffer);
+ ptr_channel = GUI_CHANNEL(buffer);
gui_buffer_free (ptr_channel->buffer, 1);
irc_channel_free (ptr_server, ptr_channel);
gui_status_draw (gui_current_window->buffer, 1);
@@ -1261,24 +1262,24 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (SERVER(buffer))
+ if (GUI_SERVER(buffer))
{
- if (SERVER(buffer)->is_connected
- && CHANNEL(buffer)
- && CHANNEL(buffer)->nicks)
+ if (GUI_SERVER(buffer)->is_connected
+ && GUI_CHANNEL(buffer)
+ && GUI_CHANNEL(buffer)->nicks)
{
pos = strstr (arguments, "close ");
if (pos)
pos += 6;
- CHANNEL(buffer)->close = 1;
- irc_send_cmd_part (SERVER(buffer),
- CHANNEL(buffer),
+ GUI_CHANNEL(buffer)->close = 1;
+ irc_send_cmd_part (GUI_SERVER(buffer),
+ GUI_CHANNEL(buffer),
pos);
}
else
{
- ptr_channel = CHANNEL(buffer);
- ptr_server = SERVER(buffer);
+ ptr_channel = GUI_CHANNEL(buffer);
+ ptr_server = GUI_SERVER(buffer);
gui_buffer_free (buffer, 1);
if (ptr_channel)
irc_channel_free (ptr_server, ptr_channel);
@@ -1321,12 +1322,12 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, " %d.%s:",
ptr_buffer->number,
- (ptr_buffer->type == BUFFER_TYPE_DCC) ? "DCC" :
- ((ptr_buffer->type == BUFFER_TYPE_RAW_DATA) ? _("Raw IRC data") :
- ((BUFFER_IS_SERVER(ptr_buffer) && SERVER(ptr_buffer)) ? SERVER(ptr_buffer)->name :
- ((CHANNEL(ptr_buffer)) ? (CHANNEL(ptr_buffer)->name) : "-"))));
- if ((!BUFFER_IS_CHANNEL(ptr_buffer))
- && (!BUFFER_IS_PRIVATE(ptr_buffer)))
+ (ptr_buffer->type == GUI_BUFFER_TYPE_DCC) ? "DCC" :
+ ((ptr_buffer->type == GUI_BUFFER_TYPE_RAW_DATA) ? _("Raw IRC data") :
+ ((GUI_BUFFER_IS_SERVER(ptr_buffer) && GUI_SERVER(ptr_buffer)) ? GUI_SERVER(ptr_buffer)->name :
+ ((GUI_CHANNEL(ptr_buffer)) ? (GUI_CHANNEL(ptr_buffer)->name) : "-"))));
+ if ((!GUI_BUFFER_IS_CHANNEL(ptr_buffer))
+ && (!GUI_BUFFER_IS_PRIVATE(ptr_buffer)))
gui_printf (NULL, "-");
else
gui_printf (NULL, "%d", ptr_buffer->notify_level);
@@ -1340,22 +1341,22 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0'))
{
- if ((number < NOTIFY_LEVEL_MIN) || (number > NOTIFY_LEVEL_MAX))
+ if ((number < GUI_NOTIFY_LEVEL_MIN) || (number > GUI_NOTIFY_LEVEL_MAX))
{
/* invalid highlight level */
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
- WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
+ WEECHAT_ERROR, GUI_NOTIFY_LEVEL_MIN, GUI_NOTIFY_LEVEL_MAX);
free_exploded_string (argv);
return -1;
}
- if (!SERVER(buffer)
- || ((!BUFFER_IS_SERVER(buffer))
- && (!BUFFER_IS_CHANNEL(buffer))
- && (!BUFFER_IS_PRIVATE(buffer))))
+ if (!GUI_SERVER(buffer)
+ || ((!GUI_BUFFER_IS_SERVER(buffer))
+ && (!GUI_BUFFER_IS_CHANNEL(buffer))
+ && (!GUI_BUFFER_IS_PRIVATE(buffer))))
{
/* invalid buffer type (only ok on server, channel or private) */
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s incorrect buffer for notify "
"(must be server, channel or private)\n"),
@@ -1363,32 +1364,32 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
free_exploded_string (argv);
return -1;
}
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- irc_server_set_default_notify_level (SERVER(buffer),
+ irc_server_set_default_notify_level (GUI_SERVER(buffer),
number);
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("New default notify level for server %s%s%s: %s%d %s"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
- SERVER(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
+ GUI_SERVER(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
number,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
else
{
- irc_channel_set_notify_level (SERVER(buffer),
- CHANNEL(buffer),
+ irc_channel_set_notify_level (GUI_SERVER(buffer),
+ GUI_CHANNEL(buffer),
number);
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("New notify level for %s%s%s: %s%d %s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- CHANNEL(buffer)->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_CHANNEL(buffer)->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
number,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
switch (number)
{
@@ -1413,9 +1414,9 @@ weechat_cmd_buffer (t_irc_server *server, t_irc_channel *channel,
else
{
/* invalid number */
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect notify level (must be between %d and %d)\n"),
- WEECHAT_ERROR, NOTIFY_LEVEL_MIN, NOTIFY_LEVEL_MAX);
+ WEECHAT_ERROR, GUI_NOTIFY_LEVEL_MIN, GUI_NOTIFY_LEVEL_MAX);
free_exploded_string (argv);
return -1;
}
@@ -1551,7 +1552,7 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
buffer = gui_buffer_search_by_number (number);
if (!buffer)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s buffer number \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[i], "clear");
@@ -1561,7 +1562,7 @@ weechat_cmd_clear (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "clear");
@@ -1590,7 +1591,7 @@ weechat_cmd_connect_one_server (t_gui_window *window, t_irc_server *server,
{
if (server->is_connected)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s already connected to server \"%s\"!\n"),
WEECHAT_ERROR, server->name);
@@ -1598,7 +1599,7 @@ weechat_cmd_connect_one_server (t_gui_window *window, t_irc_server *server,
}
if (server->child_pid > 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s currently connecting to server \"%s\"!\n"),
WEECHAT_ERROR, server->name);
@@ -1607,7 +1608,7 @@ weechat_cmd_connect_one_server (t_gui_window *window, t_irc_server *server,
if (!server->buffer)
{
if (!gui_buffer_new (window, server, NULL,
- BUFFER_TYPE_STANDARD, 1))
+ GUI_BUFFER_TYPE_STANDARD, 1))
return 0;
}
if (irc_server_connect (server, no_join))
@@ -1660,7 +1661,7 @@ weechat_cmd_connect (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-port");
@@ -1732,17 +1733,17 @@ weechat_cmd_connect (t_irc_server *server, t_irc_channel *channel,
NULL);
if (ptr_server)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s created (temporary server, NOT SAVED!)\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server_tmp.name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (!weechat_cmd_connect_one_server (window, ptr_server, 0))
connect_ok = 0;
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to create server \"%s\"\n"),
WEECHAT_ERROR, argv[i]);
@@ -1785,7 +1786,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel,
pos_nick = strchr (arguments, ' ');
if (!pos_nick)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "dcc send");
@@ -1797,7 +1798,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel,
pos_file = strchr (pos_nick, ' ');
if (!pos_file)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "dcc send");
@@ -1808,7 +1809,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel,
while (pos_file[0] == ' ')
pos_file++;
- irc_dcc_send_request (server, DCC_FILE_SEND, pos_nick, pos_file);
+ irc_dcc_send_request (server, IRC_DCC_FILE_SEND, pos_nick, pos_file);
}
/* DCC CHAT */
else if (strncasecmp (arguments, "chat", 4) == 0)
@@ -1816,7 +1817,7 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel,
pos_nick = strchr (arguments, ' ');
if (!pos_nick)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "dcc chat");
@@ -1825,22 +1826,23 @@ weechat_cmd_dcc (t_irc_server *server, t_irc_channel *channel,
while (pos_nick[0] == ' ')
pos_nick++;
- irc_dcc_send_request (server, DCC_CHAT_SEND, pos_nick, NULL);
+ irc_dcc_send_request (server, IRC_DCC_CHAT_SEND, pos_nick, NULL);
}
/* close DCC CHAT */
else if (ascii_strcasecmp (arguments, "close") == 0)
{
- if (BUFFER_IS_PRIVATE(buffer) &&
- CHANNEL(buffer)->dcc_chat)
+ if (GUI_BUFFER_IS_PRIVATE(buffer) &&
+ GUI_CHANNEL(buffer)->dcc_chat)
{
- irc_dcc_close ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat), DCC_ABORTED);
+ irc_dcc_close ((t_irc_dcc *)(GUI_CHANNEL(buffer)->dcc_chat),
+ IRC_DCC_ABORTED);
irc_dcc_redraw (1);
}
}
/* unknown DCC action */
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong arguments for \"%s\" command\n"),
WEECHAT_ERROR, "dcc");
@@ -1905,7 +1907,7 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
if (argc != 1)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "debug");
@@ -1934,7 +1936,7 @@ weechat_cmd_debug (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "debug");
@@ -1955,7 +1957,7 @@ weechat_cmd_disconnect_one_server (t_irc_server *server)
if ((!server->is_connected) && (server->child_pid == 0)
&& (server->reconnect_start == 0))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not connected to server \"%s\"!\n"),
WEECHAT_ERROR, server->name);
@@ -1963,7 +1965,7 @@ weechat_cmd_disconnect_one_server (t_irc_server *server)
}
if (server->reconnect_start > 0)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("Auto-reconnection is cancelled\n"));
}
@@ -2020,7 +2022,7 @@ weechat_cmd_disconnect (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s server \"%s\" not found\n"),
WEECHAT_ERROR, argv[i]);
disconnect_ok = 0;
@@ -2061,9 +2063,9 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
for (i = 0; weechat_commands[i].command_name; i++)
{
gui_printf (NULL, " %s%s %s- %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
weechat_commands[i].command_name,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
_(weechat_commands[i].command_description));
}
gui_printf (NULL, "\n");
@@ -2073,9 +2075,9 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
if (irc_commands[i].cmd_function_args || irc_commands[i].cmd_function_1arg)
{
gui_printf (NULL, " %s%s %s- %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
irc_commands[i].command_name,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
_(irc_commands[i].command_description));
}
}
@@ -2091,12 +2093,12 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
{
gui_printf (NULL, " %s%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_handler->command);
if (ptr_handler->description
&& ptr_handler->description[0])
gui_printf (NULL, " %s- %s",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_handler->description);
gui_printf (NULL, "\n");
}
@@ -2118,12 +2120,12 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
gui_printf (NULL, "\n");
gui_printf (NULL, "[p]");
gui_printf (NULL, " %s/%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_handler->command);
if (ptr_handler->arguments &&
ptr_handler->arguments[0])
gui_printf (NULL, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_handler->arguments);
else
gui_printf (NULL, "\n");
@@ -2147,12 +2149,12 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
gui_printf (NULL, "\n");
gui_printf (NULL, "[w]");
gui_printf (NULL, " %s/%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
weechat_commands[i].command_name);
if (weechat_commands[i].arguments &&
weechat_commands[i].arguments[0])
gui_printf (NULL, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
_(weechat_commands[i].arguments));
else
gui_printf (NULL, "\n");
@@ -2175,12 +2177,12 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
gui_printf (NULL, "\n");
gui_printf (NULL, "[i]");
gui_printf (NULL, " %s/%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
irc_commands[i].command_name);
if (irc_commands[i].arguments &&
irc_commands[i].arguments[0])
gui_printf (NULL, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
_(irc_commands[i].arguments));
else
gui_printf (NULL, "\n");
@@ -2195,7 +2197,7 @@ weechat_cmd_help (t_irc_server *server, t_irc_channel *channel,
return 0;
}
}
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("No help available, \"%s\" is an unknown command\n"),
argv[0]);
@@ -2246,7 +2248,7 @@ weechat_cmd_history (t_irc_server *server, t_irc_channel *channel,
{
if ((n_user > 0) && ((n_total - n_user) > n))
continue;
- irc_display_prefix (NULL, buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, buffer, GUI_PREFIX_INFO);
gui_printf_nolog (buffer, "%s\n", ptr_history->text);
}
}
@@ -2263,22 +2265,22 @@ weechat_cmd_ignore_display (char *text, t_irc_ignore *ptr_ignore)
{
if (text)
gui_printf (NULL, "%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
text);
gui_printf (NULL, _("%son %s%s%s/%s%s%s:%s ignoring %s%s%s from %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_ignore->server_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_ignore->channel_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_ignore->type,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
ptr_ignore->mask);
}
@@ -2311,34 +2313,34 @@ weechat_cmd_ignore (t_irc_server *server, t_irc_channel *channel,
{
i++;
gui_printf (NULL, "%s[%s%d%s] ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
i,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
weechat_cmd_ignore_display (NULL, ptr_ignore);
}
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No ignore defined.\n"));
}
return 0;
break;
case 1:
ptr_ignore = irc_ignore_add (argv[0], "*", "*",
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 2:
ptr_ignore = irc_ignore_add (argv[0], argv[1], "*",
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 3:
ptr_ignore = irc_ignore_add (argv[0], argv[1], argv[2],
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 4:
ptr_ignore = irc_ignore_add (argv[0], argv[1], argv[2], argv[3]);
@@ -2366,15 +2368,15 @@ weechat_cmd_key_display (t_gui_key *key, int new_key)
expanded_name = gui_keyboard_get_expanded_name (key->key);
if (new_key)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("New key binding: %s"),
(expanded_name) ? expanded_name : key->key);
}
else
gui_printf (NULL, " %20s", (expanded_name) ? expanded_name : key->key);
gui_printf (NULL, "%s => %s%s%s%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(key->function) ?
gui_keyboard_function_search_by_ptr (key->function) : key->command,
(key->args) ? " \"" : "",
@@ -2423,12 +2425,12 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
arguments++;
if (gui_keyboard_unbind (arguments))
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Key \"%s\" unbound\n"), arguments);
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to unbind key \"%s\"\n"),
WEECHAT_ERROR, arguments);
@@ -2485,7 +2487,7 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown key function \"%s\"\n"),
WEECHAT_ERROR, arguments);
@@ -2501,12 +2503,12 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
{
gui_keyboard_free_all ();
gui_keyboard_init ();
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Default key bindings restored\n"));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s \"-yes\" argument is required for keys reset (security reason)\n"),
WEECHAT_ERROR);
@@ -2532,7 +2534,7 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No key found.\n"));
}
if (internal_code)
@@ -2548,7 +2550,7 @@ weechat_cmd_key (t_irc_server *server, t_irc_channel *channel,
weechat_cmd_key_display (ptr_key, 1);
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to bind key \"%s\"\n"),
WEECHAT_ERROR, arguments);
@@ -2567,17 +2569,17 @@ void
weechat_cmd_panel_display_info (t_gui_panel *panel)
{
gui_printf (NULL, " %s%2d%s. ",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
panel->number,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
gui_printf (NULL, "%s%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
panel->name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
gui_printf (NULL, "(%s%s/%s",
(panel->panel_window) ? _("global") : _("local"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
switch (panel->position)
{
case GUI_PANEL_TOP:
@@ -2594,8 +2596,8 @@ weechat_cmd_panel_display_info (t_gui_panel *panel)
break;
}
gui_printf (NULL, "%s/%s%d)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
panel->size);
}
@@ -2651,7 +2653,7 @@ weechat_cmd_plugin_list (char *name, int full)
gui_printf (NULL, "\n");
if (!name)
{
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _("Plugins loaded:\n"));
}
@@ -2665,11 +2667,11 @@ weechat_cmd_plugin_list (char *name, int full)
plugins_found++;
/* plugin info */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, " %s%s%s v%s - %s (%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_plugin->name,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_plugin->version,
ptr_plugin->description,
ptr_plugin->filename);
@@ -2677,7 +2679,7 @@ weechat_cmd_plugin_list (char *name, int full)
if (full)
{
/* message handlers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" message handlers:\n"));
handler_found = 0;
for (ptr_handler = ptr_plugin->handlers;
@@ -2686,19 +2688,19 @@ weechat_cmd_plugin_list (char *name, int full)
if (ptr_handler->type == PLUGIN_HANDLER_MESSAGE)
{
handler_found = 1;
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" IRC(%s)\n"),
ptr_handler->irc_command);
}
}
if (!handler_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" (no message handler)\n"));
}
/* command handlers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" command handlers:\n"));
handler_found = 0;
for (ptr_handler = ptr_plugin->handlers;
@@ -2707,7 +2709,7 @@ weechat_cmd_plugin_list (char *name, int full)
if (ptr_handler->type == PLUGIN_HANDLER_COMMAND)
{
handler_found = 1;
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, " /%s",
ptr_handler->command);
if (ptr_handler->description
@@ -2719,12 +2721,12 @@ weechat_cmd_plugin_list (char *name, int full)
}
if (!handler_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" (no command handler)\n"));
}
/* timer handlers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" timer handlers:\n"));
handler_found = 0;
for (ptr_handler = ptr_plugin->handlers;
@@ -2733,19 +2735,19 @@ weechat_cmd_plugin_list (char *name, int full)
if (ptr_handler->type == PLUGIN_HANDLER_TIMER)
{
handler_found = 1;
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" %d seconds\n"),
ptr_handler->interval);
}
}
if (!handler_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" (no timer handler)\n"));
}
/* keyboard handlers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" keyboard handlers:\n"));
handler_found = 0;
for (ptr_handler = ptr_plugin->handlers;
@@ -2754,7 +2756,7 @@ weechat_cmd_plugin_list (char *name, int full)
if (ptr_handler->type == PLUGIN_HANDLER_KEYBOARD)
handler_found++;
}
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
if (!handler_found)
gui_printf (NULL, _(" (no keyboard handler)\n"));
else
@@ -2762,7 +2764,7 @@ weechat_cmd_plugin_list (char *name, int full)
handler_found);
/* event handlers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" event handlers:\n"));
handler_found = 0;
for (ptr_handler = ptr_plugin->handlers;
@@ -2771,7 +2773,7 @@ weechat_cmd_plugin_list (char *name, int full)
if (ptr_handler->type == PLUGIN_HANDLER_EVENT)
handler_found++;
}
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
if (!handler_found)
gui_printf (NULL, _(" (no event handler)\n"));
else
@@ -2779,7 +2781,7 @@ weechat_cmd_plugin_list (char *name, int full)
handler_found);
/* modifiers */
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _(" modifiers:\n"));
modifier_found = 0;
for (ptr_modifier = ptr_plugin->modifiers;
@@ -2787,7 +2789,7 @@ weechat_cmd_plugin_list (char *name, int full)
{
modifier_found++;
}
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
if (!modifier_found)
gui_printf (NULL, _(" (no modifier)\n"));
else
@@ -2798,7 +2800,7 @@ weechat_cmd_plugin_list (char *name, int full)
}
if (plugins_found == 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
if (name)
gui_printf (NULL, _("No plugin found.\n"));
else
@@ -2857,20 +2859,20 @@ weechat_cmd_plugin (t_irc_server *server, t_irc_channel *channel,
plugin_unload_name (argv[1]);
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "plugin");
}
break;
default:
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "plugin");
}
#else
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("Command \"%s\" is not available, WeeChat was built "
"without plugins support.\n"),
@@ -2895,7 +2897,7 @@ weechat_cmd_reconnect_one_server (t_irc_server *server, int no_join)
{
if ((!server->is_connected) && (server->child_pid == 0))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not connected to server \"%s\"!\n"),
WEECHAT_ERROR, server->name);
@@ -2969,7 +2971,7 @@ weechat_cmd_reconnect (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s server \"%s\" not found\n"),
WEECHAT_ERROR, argv[i]);
reconnect_ok = 0;
@@ -3001,12 +3003,12 @@ weechat_cmd_save (t_irc_server *server, t_irc_channel *channel,
if (config_write ((argc == 1) ? argv[0] : NULL) == 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf_nolog (NULL, _("Configuration file saved\n"));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL, _("%s failed to save configuration file\n"),
WEECHAT_ERROR);
}
@@ -3014,12 +3016,12 @@ weechat_cmd_save (t_irc_server *server, t_irc_channel *channel,
#ifdef PLUGINS
if (plugin_config_write () == 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf_nolog (NULL, _("Plugins options saved\n"));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL, _("%s failed to save plugins options\n"),
WEECHAT_ERROR);
}
@@ -3079,7 +3081,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No server.\n"));
}
}
@@ -3103,7 +3105,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
}
if (!one_server_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("No server with '%s' found.\n"),
server_name);
}
@@ -3115,7 +3117,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (argc < 3)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing parameters for \"%s\" command\n"),
WEECHAT_ERROR, "server");
@@ -3124,7 +3126,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
if (irc_server_name_already_exists (argv[1]))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" already exists, can't create it!\n"),
WEECHAT_ERROR, argv[1]);
@@ -3157,7 +3159,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-port");
@@ -3173,7 +3175,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-pwd");
@@ -3186,7 +3188,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i >= (argc - 3))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-nicks");
@@ -3201,7 +3203,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-username");
@@ -3214,7 +3216,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-realname");
@@ -3227,7 +3229,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-command");
@@ -3240,7 +3242,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (i == (argc - 1))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing argument for \"%s\" option\n"),
WEECHAT_ERROR, "-autojoin");
@@ -3276,15 +3278,15 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
NULL);
if (new_server)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s created\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server_tmp.name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to create server\n"),
WEECHAT_ERROR);
@@ -3295,7 +3297,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
if (new_server->autoconnect)
{
(void) gui_buffer_new (window, new_server, NULL,
- BUFFER_TYPE_STANDARD, 1);
+ GUI_BUFFER_TYPE_STANDARD, 1);
irc_server_connect (new_server, 0);
}
@@ -3305,7 +3307,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (argc < 3)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing server name for \"%s\" command\n"),
WEECHAT_ERROR, "server copy");
@@ -3316,7 +3318,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
server_found = irc_server_search (argv[1]);
if (!server_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[1], "server copy");
@@ -3326,7 +3328,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
/* check if target name already exists */
if (irc_server_search (argv[2]))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" already exists for \"%s\" command\n"),
WEECHAT_ERROR, argv[2], "server copy");
@@ -3337,12 +3339,12 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
new_server = irc_server_duplicate (server_found, argv[2]);
if (new_server)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s has been copied to %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
argv[1],
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
argv[2]);
gui_window_redraw_all_buffers ();
return 0;
@@ -3354,7 +3356,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (argc < 3)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing server name for \"%s\" command\n"),
WEECHAT_ERROR, "server rename");
@@ -3365,7 +3367,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
server_found = irc_server_search (argv[1]);
if (!server_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[1], "server rename");
@@ -3375,7 +3377,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
/* check if target name already exists */
if (irc_server_search (argv[2]))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" already exists for \"%s\" command\n"),
WEECHAT_ERROR, argv[2], "server rename");
@@ -3385,12 +3387,12 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
/* rename server */
if (irc_server_rename (server_found, argv[2]))
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s has been renamed to %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
argv[1],
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
argv[2]);
gui_window_redraw_all_buffers ();
return 0;
@@ -3402,7 +3404,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (argc < 2)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing server name for \"%s\" command\n"),
WEECHAT_ERROR, "server keep");
@@ -3413,7 +3415,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
server_found = irc_server_search (argv[1]);
if (!server_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[1], "server keep");
@@ -3423,7 +3425,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
/* check that it is temporary server */
if (!server_found->temp_server)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" is not a temporary server\n"),
WEECHAT_ERROR, argv[1]);
@@ -3433,11 +3435,11 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
/* remove temporary flag on server */
server_found->temp_server = 0;
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s is not temporary any more\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
argv[1],
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
return 0;
}
@@ -3445,7 +3447,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
{
if (argc < 2)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s missing server name for \"%s\" command\n"),
WEECHAT_ERROR, "server del");
@@ -3456,7 +3458,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
server_found = irc_server_search (argv[1]);
if (!server_found)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, argv[1], "server del");
@@ -3464,7 +3466,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
}
if (server_found->is_connected)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s you can not delete server \"%s\" because you are connected to. "
"Try /disconnect %s before.\n"),
@@ -3474,7 +3476,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
- if (SERVER(ptr_buffer) == server_found)
+ if (GUI_SERVER(ptr_buffer) == server_found)
{
ptr_buffer->server = NULL;
ptr_buffer->channel = NULL;
@@ -3485,11 +3487,11 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
irc_server_free (server_found);
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s has been deleted\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server_name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (server_name)
free (server_name);
@@ -3499,7 +3501,7 @@ weechat_cmd_server (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "server");
@@ -3522,7 +3524,7 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val
(prefix) ? prefix : "",
(prefix) ? "." : "",
option->option_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
if (!value)
{
if (option->option_type == OPTION_TYPE_STRING)
@@ -3534,23 +3536,23 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val
{
case OPTION_TYPE_BOOLEAN:
gui_printf (NULL, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
(*((int *)value)) ? "ON" : "OFF");
break;
case OPTION_TYPE_INT:
gui_printf (NULL, "%s%d\n",
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
*((int *)value));
break;
case OPTION_TYPE_INT_WITH_STRING:
gui_printf (NULL, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
option->array_values[*((int *)value)]);
break;
case OPTION_TYPE_COLOR:
color_name = gui_color_get_name (*((int *)value));
gui_printf (NULL, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
(color_name) ? color_name : _("(unknown)"));
break;
case OPTION_TYPE_STRING:
@@ -3564,19 +3566,19 @@ weechat_cmd_set_display_option (t_config_option *option, char *prefix, void *val
irc_display_hide_password (value2, 1);
if (strcmp (*((char **)value), value2) != 0)
gui_printf (NULL, _("%s(password hidden) "),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
gui_printf (NULL, "%s\"%s%s%s\"",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
value2,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
free (value2);
}
}
else
gui_printf (NULL, "%s\"\"",
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
gui_printf (NULL, "\n");
break;
}
@@ -3660,7 +3662,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
ptr_server = irc_server_search (option);
if (!ptr_server)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server \"%s\" not found\n"),
WEECHAT_ERROR, option);
@@ -3672,12 +3674,12 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
case 0:
gui_printf (NULL, "\n");
gui_printf (NULL, "%s[%s%s %s%s%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
config_sections[CONFIG_SECTION_SERVER].section_name,
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
ptr_server->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
for (i = 0; weechat_options[CONFIG_SECTION_SERVER][i].option_name; i++)
{
if (strcmp (weechat_options[CONFIG_SECTION_SERVER][i].option_name, pos + 1) == 0)
@@ -3694,12 +3696,12 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
config_change_buffer_content ();
break;
case -1:
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
WEECHAT_ERROR, pos + 1);
break;
case -2:
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
WEECHAT_ERROR, pos + 1);
break;
@@ -3714,7 +3716,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
if (ptr_option->handler_change == NULL)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s option \"%s\" can not be changed while WeeChat is running\n"),
WEECHAT_ERROR, option);
@@ -3725,16 +3727,16 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, "%s[%s%s%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
config_get_section (ptr_option),
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
weechat_cmd_set_display_option (ptr_option, NULL, NULL);
(void) (ptr_option->handler_change());
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect value for option \"%s\"\n"),
WEECHAT_ERROR, option);
}
@@ -3742,7 +3744,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s config option \"%s\" not found\n"),
WEECHAT_ERROR, option);
}
@@ -3770,10 +3772,10 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, "%s[%s%s%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
config_sections[i].section_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
section_displayed = 1;
}
weechat_cmd_set_display_option (&weechat_options[i][j], NULL, NULL);
@@ -3801,12 +3803,12 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, "%s[%s%s %s%s%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
config_sections[CONFIG_SECTION_SERVER].section_name,
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
ptr_server->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
section_displayed = 1;
}
ptr_option_value = config_get_server_option_ptr (ptr_server,
@@ -3837,7 +3839,7 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("%sDetail:\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL));
switch (weechat_options[last_section][last_option].option_type)
{
case OPTION_TYPE_BOOLEAN:
@@ -3889,9 +3891,9 @@ weechat_cmd_set (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, "%s%d %s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
number_found,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (option)
gui_printf (NULL, _("config option(s) found with \"%s\"\n"),
option);
@@ -3981,7 +3983,7 @@ weechat_cmd_setp (t_irc_server *server, t_irc_channel *channel,
pos[0] = '\0';
if (!pos || !pos[1] || (!plugin_search (option)))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s plugin \"%s\" not found\n"),
WEECHAT_ERROR, option);
}
@@ -3996,14 +3998,14 @@ weechat_cmd_setp (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n %s%s = \"%s%s%s\"\n",
ptr_name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
value,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s incorrect value for plugin option \"%s\"\n"),
WEECHAT_ERROR, ptr_name);
}
@@ -4023,10 +4025,10 @@ weechat_cmd_setp (t_irc_server *server, t_irc_channel *channel,
gui_printf (NULL, "\n");
gui_printf (NULL, " %s%s = \"%s%s%s\"\n",
ptr_option->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
ptr_option->value,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
number_found++;
}
}
@@ -4042,9 +4044,9 @@ weechat_cmd_setp (t_irc_server *server, t_irc_channel *channel,
{
gui_printf (NULL, "\n");
gui_printf (NULL, "%s%d %s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
number_found,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (option)
gui_printf (NULL, _("plugin option(s) found with \"%s\"\n"),
option);
@@ -4058,7 +4060,7 @@ weechat_cmd_setp (t_irc_server *server, t_irc_channel *channel,
(void) channel;
(void) arguments;
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("Command \"%s\" is not available, WeeChat was built "
"without plugins support.\n"),
@@ -4089,7 +4091,7 @@ weechat_cmd_unalias (t_irc_server *server, t_irc_channel *channel,
ptr_weelist = weelist_search (index_commands, arguments);
if (!ptr_weelist)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s alias or command \"%s\" not found\n"),
WEECHAT_ERROR, arguments);
return -1;
@@ -4099,7 +4101,7 @@ weechat_cmd_unalias (t_irc_server *server, t_irc_channel *channel,
ptr_alias = alias_search (arguments);
if (ptr_alias)
alias_free (ptr_alias);
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL, _("Alias \"%s\" removed\n"),
arguments);
return 0;
@@ -4134,18 +4136,18 @@ weechat_cmd_unignore (t_irc_server *server, t_irc_channel *channel,
ret = irc_ignore_search_free_by_number (number);
else
ret = irc_ignore_search_free (argv[0], "*", "*",
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 2:
ret = irc_ignore_search_free (argv[0], argv[1], "*",
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 3:
ret = irc_ignore_search_free (argv[0], argv[1], argv[2],
- (SERVER(buffer)) ?
- SERVER(buffer)->name : "*");
+ (GUI_SERVER(buffer)) ?
+ GUI_SERVER(buffer)->name : "*");
break;
case 4:
ret = irc_ignore_search_free (argv[0], argv[1], argv[2], argv[3]);
@@ -4154,18 +4156,18 @@ weechat_cmd_unignore (t_irc_server *server, t_irc_channel *channel,
if (ret)
{
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf (NULL,
NG_("%s%d%s ignore was removed.\n",
"%s%d%s ignore were removed.\n",
ret),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ret,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s no ignore found\n"),
WEECHAT_ERROR);
return -1;
@@ -4198,7 +4200,7 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
{
if (ptr_server->child_pid != 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s can't upgrade: connection to at least "
"one server is pending\n"),
@@ -4208,7 +4210,7 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
/* TODO: remove this test, and fix gnutls save/load in session */
if (ptr_server->is_connected && ptr_server->ssl_connected)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s can't upgrade: connection to at least "
"one SSL server is active "
@@ -4218,7 +4220,7 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
}
if (ptr_server->outqueue)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s can't upgrade: anti-flood is active on "
"at least one server (sending many lines)\n"),
@@ -4234,13 +4236,13 @@ weechat_cmd_upgrade (t_irc_server *server, t_irc_channel *channel,
snprintf (filename, filename_length, "%s%s" WEECHAT_SESSION_NAME,
weechat_home, DIR_SEPARATOR);
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
gui_printf_nolog (NULL, _("Upgrading WeeChat...\n"));
if (!session_save (filename))
{
free (filename);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s unable to save session in file\n"),
WEECHAT_ERROR);
@@ -4305,8 +4307,8 @@ weechat_cmd_uptime (t_irc_server *server, t_irc_channel *channel,
sec = ((running_time % (60 * 60 * 24)) % (60 * 60)) % 60;
if ((argc == 1) && (strcmp (argv[0], "-o") == 0)
- && ((BUFFER_IS_CHANNEL(buffer))
- || (BUFFER_IS_PRIVATE(buffer))))
+ && ((GUI_BUFFER_IS_CHANNEL(buffer))
+ || (GUI_BUFFER_IS_PRIVATE(buffer))))
{
snprintf (string, sizeof (string),
_("WeeChat uptime: %d %s %02d:%02d:%02d, started on %s"),
@@ -4321,25 +4323,25 @@ weechat_cmd_uptime (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, buffer, GUI_PREFIX_INFO);
gui_printf_nolog (buffer,
_("WeeChat uptime: %s%d %s%s "
"%s%02d%s:%s%02d%s:%s%02d%s, "
"started on %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
day,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
NG_("day", "days", day),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
hour,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
min,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
sec,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ctime (&weechat_start_time));
}
@@ -4373,18 +4375,18 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel,
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_printf (NULL, "%s[%s%d%s] (%s%d:%d%s;%s%dx%d%s) ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
i,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_win->win_x,
ptr_win->win_y,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_win->win_width,
ptr_win->win_height,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
weechat_cmd_buffer_display_info (ptr_win->buffer);
@@ -4441,7 +4443,7 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel,
gui_window_merge_all (window);
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "window merge");
@@ -4452,7 +4454,7 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel,
{
if (!gui_window_merge (window))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s can not merge windows, "
"there's no other window with same size "
@@ -4484,7 +4486,7 @@ weechat_cmd_window (t_irc_server *server, t_irc_channel *channel,
gui_window_switch_right (window);
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unknown option for \"%s\" command\n"),
WEECHAT_ERROR, "window");
diff --git a/src/common/completion.c b/src/common/completion.c
index 0b4bb5dfe..64bb2e744 100644
--- a/src/common/completion.c
+++ b/src/common/completion.c
@@ -571,7 +571,7 @@ completion_list_add_server_nicks (t_completion *completion)
ptr_channel = ptr_channel->next_channel)
{
if ((!completion->channel || (t_irc_channel *)(completion->channel) != ptr_channel)
- && (ptr_channel->type == CHANNEL_TYPE_CHANNEL))
+ && (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL))
{
for (ptr_nick = ptr_channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
@@ -584,7 +584,7 @@ completion_list_add_server_nicks (t_completion *completion)
}
/* add current channel nicks at beginning */
- if (completion->channel && (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL))
+ if (completion->channel && (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_CHANNEL))
{
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
@@ -616,7 +616,7 @@ completion_list_add_channel_nicks (t_completion *completion)
if (completion->channel)
{
- if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)
+ if (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_CHANNEL)
{
/* add channel nicks */
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
@@ -645,8 +645,8 @@ completion_list_add_channel_nicks (t_completion *completion)
((t_irc_server *)(completion->server))->nick,
1, WEELIST_POS_END);
}
- if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
- || (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
+ if ((((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_DCC_CHAT))
{
completion_list_add (completion,
((t_irc_channel *)(completion->channel))->name,
@@ -669,7 +669,7 @@ completion_list_add_channel_nicks_hosts (t_completion *completion)
if (completion->channel)
{
- if (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_CHANNEL)
+ if (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_CHANNEL)
{
for (ptr_nick = ((t_irc_channel *)(completion->channel))->nicks;
ptr_nick; ptr_nick = ptr_nick->next_nick)
@@ -692,8 +692,8 @@ completion_list_add_channel_nicks_hosts (t_completion *completion)
}
}
}
- if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
- || (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE))
+ if ((((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_PRIVATE))
{
completion_list_add (completion,
((t_irc_channel *)(completion->channel))->name,
@@ -1449,8 +1449,8 @@ completion_nick (t_completion *completion)
completion->context = COMPLETION_NICK;
- if ((((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_PRIVATE)
- || (((t_irc_channel *)(completion->channel))->type == CHANNEL_TYPE_DCC_CHAT))
+ if ((((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (((t_irc_channel *)(completion->channel))->type == IRC_CHANNEL_TYPE_DCC_CHAT))
{
if (!(completion->completion_list))
{
diff --git a/src/common/fifo.c b/src/common/fifo.c
index 9bf69c688..9a6f50e77 100644
--- a/src/common/fifo.c
+++ b/src/common/fifo.c
@@ -113,12 +113,12 @@ fifo_exec (char *text)
pos_msg = text + 1;
if (gui_current_window->buffer->has_input)
{
- ptr_server = SERVER(gui_current_window->buffer);
- ptr_channel = CHANNEL(gui_current_window->buffer);
+ ptr_server = GUI_SERVER(gui_current_window->buffer);
+ ptr_channel = GUI_CHANNEL(gui_current_window->buffer);
}
else
{
- ptr_server = SERVER(gui_buffers);
+ ptr_server = GUI_SERVER(gui_buffers);
ptr_channel = NULL;
}
}
@@ -127,7 +127,7 @@ fifo_exec (char *text)
pos_msg = strstr (text, " *");
if (!pos_msg)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s invalid text received on FIFO pipe\n"),
WEECHAT_WARNING);
return;
@@ -149,7 +149,7 @@ fifo_exec (char *text)
ptr_server = irc_server_search (text);
if (!ptr_server || !ptr_server->buffer)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s server \"%s\" not found (FIFO pipe data)\n"),
WEECHAT_WARNING, text);
return;
@@ -159,7 +159,7 @@ fifo_exec (char *text)
ptr_channel = irc_channel_search_any (ptr_server, pos + 1);
if (!ptr_channel)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s channel \"%s\" not found (FIFO pipe data)\n"),
WEECHAT_WARNING, pos + 1);
diff --git a/src/common/session.c b/src/common/session.c
index ae647509f..d111b0618 100644
--- a/src/common/session.c
+++ b/src/common/session.c
@@ -294,7 +294,7 @@ session_save_dcc (FILE *file)
rc = 1;
- for (ptr_dcc = last_dcc; ptr_dcc;
+ for (ptr_dcc = irc_last_dcc; ptr_dcc;
ptr_dcc = ptr_dcc->prev_dcc)
{
rc = rc && (session_write_id (file, SESSION_OBJ_DCC));
@@ -398,8 +398,8 @@ session_save_buffers (FILE *file)
ptr_buffer = ptr_buffer->next_buffer)
{
rc = rc && (session_write_id (file, SESSION_OBJ_BUFFER));
- rc = rc && (session_write_str (file, SESSION_BUFF_SERVER, SERVER(ptr_buffer) ? SERVER(ptr_buffer)->name : NULL));
- rc = rc && (session_write_str (file, SESSION_BUFF_CHANNEL, CHANNEL(ptr_buffer) ? CHANNEL(ptr_buffer)->name : NULL));
+ rc = rc && (session_write_str (file, SESSION_BUFF_SERVER, GUI_SERVER(ptr_buffer) ? GUI_SERVER(ptr_buffer)->name : NULL));
+ rc = rc && (session_write_str (file, SESSION_BUFF_CHANNEL, GUI_CHANNEL(ptr_buffer) ? GUI_CHANNEL(ptr_buffer)->name : NULL));
rc = rc && (session_write_int (file, SESSION_BUFF_TYPE, ptr_buffer->type));
rc = rc && (session_write_int (file, SESSION_BUFF_ALL_SERVERS, ptr_buffer->all_servers));
rc = rc && (session_write_id (file, SESSION_BUFF_END));
@@ -1849,13 +1849,13 @@ session_load (char *filename)
if (unlink (filename) < 0)
{
- irc_display_prefix (NULL, gui_current_window->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, gui_current_window->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (gui_current_window->buffer,
_("%s can't delete session file (%s)\n"),
WEECHAT_ERROR, filename);
}
- irc_display_prefix (NULL, gui_current_window->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, gui_current_window->buffer, GUI_PREFIX_INFO);
gui_printf_nolog (gui_current_window->buffer,
_("Upgrade completed successfully\n"));
diff --git a/src/common/weechat.c b/src/common/weechat.c
index b654bb59a..54b65c89a 100644
--- a/src/common/weechat.c
+++ b/src/common/weechat.c
@@ -554,10 +554,6 @@ weechat_init_vars ()
/* start time, used by /uptime command */
weechat_start_time = time (NULL);
- /* init received messages queue */
- recv_msgq = NULL;
- msgq_last_msg = NULL;
-
/* init gnutls */
#ifdef HAVE_GNUTLS
gnutls_global_init ();
@@ -604,17 +600,17 @@ weechat_welcome_message ()
"%s __ | /| / /_ _ \\ _ \\ / __ __ \\ __ `/ __/\n"
"%s __ |/ |/ / / __/ __/ /___ _ / / / /_/ // /_ \n"
"%s ____/|__/ \\___/\\___/\\____/ /_/ /_/\\__,_/ \\__/ \n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK));
}
if (cfg_look_weechat_slogan && cfg_look_weechat_slogan[0])
{
gui_printf (NULL, _("%sWelcome to %s%s%s, %s\n"),
(cfg_look_startup_logo) ? " " : "",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
PACKAGE_NAME,
GUI_NO_COLOR,
cfg_look_weechat_slogan);
@@ -623,7 +619,7 @@ weechat_welcome_message ()
{
gui_printf (NULL, "%s%s%s%s, %s %s %s\n",
(cfg_look_startup_logo) ? " " : "",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
PACKAGE_STRING,
GUI_NO_COLOR,
_("compiled on"), __DATE__, __TIME__);
@@ -633,7 +629,7 @@ weechat_welcome_message ()
cfg_look_startup_version)
gui_printf (NULL,
"%s-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK));
weechat_log_printf ("%s (%s %s %s)\n",
PACKAGE_STRING, _("compiled on"), __DATE__, __TIME__);
diff --git a/src/common/weeconfig.c b/src/common/weeconfig.c
index abcace3c4..56118f6b8 100644
--- a/src/common/weeconfig.c
+++ b/src/common/weeconfig.c
@@ -345,7 +345,7 @@ int cfg_col_nick_user;
int cfg_col_nick_more;
int cfg_col_nick_sep;
int cfg_col_nick_self;
-int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
+int cfg_col_nick_colors[GUI_COLOR_WIN_NICK_NUMBER];
int cfg_col_nick_private;
int cfg_col_nick_bg;
int cfg_col_nicklist_bg;
@@ -851,7 +851,7 @@ t_config_option weechat_options_dcc[] =
NULL, NULL, &cfg_dcc_timeout, NULL, &config_change_noop },
{ "dcc_blocksize", N_("block size for dcc packets"),
N_("block size for dcc packets in bytes (default: 65536)"),
- OPTION_TYPE_INT, DCC_MIN_BLOCKSIZE, DCC_MAX_BLOCKSIZE, 65536,
+ OPTION_TYPE_INT, IRC_DCC_MIN_BLOCKSIZE, IRC_DCC_MAX_BLOCKSIZE, 65536,
NULL, NULL, &cfg_dcc_blocksize, NULL, &config_change_noop },
{ "dcc_fast_send", N_("does not wait for ACK when sending file"),
N_("does not wait for ACK when sending file"),
@@ -1244,7 +1244,7 @@ config_change_nicks_colors ()
for (ptr_nick = ptr_channel->nicks; ptr_nick;
ptr_nick = ptr_nick->next_nick)
{
- if (ptr_nick->color != COLOR_WIN_NICK_SELF)
+ if (ptr_nick->color != GUI_COLOR_WIN_NICK_SELF)
ptr_nick->color = irc_nick_find_color (ptr_nick);
}
}
@@ -1264,7 +1264,7 @@ config_change_away_check ()
/* reset away flag for all nicks/chans/servers */
irc_server_remove_away ();
}
- check_away = cfg_irc_away_check * 60;
+ irc_check_away = cfg_irc_away_check * 60;
}
/*
@@ -1297,9 +1297,9 @@ config_change_notify_levels ()
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
- if (BUFFER_IS_CHANNEL(ptr_buffer) || BUFFER_IS_PRIVATE(ptr_buffer))
+ if (GUI_BUFFER_IS_CHANNEL(ptr_buffer) || GUI_BUFFER_IS_PRIVATE(ptr_buffer))
ptr_buffer->notify_level =
- irc_channel_get_notify_level (SERVER(ptr_buffer), CHANNEL(ptr_buffer));
+ irc_channel_get_notify_level (GUI_SERVER(ptr_buffer), GUI_CHANNEL(ptr_buffer));
}
}
@@ -1315,21 +1315,21 @@ config_change_log ()
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
- if (BUFFER_IS_SERVER(ptr_buffer))
+ if (GUI_BUFFER_IS_SERVER(ptr_buffer))
{
if (cfg_log_auto_server && !ptr_buffer->log_file)
gui_log_start (ptr_buffer);
else if (!cfg_log_auto_server && ptr_buffer->log_file)
gui_log_end (ptr_buffer);
}
- if (BUFFER_IS_CHANNEL(ptr_buffer))
+ if (GUI_BUFFER_IS_CHANNEL(ptr_buffer))
{
if (cfg_log_auto_channel && !ptr_buffer->log_file)
gui_log_start (ptr_buffer);
else if (!cfg_log_auto_channel && ptr_buffer->log_file)
gui_log_end (ptr_buffer);
}
- if (BUFFER_IS_PRIVATE(ptr_buffer))
+ if (GUI_BUFFER_IS_PRIVATE(ptr_buffer))
{
if (cfg_log_auto_private && !ptr_buffer->log_file)
gui_log_start (ptr_buffer);
diff --git a/src/common/weeconfig.h b/src/common/weeconfig.h
index 1affea807..d2b6895cc 100644
--- a/src/common/weeconfig.h
+++ b/src/common/weeconfig.h
@@ -187,7 +187,7 @@ extern int cfg_col_nick_user;
extern int cfg_col_nick_more;
extern int cfg_col_nick_sep;
extern int cfg_col_nick_self;
-extern int cfg_col_nick_colors[COLOR_WIN_NICK_NUMBER];
+extern int cfg_col_nick_colors[GUI_COLOR_WIN_NICK_NUMBER];
extern int cfg_col_nick_private;
extern int cfg_col_nick_bg;
extern int cfg_col_dcc_selected;
diff --git a/src/gui/curses/gui-curses-chat.c b/src/gui/curses/gui-curses-chat.c
index 285fb1762..6f2c56a2f 100644
--- a/src/gui/curses/gui-curses-chat.c
+++ b/src/gui/curses/gui-curses-chat.c
@@ -86,7 +86,7 @@ gui_chat_reset_style (t_gui_window *window)
window->current_style_attr = 0;
window->current_color_attr = 0;
- gui_window_set_weechat_color (GUI_CURSES(window)->win_chat, COLOR_WIN_CHAT);
+ gui_window_set_weechat_color (GUI_CURSES(window)->win_chat, GUI_COLOR_WIN_CHAT);
gui_chat_remove_style (window,
A_BOLD | A_UNDERLINE | A_REVERSE);
}
@@ -177,22 +177,22 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
if (erase)
- gui_window_curses_clear (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
+ gui_window_curses_clear (GUI_CURSES(ptr_win)->win_title, GUI_COLOR_WIN_TITLE);
snprintf (format, 32, "%%-%ds", ptr_win->win_title_width);
wmove (GUI_CURSES(ptr_win)->win_title, 0, 0);
- if (CHANNEL(buffer))
+ if (GUI_CHANNEL(buffer))
{
- if (CHANNEL(buffer)->topic)
+ if (GUI_CHANNEL(buffer)->topic)
{
- buf = (char *)gui_color_decode ((unsigned char *)(CHANNEL(buffer)->topic), 0, 0);
- ptr_topic = utf8_add_offset ((buf) ? buf : CHANNEL(buffer)->topic,
+ buf = (char *)gui_color_decode ((unsigned char *)(GUI_CHANNEL(buffer)->topic), 0, 0);
+ ptr_topic = utf8_add_offset ((buf) ? buf : GUI_CHANNEL(buffer)->topic,
ptr_win->win_title_start);
if (!ptr_topic || !ptr_topic[0])
{
ptr_win->win_title_start = 0;
- ptr_topic = (buf) ? buf : CHANNEL(buffer)->topic;
+ ptr_topic = (buf) ? buf : GUI_CHANNEL(buffer)->topic;
}
buf2 = weechat_iconv_from_internal (NULL,
ptr_topic);
@@ -200,22 +200,22 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
if (ptr_win->win_title_start > 0)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title,
- COLOR_WIN_TITLE_MORE);
+ GUI_COLOR_WIN_TITLE_MORE);
wprintw (GUI_CURSES(ptr_win)->win_title, "%s", "++");
}
if (utf8_width_screen (ptr_topic) > ptr_win->win_width)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, GUI_COLOR_WIN_TITLE);
wprintw (GUI_CURSES(ptr_win)->win_title, "%s", (buf2) ? buf2 : ptr_topic);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title,
- COLOR_WIN_TITLE_MORE);
+ GUI_COLOR_WIN_TITLE_MORE);
mvwprintw (GUI_CURSES(ptr_win)->win_title, 0, ptr_win->win_width - 2,
"%s", "++");
}
else
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, GUI_COLOR_WIN_TITLE);
wprintw (GUI_CURSES(ptr_win)->win_title, "%s", (buf2) ? buf2 : ptr_topic);
}
if (buf)
@@ -225,14 +225,14 @@ gui_chat_draw_title (t_gui_buffer *buffer, int erase)
}
else
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, GUI_COLOR_WIN_TITLE);
wprintw (GUI_CURSES(ptr_win)->win_title, format, " ");
}
}
else
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, COLOR_WIN_TITLE);
- if (buffer->type == BUFFER_TYPE_STANDARD)
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_title, GUI_COLOR_WIN_TITLE);
+ if (buffer->type == GUI_BUFFER_TYPE_STANDARD)
{
wprintw (GUI_CURSES(ptr_win)->win_title,
format,
@@ -815,12 +815,12 @@ gui_chat_display_line (t_gui_window *window, t_gui_line *line, int count,
if (cfg_look_read_marker && cfg_look_read_marker[0])
{
/* display marker if line is matching user search */
- if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
if (gui_buffer_line_search (line, window->buffer->input_buffer,
window->buffer->text_search_exact))
{
- gui_chat_set_weechat_color (window, COLOR_WIN_CHAT_READ_MARKER);
+ gui_chat_set_weechat_color (window, GUI_COLOR_WIN_CHAT_READ_MARKER);
mvwprintw (GUI_CURSES(window)->win_chat, read_marker_y, read_marker_x,
"%c", cfg_look_read_marker[0]);
}
@@ -831,7 +831,7 @@ gui_chat_display_line (t_gui_window *window, t_gui_line *line, int count,
if (window->buffer->last_read_line &&
(window->buffer->last_read_line == line->prev_line))
{
- gui_chat_set_weechat_color (window, COLOR_WIN_CHAT_READ_MARKER);
+ gui_chat_set_weechat_color (window, GUI_COLOR_WIN_CHAT_READ_MARKER);
mvwprintw (GUI_CURSES(window)->win_chat, read_marker_y, read_marker_x,
"%c", cfg_look_read_marker[0]);
}
@@ -970,7 +970,7 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
{
if (erase)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat, COLOR_WIN_CHAT);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat, GUI_COLOR_WIN_CHAT);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_chat_width);
for (i = 0; i < ptr_win->win_chat_height; i++)
@@ -979,13 +979,13 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
}
}
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat, COLOR_WIN_CHAT);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat, GUI_COLOR_WIN_CHAT);
- if (buffer->type == BUFFER_TYPE_DCC)
+ if (buffer->type == GUI_BUFFER_TYPE_DCC)
{
i = 0;
- dcc_first = (ptr_win->dcc_first) ? (t_irc_dcc *) ptr_win->dcc_first : dcc_list;
- dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
+ dcc_first = (ptr_win->dcc_first) ? (t_irc_dcc *) ptr_win->dcc_first : irc_dcc_list;
+ dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : irc_dcc_list;
for (ptr_dcc = dcc_first; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (i >= ptr_win->win_chat_height - 1)
@@ -994,19 +994,19 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
/* nickname and filename */
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
(ptr_dcc == dcc_selected) ?
- COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
+ GUI_COLOR_DCC_SELECTED : GUI_COLOR_WIN_CHAT);
mvwprintw (GUI_CURSES(ptr_win)->win_chat, i, 0, "%s %-16s ",
(ptr_dcc == dcc_selected) ? "***" : " ",
ptr_dcc->nick);
buf = weechat_iconv_from_internal (NULL,
- (DCC_IS_CHAT(ptr_dcc->type)) ?
+ (IRC_DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename);
wprintw (GUI_CURSES(ptr_win)->win_chat, "%s",
- (buf) ? buf : ((DCC_IS_CHAT(ptr_dcc->type)) ?
+ (buf) ? buf : ((IRC_DCC_IS_CHAT(ptr_dcc->type)) ?
_(ptr_dcc->filename) : ptr_dcc->filename));
if (buf)
free (buf);
- if (DCC_IS_FILE(ptr_dcc->type))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type))
{
if (ptr_dcc->filename_suffix > 0)
wprintw (GUI_CURSES(ptr_win)->win_chat, " (.%d)",
@@ -1016,28 +1016,28 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
/* status */
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
(ptr_dcc == dcc_selected) ?
- COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
+ GUI_COLOR_DCC_SELECTED : GUI_COLOR_WIN_CHAT);
mvwprintw (GUI_CURSES(ptr_win)->win_chat, i + 1, 0, "%s %s ",
(ptr_dcc == dcc_selected) ? "***" : " ",
- (DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--");
+ (IRC_DCC_IS_RECV(ptr_dcc->type)) ? "-->>" : "<<--");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
- COLOR_DCC_WAITING + ptr_dcc->status);
- buf = weechat_iconv_from_internal (NULL, _(dcc_status_string[ptr_dcc->status]));
+ GUI_COLOR_DCC_WAITING + ptr_dcc->status);
+ buf = weechat_iconv_from_internal (NULL, _(irc_dcc_status_string[ptr_dcc->status]));
wprintw (GUI_CURSES(ptr_win)->win_chat, "%-10s",
- (buf) ? buf : _(dcc_status_string[ptr_dcc->status]));
+ (buf) ? buf : _(irc_dcc_status_string[ptr_dcc->status]));
if (buf)
free (buf);
/* other infos */
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_chat,
(ptr_dcc == dcc_selected) ?
- COLOR_DCC_SELECTED : COLOR_WIN_CHAT);
- if (DCC_IS_FILE(ptr_dcc->type))
+ GUI_COLOR_DCC_SELECTED : GUI_COLOR_WIN_CHAT);
+ if (IRC_DCC_IS_FILE(ptr_dcc->type))
{
wprintw (GUI_CURSES(ptr_win)->win_chat, " [");
if (ptr_dcc->size == 0)
{
- if (ptr_dcc->status == DCC_DONE)
+ if (ptr_dcc->status == IRC_DCC_DONE)
num_bars = 10;
else
num_bars = 0;
@@ -1061,7 +1061,7 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
num_unit = 3;
if (ptr_dcc->size == 0)
{
- if (ptr_dcc->status == DCC_DONE)
+ if (ptr_dcc->status == IRC_DCC_DONE)
pct_complete = 100;
else
pct_complete = 0;
@@ -1086,7 +1086,7 @@ gui_chat_draw (t_gui_buffer *buffer, int erase)
else
num_unit = 3;
wprintw (GUI_CURSES(ptr_win)->win_chat, " (");
- if (ptr_dcc->status == DCC_ACTIVE)
+ if (ptr_dcc->status == IRC_DCC_ACTIVE)
{
wprintw (GUI_CURSES(ptr_win)->win_chat, _("ETA"));
wprintw (GUI_CURSES(ptr_win)->win_chat, ": %.2lu:%.2lu:%.2lu - ",
diff --git a/src/gui/curses/gui-curses-color.c b/src/gui/curses/gui-curses-color.c
index b53e10525..0cedceeba 100644
--- a/src/gui/curses/gui-curses-color.c
+++ b/src/gui/curses/gui-curses-color.c
@@ -495,65 +495,65 @@ gui_color_init_weechat ()
{
int i;
- gui_color[COLOR_WIN_SEPARATOR] = gui_color_build (COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
- gui_color[COLOR_WIN_TITLE] = gui_color_build (COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
- gui_color[COLOR_WIN_TITLE_MORE] = gui_color_build (COLOR_WIN_TITLE_MORE, cfg_col_title_more, cfg_col_title_bg);
- gui_color[COLOR_WIN_CHAT] = gui_color_build (COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_TIME] = gui_color_build (COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PREFIX1] = gui_color_build (COLOR_WIN_CHAT_PREFIX1, cfg_col_chat_prefix1, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PREFIX2] = gui_color_build (COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_SERVER] = gui_color_build (COLOR_WIN_CHAT_SERVER, cfg_col_chat_server, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_JOIN] = gui_color_build (COLOR_WIN_CHAT_JOIN, cfg_col_chat_join, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PART] = gui_color_build (COLOR_WIN_CHAT_PART, cfg_col_chat_part, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_NICK] = gui_color_build (COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_HOST] = gui_color_build (COLOR_WIN_CHAT_HOST, cfg_col_chat_host, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_READ_MARKER] = gui_color_build (COLOR_WIN_CHAT_READ_MARKER, cfg_col_chat_read_marker, cfg_col_chat_read_marker_bg);
- gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_MSG] = gui_color_build (COLOR_WIN_STATUS_DATA_MSG, cfg_col_status_data_msg, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_PRIVATE] = gui_color_build (COLOR_WIN_STATUS_DATA_PRIVATE, cfg_col_status_data_private, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_HIGHLIGHT] = gui_color_build (COLOR_WIN_STATUS_DATA_HIGHLIGHT, cfg_col_status_data_highlight, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_OTHER] = gui_color_build (COLOR_WIN_STATUS_DATA_OTHER, cfg_col_status_data_other, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_MORE] = gui_color_build (COLOR_WIN_STATUS_MORE, cfg_col_status_more, cfg_col_status_bg);
- gui_color[COLOR_WIN_INFOBAR] = gui_color_build (COLOR_WIN_INFOBAR, cfg_col_infobar, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INFOBAR_DELIMITERS] = gui_color_build (COLOR_WIN_INFOBAR_DELIMITERS, cfg_col_infobar_delimiters, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INFOBAR_HIGHLIGHT] = gui_color_build (COLOR_WIN_INFOBAR_HIGHLIGHT, cfg_col_infobar_highlight, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INPUT] = gui_color_build (COLOR_WIN_INPUT, cfg_col_input, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_SERVER] = gui_color_build (COLOR_WIN_INPUT_SERVER, cfg_col_input_server, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_TEXT_NOT_FOUND] = gui_color_build (COLOR_WIN_INPUT_TEXT_NOT_FOUND, cfg_col_input_text_not_found, cfg_col_input_bg);
- gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_CHANADMIN] = gui_color_build (COLOR_WIN_NICK_CHANADMIN, cfg_col_nick_chanadmin, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_OP] = gui_color_build (COLOR_WIN_NICK_OP, cfg_col_nick_op, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_HALFOP] = gui_color_build (COLOR_WIN_NICK_HALFOP, cfg_col_nick_halfop, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_VOICE] = gui_color_build (COLOR_WIN_NICK_VOICE, cfg_col_nick_voice, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_CHANUSER] = gui_color_build (COLOR_WIN_NICK_CHANUSER, cfg_col_nick_user, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_MORE] = gui_color_build (COLOR_WIN_NICK_MORE, cfg_col_nick_more, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_SEP] = gui_color_build (COLOR_WIN_NICK_SEP, cfg_col_nick_sep, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_SELF] = gui_color_build (COLOR_WIN_NICK_SELF, cfg_col_nick_self, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_PRIVATE] = gui_color_build (COLOR_WIN_NICK_PRIVATE, cfg_col_nick_private, cfg_col_nick_bg);
-
- for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
+ gui_color[GUI_COLOR_WIN_SEPARATOR] = gui_color_build (GUI_COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
+ gui_color[GUI_COLOR_WIN_TITLE] = gui_color_build (GUI_COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
+ gui_color[GUI_COLOR_WIN_TITLE_MORE] = gui_color_build (GUI_COLOR_WIN_TITLE_MORE, cfg_col_title_more, cfg_col_title_bg);
+ gui_color[GUI_COLOR_WIN_CHAT] = gui_color_build (GUI_COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_TIME] = gui_color_build (GUI_COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (GUI_COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_PREFIX1] = gui_color_build (GUI_COLOR_WIN_CHAT_PREFIX1, cfg_col_chat_prefix1, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_PREFIX2] = gui_color_build (GUI_COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_SERVER] = gui_color_build (GUI_COLOR_WIN_CHAT_SERVER, cfg_col_chat_server, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_JOIN] = gui_color_build (GUI_COLOR_WIN_CHAT_JOIN, cfg_col_chat_join, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_PART] = gui_color_build (GUI_COLOR_WIN_CHAT_PART, cfg_col_chat_part, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_NICK] = gui_color_build (GUI_COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_HOST] = gui_color_build (GUI_COLOR_WIN_CHAT_HOST, cfg_col_chat_host, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_CHANNEL] = gui_color_build (GUI_COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_DARK] = gui_color_build (GUI_COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (GUI_COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_CHAT_READ_MARKER] = gui_color_build (GUI_COLOR_WIN_CHAT_READ_MARKER, cfg_col_chat_read_marker, cfg_col_chat_read_marker_bg);
+ gui_color[GUI_COLOR_WIN_STATUS] = gui_color_build (GUI_COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (GUI_COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_CHANNEL] = gui_color_build (GUI_COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_DATA_MSG] = gui_color_build (GUI_COLOR_WIN_STATUS_DATA_MSG, cfg_col_status_data_msg, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_DATA_PRIVATE] = gui_color_build (GUI_COLOR_WIN_STATUS_DATA_PRIVATE, cfg_col_status_data_private, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_DATA_HIGHLIGHT] = gui_color_build (GUI_COLOR_WIN_STATUS_DATA_HIGHLIGHT, cfg_col_status_data_highlight, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_DATA_OTHER] = gui_color_build (GUI_COLOR_WIN_STATUS_DATA_OTHER, cfg_col_status_data_other, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_STATUS_MORE] = gui_color_build (GUI_COLOR_WIN_STATUS_MORE, cfg_col_status_more, cfg_col_status_bg);
+ gui_color[GUI_COLOR_WIN_INFOBAR] = gui_color_build (GUI_COLOR_WIN_INFOBAR, cfg_col_infobar, cfg_col_infobar_bg);
+ gui_color[GUI_COLOR_WIN_INFOBAR_DELIMITERS] = gui_color_build (GUI_COLOR_WIN_INFOBAR_DELIMITERS, cfg_col_infobar_delimiters, cfg_col_infobar_bg);
+ gui_color[GUI_COLOR_WIN_INFOBAR_HIGHLIGHT] = gui_color_build (GUI_COLOR_WIN_INFOBAR_HIGHLIGHT, cfg_col_infobar_highlight, cfg_col_infobar_bg);
+ gui_color[GUI_COLOR_WIN_INPUT] = gui_color_build (GUI_COLOR_WIN_INPUT, cfg_col_input, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_INPUT_SERVER] = gui_color_build (GUI_COLOR_WIN_INPUT_SERVER, cfg_col_input_server, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_INPUT_CHANNEL] = gui_color_build (GUI_COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_INPUT_NICK] = gui_color_build (GUI_COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (GUI_COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_INPUT_TEXT_NOT_FOUND] = gui_color_build (GUI_COLOR_WIN_INPUT_TEXT_NOT_FOUND, cfg_col_input_text_not_found, cfg_col_input_bg);
+ gui_color[GUI_COLOR_WIN_NICK] = gui_color_build (GUI_COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_AWAY] = gui_color_build (GUI_COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_CHANOWNER] = gui_color_build (GUI_COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_CHANADMIN] = gui_color_build (GUI_COLOR_WIN_NICK_CHANADMIN, cfg_col_nick_chanadmin, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_OP] = gui_color_build (GUI_COLOR_WIN_NICK_OP, cfg_col_nick_op, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_HALFOP] = gui_color_build (GUI_COLOR_WIN_NICK_HALFOP, cfg_col_nick_halfop, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_VOICE] = gui_color_build (GUI_COLOR_WIN_NICK_VOICE, cfg_col_nick_voice, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_CHANUSER] = gui_color_build (GUI_COLOR_WIN_NICK_CHANUSER, cfg_col_nick_user, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_MORE] = gui_color_build (GUI_COLOR_WIN_NICK_MORE, cfg_col_nick_more, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_SEP] = gui_color_build (GUI_COLOR_WIN_NICK_SEP, cfg_col_nick_sep, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_SELF] = gui_color_build (GUI_COLOR_WIN_NICK_SELF, cfg_col_nick_self, cfg_col_nick_bg);
+ gui_color[GUI_COLOR_WIN_NICK_PRIVATE] = gui_color_build (GUI_COLOR_WIN_NICK_PRIVATE, cfg_col_nick_private, cfg_col_nick_bg);
+
+ for (i = 0; i < GUI_COLOR_WIN_NICK_NUMBER; i++)
{
- gui_color[COLOR_WIN_NICK_1 + i] = gui_color_build (COLOR_WIN_NICK_1 + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
+ gui_color[GUI_COLOR_WIN_NICK_1 + i] = gui_color_build (GUI_COLOR_WIN_NICK_1 + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
}
- gui_color[COLOR_DCC_SELECTED] = gui_color_build (COLOR_DCC_SELECTED, cfg_col_dcc_selected, cfg_col_chat_bg);
- gui_color[COLOR_DCC_WAITING] = gui_color_build (COLOR_DCC_WAITING, cfg_col_dcc_waiting, cfg_col_chat_bg);
- gui_color[COLOR_DCC_CONNECTING] = gui_color_build (COLOR_DCC_CONNECTING, cfg_col_dcc_connecting, cfg_col_chat_bg);
- gui_color[COLOR_DCC_ACTIVE] = gui_color_build (COLOR_DCC_ACTIVE, cfg_col_dcc_active, cfg_col_chat_bg);
- gui_color[COLOR_DCC_DONE] = gui_color_build (COLOR_DCC_DONE, cfg_col_dcc_done, cfg_col_chat_bg);
- gui_color[COLOR_DCC_FAILED] = gui_color_build (COLOR_DCC_FAILED, cfg_col_dcc_failed, cfg_col_chat_bg);
- gui_color[COLOR_DCC_ABORTED] = gui_color_build (COLOR_DCC_ABORTED, cfg_col_dcc_aborted, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_SELECTED] = gui_color_build (GUI_COLOR_DCC_SELECTED, cfg_col_dcc_selected, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_WAITING] = gui_color_build (GUI_COLOR_DCC_WAITING, cfg_col_dcc_waiting, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_CONNECTING] = gui_color_build (GUI_COLOR_DCC_CONNECTING, cfg_col_dcc_connecting, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_ACTIVE] = gui_color_build (GUI_COLOR_DCC_ACTIVE, cfg_col_dcc_active, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_DONE] = gui_color_build (GUI_COLOR_DCC_DONE, cfg_col_dcc_done, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_FAILED] = gui_color_build (GUI_COLOR_DCC_FAILED, cfg_col_dcc_failed, cfg_col_chat_bg);
+ gui_color[GUI_COLOR_DCC_ABORTED] = gui_color_build (GUI_COLOR_DCC_ABORTED, cfg_col_dcc_aborted, cfg_col_chat_bg);
}
/*
diff --git a/src/gui/curses/gui-curses-infobar.c b/src/gui/curses/gui-curses-infobar.c
index 0ae11a490..0e7a3ce9b 100644
--- a/src/gui/curses/gui-curses-infobar.c
+++ b/src/gui/curses/gui-curses-infobar.c
@@ -57,7 +57,7 @@ gui_infobar_draw_time (t_gui_buffer *buffer)
local_time = localtime (&time_seconds);
if (local_time)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR);
mvwprintw (GUI_CURSES(ptr_win)->win_infobar,
0, 1,
"%02d:%02d",
@@ -92,18 +92,18 @@ gui_infobar_draw (t_gui_buffer *buffer, int erase)
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
- gui_window_curses_clear (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
+ gui_window_curses_clear (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR);
time_seconds = time (NULL);
local_time = localtime (&time_seconds);
if (local_time)
{
strftime (text_time, 1024, cfg_look_infobar_timestamp, local_time);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "[");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
"%02d:%02d",
local_time->tm_hour, local_time->tm_min);
@@ -111,15 +111,15 @@ gui_infobar_draw (t_gui_buffer *buffer, int erase)
wprintw (GUI_CURSES(ptr_win)->win_infobar,
":%02d",
local_time->tm_sec);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, "]");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR);
wprintw (GUI_CURSES(ptr_win)->win_infobar,
" %s", text_time);
}
if (gui_infobar)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, COLOR_WIN_INFOBAR_DELIMITERS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, GUI_COLOR_WIN_INFOBAR_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_infobar, " | ");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_infobar, gui_infobar->color);
buf = weechat_iconv_from_internal (NULL, gui_infobar->text);
diff --git a/src/gui/curses/gui-curses-input.c b/src/gui/curses/gui-curses-input.c
index 8b25c7a51..817c931a4 100644
--- a/src/gui/curses/gui-curses-input.c
+++ b/src/gui/curses/gui-curses-input.c
@@ -48,7 +48,7 @@ gui_input_set_color (t_gui_window *window, int irc_color)
int fg, bg;
fg = gui_irc_colors[irc_color][0];
- bg = gui_color[COLOR_WIN_INPUT]->background;
+ bg = gui_color[GUI_COLOR_WIN_INPUT]->background;
irc_color %= GUI_NUM_IRC_COLORS;
if (gui_irc_colors[irc_color][1] & A_BOLD)
@@ -77,7 +77,7 @@ gui_input_get_prompt_length (t_gui_window *window, char *nick)
char *pos, saved_char;
int char_size, length;
- if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
if (window->buffer->text_search_exact)
return utf8_width_screen (_("Text search (exact): "));
@@ -96,21 +96,21 @@ gui_input_get_prompt_length (t_gui_window *window, char *nick)
switch (pos[0])
{
case 'c': /* channel or server name */
- if (CHANNEL(window->buffer))
- length += utf8_width_screen (CHANNEL(window->buffer)->name);
+ if (GUI_CHANNEL(window->buffer))
+ length += utf8_width_screen (GUI_CHANNEL(window->buffer)->name);
else
{
- if (SERVER(window->buffer))
- length += utf8_width_screen (SERVER(window->buffer)->name);
+ if (GUI_SERVER(window->buffer))
+ length += utf8_width_screen (GUI_SERVER(window->buffer)->name);
}
pos++;
break;
case 'm': /* nick modes */
- if (SERVER(window->buffer) && SERVER(window->buffer)->is_connected)
+ if (GUI_SERVER(window->buffer) && GUI_SERVER(window->buffer)->is_connected)
{
- if (SERVER(window->buffer)->nick_modes
- && SERVER(window->buffer)->nick_modes[0])
- length += strlen (SERVER(window->buffer)->nick_modes);
+ if (GUI_SERVER(window->buffer)->nick_modes
+ && GUI_SERVER(window->buffer)->nick_modes[0])
+ length += strlen (GUI_SERVER(window->buffer)->nick_modes);
}
pos++;
break;
@@ -160,10 +160,10 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
wmove (GUI_CURSES(window)->win_input, 0, 0);
- if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT);
+ GUI_COLOR_WIN_INPUT);
wprintw (GUI_CURSES(window)->win_input, "%s",
(window->buffer->text_search_exact) ?
_("Text search (exact): ") : _("Text search: "));
@@ -180,27 +180,27 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
switch (pos[0])
{
case 'c': /* channel or server name */
- if (CHANNEL(window->buffer))
+ if (GUI_CHANNEL(window->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_CHANNEL);
+ GUI_COLOR_WIN_INPUT_CHANNEL);
buf = weechat_iconv_from_internal (NULL,
- CHANNEL(window->buffer)->name);
+ GUI_CHANNEL(window->buffer)->name);
wprintw (GUI_CURSES(window)->win_input, "%s",
- (buf) ? buf : CHANNEL(window->buffer)->name);
+ (buf) ? buf : GUI_CHANNEL(window->buffer)->name);
if (buf)
free (buf);
}
else
{
- if (SERVER(window->buffer))
+ if (GUI_SERVER(window->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_SERVER);
+ GUI_COLOR_WIN_INPUT_SERVER);
buf = weechat_iconv_from_internal (NULL,
- SERVER(window->buffer)->name);
+ GUI_SERVER(window->buffer)->name);
wprintw (GUI_CURSES(window)->win_input, "%s",
- (buf) ? buf : SERVER(window->buffer)->name);
+ (buf) ? buf : GUI_SERVER(window->buffer)->name);
if (buf)
free (buf);
}
@@ -208,22 +208,22 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
pos++;
break;
case 'm': /* nick modes */
- if (SERVER(window->buffer) && SERVER(window->buffer)->is_connected)
+ if (GUI_SERVER(window->buffer) && GUI_SERVER(window->buffer)->is_connected)
{
- if (SERVER(window->buffer)->nick_modes
- && SERVER(window->buffer)->nick_modes[0])
+ if (GUI_SERVER(window->buffer)->nick_modes
+ && GUI_SERVER(window->buffer)->nick_modes[0])
{
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT);
+ GUI_COLOR_WIN_INPUT);
wprintw (GUI_CURSES(window)->win_input, "%s",
- SERVER(window->buffer)->nick_modes);
+ GUI_SERVER(window->buffer)->nick_modes);
}
}
pos++;
break;
case 'n': /* nick */
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_NICK);
+ GUI_COLOR_WIN_INPUT_NICK);
buf = weechat_iconv_from_internal (NULL, nick);
wprintw (GUI_CURSES(window)->win_input, "%s", (buf) ? buf : nick);
if (buf)
@@ -237,7 +237,7 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
saved_char = pos[char_size];
pos[char_size] = '\0';
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_DELIMITERS);
+ GUI_COLOR_WIN_INPUT_DELIMITERS);
wprintw (GUI_CURSES(window)->win_input, "%%%s", pos);
pos[char_size] = saved_char;
pos += char_size;
@@ -255,7 +255,7 @@ gui_input_draw_prompt (t_gui_window *window, char *nick)
saved_char = pos[char_size];
pos[char_size] = '\0';
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_DELIMITERS);
+ GUI_COLOR_WIN_INPUT_DELIMITERS);
wprintw (GUI_CURSES(window)->win_input, "%s", pos);
pos[char_size] = saved_char;
pos += char_size;
@@ -283,14 +283,14 @@ gui_input_draw_text (t_gui_window *window, int input_width)
count_cursor = window->buffer->input_buffer_pos -
window->buffer->input_buffer_1st_display;
offset_cursor = 0;
- if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
{
if (window->buffer->text_search_found)
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT);
+ GUI_COLOR_WIN_INPUT);
else
gui_window_set_weechat_color (GUI_CURSES(window)->win_input,
- COLOR_WIN_INPUT_TEXT_NOT_FOUND);
+ GUI_COLOR_WIN_INPUT_TEXT_NOT_FOUND);
}
while ((input_width > 0) && ptr_start && ptr_start[0])
{
@@ -300,7 +300,7 @@ gui_input_draw_text (t_gui_window *window, int input_width)
saved_char = ptr_next[0];
ptr_next[0] = '\0';
size = ptr_next - ptr_start;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (window->buffer->input_buffer_color_mask[pos_mask] != ' ')
color = window->buffer->input_buffer_color_mask[pos_mask] - '0';
@@ -309,7 +309,7 @@ gui_input_draw_text (t_gui_window *window, int input_width)
if (color != last_color)
{
if (color == -1)
- gui_window_set_weechat_color (GUI_CURSES(window)->win_input, COLOR_WIN_INPUT);
+ gui_window_set_weechat_color (GUI_CURSES(window)->win_input, GUI_COLOR_WIN_INPUT);
else
gui_input_set_color (window, color);
}
@@ -376,19 +376,19 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
if (ptr_win->buffer == buffer)
{
if (erase)
- gui_window_curses_clear (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
+ gui_window_curses_clear (GUI_CURSES(ptr_win)->win_input, GUI_COLOR_WIN_INPUT);
switch (buffer->type)
{
- case BUFFER_TYPE_STANDARD:
+ case GUI_BUFFER_TYPE_STANDARD:
if (buffer->has_input)
{
if (buffer->input_buffer_length == 0)
buffer->input_buffer[0] = '\0';
- if (SERVER(buffer) && SERVER(buffer)->is_connected)
- ptr_nickname = (SERVER(buffer)->nick) ?
- SERVER(buffer)->nick : cfg_look_no_nickname;
+ if (GUI_SERVER(buffer) && GUI_SERVER(buffer)->is_connected)
+ ptr_nickname = (GUI_SERVER(buffer)->nick) ?
+ GUI_SERVER(buffer)->nick : cfg_look_no_nickname;
else
ptr_nickname = cfg_look_no_nickname;
@@ -428,7 +428,7 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
if (display_prompt)
gui_input_draw_prompt (ptr_win, ptr_nickname);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_input, COLOR_WIN_INPUT);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_input, GUI_COLOR_WIN_INPUT);
snprintf (format, 32, "%%-%ds", ptr_win->win_input_width - prompt_length);
offset_cursor = 0;
if (ptr_win == gui_current_window)
@@ -443,28 +443,28 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
ptr_win->win_input_x + ptr_win->win_input_cursor_x);
}
break;
- case BUFFER_TYPE_DCC:
- dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : dcc_list;
+ case GUI_BUFFER_TYPE_DCC:
+ dcc_selected = (ptr_win->dcc_selected) ? (t_irc_dcc *) ptr_win->dcc_selected : irc_dcc_list;
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
if (dcc_selected)
{
switch (dcc_selected->status)
{
- case DCC_WAITING:
- if (DCC_IS_RECV(dcc_selected->type))
+ case IRC_DCC_WAITING:
+ if (IRC_DCC_IS_RECV(dcc_selected->type))
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
_(" [A] Accept"));
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
_(" [C] Cancel"));
break;
- case DCC_CONNECTING:
- case DCC_ACTIVE:
+ case IRC_DCC_CONNECTING:
+ case IRC_DCC_ACTIVE:
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
_(" [C] Cancel"));
break;
- case DCC_DONE:
- case DCC_FAILED:
- case DCC_ABORTED:
+ case IRC_DCC_DONE:
+ case IRC_DCC_FAILED:
+ case IRC_DCC_ABORTED:
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
_(" [R] Remove"));
break;
@@ -479,7 +479,7 @@ gui_input_draw (t_gui_buffer *buffer, int erase)
if (ptr_win == gui_current_window)
move (ptr_win->win_input_y, ptr_win->win_input_x);
break;
- case BUFFER_TYPE_RAW_DATA:
+ case GUI_BUFFER_TYPE_RAW_DATA:
wmove (GUI_CURSES(ptr_win)->win_input, 0, 0);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_input,
_(" [C] Clear buffer"));
diff --git a/src/gui/curses/gui-curses-keyboard.c b/src/gui/curses/gui-curses-keyboard.c
index a04463b40..479112221 100644
--- a/src/gui/curses/gui-curses-keyboard.c
+++ b/src/gui/curses/gui-curses-keyboard.c
@@ -282,7 +282,7 @@ gui_keyboard_read ()
/*gui_printf (gui_current_window->buffer, "gui_input_read: key = %s (%d)\n", key_str, key);*/
- if (gui_current_window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
input_old = (gui_current_window->buffer->input_buffer) ?
strdup (gui_current_window->buffer->input_buffer) : strdup ("");
else
@@ -297,22 +297,22 @@ gui_keyboard_read ()
switch (gui_current_window->buffer->type)
{
- case BUFFER_TYPE_STANDARD:
+ case GUI_BUFFER_TYPE_STANDARD:
gui_insert_string_input (gui_current_window, key_str, -1);
gui_current_window->buffer->completion.position = -1;
input_draw = 1;
break;
- case BUFFER_TYPE_DCC:
+ case GUI_BUFFER_TYPE_DCC:
gui_exec_action_dcc (gui_current_window, key_str);
break;
- case BUFFER_TYPE_RAW_DATA:
+ case GUI_BUFFER_TYPE_RAW_DATA:
gui_exec_action_raw_data (gui_current_window, key_str);
break;
}
}
/* incremental text search in buffer */
- if ((gui_current_window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if ((gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
&& ((input_old == NULL) || (gui_current_window->buffer->input_buffer == NULL)
|| (strcmp (input_old, gui_current_window->buffer->input_buffer) != 0)))
{
diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c
index f4066b836..29d09c68f 100644
--- a/src/gui/curses/gui-curses-main.c
+++ b/src/gui/curses/gui-curses-main.c
@@ -83,7 +83,7 @@ gui_main_loop ()
old_min = -1;
old_sec = -1;
- check_away = 0;
+ irc_check_away = 0;
/* if SIGTERM or SIGHUP received => quit */
signal (SIGTERM, gui_main_quit);
@@ -114,7 +114,7 @@ gui_main_loop ()
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
- if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
+ if (ptr_buffer->type == GUI_BUFFER_TYPE_STANDARD)
gui_printf_nolog_notime (ptr_buffer,
_("Day changed to %s\n"),
(text_time2) ?
@@ -165,10 +165,10 @@ gui_main_loop ()
/* away check */
if (cfg_irc_away_check != 0)
{
- check_away++;
- if (check_away >= (cfg_irc_away_check * 60))
+ irc_check_away++;
+ if (irc_check_away >= (cfg_irc_away_check * 60))
{
- check_away = 0;
+ irc_check_away = 0;
irc_server_check_away ();
}
}
@@ -243,7 +243,7 @@ gui_main_loop ()
diff = (int) get_timeval_diff (&(ptr_server->lag_check_time), &tv);
if (diff / 1000 > cfg_irc_lag_disconnect * 60)
{
- irc_display_prefix (ptr_server, ptr_server->buffer, PREFIX_ERROR);
+ irc_display_prefix (ptr_server, ptr_server->buffer, GUI_PREFIX_ERROR);
gui_printf (ptr_server->buffer,
_("%s lag is high, disconnecting from server...\n"),
WEECHAT_WARNING);
@@ -340,7 +340,7 @@ gui_main_init ()
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
- gui_buffer_new (gui_windows, NULL, NULL, BUFFER_TYPE_STANDARD, 1);
+ gui_buffer_new (gui_windows, NULL, NULL, GUI_BUFFER_TYPE_STANDARD, 1);
if (cfg_look_set_title)
gui_window_set_title ();
diff --git a/src/gui/curses/gui-curses-nicklist.c b/src/gui/curses/gui-curses-nicklist.c
index 71ff500d7..ee425116c 100644
--- a/src/gui/curses/gui-curses-nicklist.c
+++ b/src/gui/curses/gui-curses-nicklist.c
@@ -46,14 +46,14 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
char format_empty[32], *buf, *ptr_buf, *ptr_next, saved_char;
t_irc_nick *ptr_nick;
- if (!gui_ok || !BUFFER_HAS_NICKLIST(buffer))
+ if (!gui_ok || !GUI_BUFFER_HAS_NICKLIST(buffer))
return;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((ptr_win->buffer == buffer) && (buffer->num_displayed > 0))
{
- max_length = irc_nick_get_max_length (CHANNEL(buffer));
+ max_length = irc_nick_get_max_length (GUI_CHANNEL(buffer));
if (calculate_size && (gui_window_calculate_pos_size (ptr_win, 0)))
{
@@ -73,7 +73,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
if (erase)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK);
snprintf (format_empty, 32, "%%-%ds", ptr_win->win_nick_width);
for (i = 0; i < ptr_win->win_nick_height; i++)
@@ -95,7 +95,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
if (cfg_look_nicklist_separator && has_colors ())
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_SEP);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_SEP);
switch (cfg_look_nicklist_position)
{
case CFG_LOOK_NICKLIST_LEFT:
@@ -121,7 +121,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
}
}
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK);
x = 0;
y = (cfg_look_nicklist_separator && (cfg_look_nicklist_position == CFG_LOOK_NICKLIST_BOTTOM)) ? 1 : 0;
max_y = 0;
@@ -146,7 +146,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
else
nicks_displayed = ptr_win->win_nick_height;
- ptr_nick = CHANNEL(buffer)->nicks;
+ ptr_nick = GUI_CHANNEL(buffer)->nicks;
for (i = 0; i < ptr_win->win_nick_start; i++)
{
if (!ptr_nick)
@@ -173,64 +173,64 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
if ( ((i == 0) && (ptr_win->win_nick_start > 0))
|| ((i == nicks_displayed - 1) && (ptr_nick->next_nick)) )
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_MORE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_MORE);
j = (max_length + 1) >= 4 ? 4 : max_length + 1;
for (x2 = 1; x2 <= j; x2++)
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x + x2, "+");
}
else
{
- if (ptr_nick->flags & NICK_CHANOWNER)
+ if (ptr_nick->flags & IRC_NICK_CHANOWNER)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANOWNER);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_CHANOWNER);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "~");
x++;
}
- else if (ptr_nick->flags & NICK_CHANADMIN)
+ else if (ptr_nick->flags & IRC_NICK_CHANADMIN)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANADMIN);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_CHANADMIN);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "&");
x++;
}
- else if (ptr_nick->flags & NICK_CHANADMIN2)
+ else if (ptr_nick->flags & IRC_NICK_CHANADMIN2)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANADMIN);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_CHANADMIN);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "!");
x++;
}
- else if (ptr_nick->flags & NICK_OP)
+ else if (ptr_nick->flags & IRC_NICK_OP)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_OP);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_OP);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "@");
x++;
}
- else if (ptr_nick->flags & NICK_HALFOP)
+ else if (ptr_nick->flags & IRC_NICK_HALFOP)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_HALFOP);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_HALFOP);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "%%");
x++;
}
- else if (ptr_nick->flags & NICK_VOICE)
+ else if (ptr_nick->flags & IRC_NICK_VOICE)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_VOICE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_VOICE);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "+");
x++;
}
- else if (ptr_nick->flags & NICK_CHANUSER)
+ else if (ptr_nick->flags & IRC_NICK_CHANUSER)
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK_CHANUSER);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK_CHANUSER);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, "-");
x++;
}
else
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, COLOR_WIN_NICK);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick, GUI_COLOR_WIN_NICK);
mvwprintw (GUI_CURSES(ptr_win)->win_nick, y, x, " ");
x++;
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_nick,
- ((cfg_irc_away_check > 0) && (ptr_nick->flags & NICK_AWAY)) ?
- COLOR_WIN_NICK_AWAY : COLOR_WIN_NICK);
+ ((cfg_irc_away_check > 0) && (ptr_nick->flags & IRC_NICK_AWAY)) ?
+ GUI_COLOR_WIN_NICK_AWAY : GUI_COLOR_WIN_NICK);
wmove (GUI_CURSES(ptr_win)->win_nick, y, x);
ptr_buf = ptr_nick->nick;
saved_char = '\0';
diff --git a/src/gui/curses/gui-curses-status.c b/src/gui/curses/gui-curses-status.c
index 3624c7b27..f5b1821fb 100644
--- a/src/gui/curses/gui-curses-status.c
+++ b/src/gui/curses/gui-curses-status.c
@@ -56,20 +56,20 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (erase)
- gui_window_curses_clear (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_curses_clear (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS);
/* display number of buffers */
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
mvwprintw (GUI_CURSES(ptr_win)->win_status, 0, 0, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
(last_gui_buffer) ? last_gui_buffer->number : 0);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
/* display "<servers>" or current server */
@@ -77,157 +77,161 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("<servers>"));
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
- else if (SERVER(ptr_win->buffer) && SERVER(ptr_win->buffer)->name)
+ else if (GUI_SERVER(ptr_win->buffer) && GUI_SERVER(ptr_win->buffer)->name)
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
- wprintw (GUI_CURSES(ptr_win)->win_status, "%s", SERVER(ptr_win->buffer)->name);
- if (SERVER(ptr_win->buffer)->is_away)
+ GUI_COLOR_WIN_STATUS);
+ wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
+ GUI_SERVER(ptr_win->buffer)->name);
+ if (GUI_SERVER(ptr_win->buffer)->is_away)
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
/* infos about current server buffer */
- if (SERVER(ptr_win->buffer) && !CHANNEL(ptr_win->buffer))
+ if (GUI_SERVER(ptr_win->buffer) && !GUI_CHANNEL(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_CHANNEL);
- if (SERVER(ptr_win->buffer)->is_connected)
+ GUI_COLOR_WIN_STATUS_CHANNEL);
+ if (GUI_SERVER(ptr_win->buffer)->is_connected)
{
- if ((ptr_win->buffer->all_servers) && (SERVER(ptr_win->buffer)->is_away))
+ if ((ptr_win->buffer->all_servers) && (GUI_SERVER(ptr_win->buffer)->is_away))
{
wprintw (GUI_CURSES(ptr_win)->win_status, "[%s",
- SERVER(ptr_win->buffer)->name);
+ GUI_SERVER(ptr_win->buffer)->name);
wprintw (GUI_CURSES(ptr_win)->win_status, _("(away)"));
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
else
wprintw (GUI_CURSES(ptr_win)->win_status, "[%s] ",
- SERVER(ptr_win->buffer)->name);
+ GUI_SERVER(ptr_win->buffer)->name);
}
else
wprintw (GUI_CURSES(ptr_win)->win_status, "(%s) ",
- SERVER(ptr_win->buffer)->name);
+ GUI_SERVER(ptr_win->buffer)->name);
if (ptr_win->buffer->all_servers)
{
- irc_server_get_number_buffer (SERVER(ptr_win->buffer),
+ irc_server_get_number_buffer (GUI_SERVER(ptr_win->buffer),
&server_pos,
&server_total);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_pos);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "/");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d", server_total);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ") ");
}
}
/* infos about current channel/pv buffer */
- if (SERVER(ptr_win->buffer) && CHANNEL(ptr_win->buffer))
+ if (GUI_SERVER(ptr_win->buffer) && GUI_CHANNEL(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_CHANNEL);
- if (((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
- && (!CHANNEL(ptr_win->buffer)->nicks))
- || ((CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
- && (CHANNEL(ptr_win->buffer)->dcc_chat)
- && (((t_irc_dcc *)(CHANNEL(ptr_win->buffer)->dcc_chat))->sock < 0)))
+ GUI_COLOR_WIN_STATUS_CHANNEL);
+ if (((GUI_CHANNEL(ptr_win->buffer)->type == IRC_CHANNEL_TYPE_CHANNEL)
+ && (!GUI_CHANNEL(ptr_win->buffer)->nicks))
+ || ((GUI_CHANNEL(ptr_win->buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT)
+ && (GUI_CHANNEL(ptr_win->buffer)->dcc_chat)
+ && (((t_irc_dcc *)(GUI_CHANNEL(ptr_win->buffer)->dcc_chat))->sock < 0)))
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, "(%s)",
- CHANNEL(ptr_win->buffer)->name);
+ GUI_CHANNEL(ptr_win->buffer)->name);
else
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
- CHANNEL(ptr_win->buffer)->name);
- if (ptr_win->buffer == CHANNEL(ptr_win->buffer)->buffer)
+ GUI_CHANNEL(ptr_win->buffer)->name);
+ if (ptr_win->buffer == GUI_CHANNEL(ptr_win->buffer)->buffer)
{
/* display channel modes */
- if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_CHANNEL)
+ if (GUI_CHANNEL(ptr_win->buffer)->type == IRC_CHANNEL_TYPE_CHANNEL)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
- if (CHANNEL(ptr_win->buffer)->modes
- && (strcmp (CHANNEL(ptr_win->buffer)->modes, "+") != 0))
+ GUI_COLOR_WIN_STATUS);
+ if (GUI_CHANNEL(ptr_win->buffer)->modes
+ && (strcmp (GUI_CHANNEL(ptr_win->buffer)->modes, "+") != 0))
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, "%s",
- CHANNEL(ptr_win->buffer)->modes);
+ GUI_CHANNEL(ptr_win->buffer)->modes);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
}
/* display DCC if private is DCC CHAT */
- if (CHANNEL(ptr_win->buffer)->type == CHANNEL_TYPE_DCC_CHAT)
+ if (GUI_CHANNEL(ptr_win->buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "(");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_CHANNEL);
+ GUI_COLOR_WIN_STATUS_CHANNEL);
wprintw (GUI_CURSES(ptr_win)->win_status, "DCC");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ")");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
}
}
wprintw (GUI_CURSES(ptr_win)->win_status, " ");
}
- if (!SERVER(ptr_win->buffer))
+ if (!GUI_SERVER(ptr_win->buffer))
{
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
+ GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_win->buffer->number);
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_DELIMITERS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_CHANNEL);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
+ GUI_COLOR_WIN_STATUS_CHANNEL);
switch (ptr_win->buffer->type)
{
- case BUFFER_TYPE_STANDARD:
+ case GUI_BUFFER_TYPE_STANDARD:
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
_("[not connected] "));
break;
- case BUFFER_TYPE_DCC:
+ case GUI_BUFFER_TYPE_DCC:
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
"<DCC> ");
break;
- case BUFFER_TYPE_RAW_DATA:
+ case GUI_BUFFER_TYPE_RAW_DATA:
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
_("<RAW_IRC> "));
break;
@@ -238,9 +242,9 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
if (weechat_hotlist)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, _("Act: "));
names_count = 0;
@@ -251,22 +255,22 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
{
case HOTLIST_LOW:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DATA_OTHER);
+ GUI_COLOR_WIN_STATUS_DATA_OTHER);
display_name = ((cfg_look_hotlist_names_level & 1) != 0);
break;
case HOTLIST_MSG:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DATA_MSG);
+ GUI_COLOR_WIN_STATUS_DATA_MSG);
display_name = ((cfg_look_hotlist_names_level & 2) != 0);
break;
case HOTLIST_PRIVATE:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DATA_PRIVATE);
+ GUI_COLOR_WIN_STATUS_DATA_PRIVATE);
display_name = ((cfg_look_hotlist_names_level & 4) != 0);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DATA_HIGHLIGHT);
+ GUI_COLOR_WIN_STATUS_DATA_HIGHLIGHT);
display_name = ((cfg_look_hotlist_names_level & 8) != 0);
break;
default:
@@ -275,7 +279,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
}
switch (ptr_hotlist->buffer->type)
{
- case BUFFER_TYPE_STANDARD:
+ case GUI_BUFFER_TYPE_STANDARD:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
@@ -285,47 +289,47 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
names_count++;
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
- if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
+ if (GUI_BUFFER_IS_SERVER(ptr_hotlist->buffer))
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
format,
(ptr_hotlist->server) ?
ptr_hotlist->server->name :
- SERVER(ptr_hotlist->buffer)->name);
- else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
- || BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
+ GUI_SERVER(ptr_hotlist->buffer)->name);
+ else if (GUI_BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
+ || GUI_BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
format,
- CHANNEL(ptr_hotlist->buffer)->name);
+ GUI_CHANNEL(ptr_hotlist->buffer)->name);
}
break;
- case BUFFER_TYPE_DCC:
+ case GUI_BUFFER_TYPE_DCC:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
"DCC");
break;
- case BUFFER_TYPE_RAW_DATA:
+ case GUI_BUFFER_TYPE_RAW_DATA:
wprintw (GUI_CURSES(ptr_win)->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, ":");
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS);
+ GUI_COLOR_WIN_STATUS);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
_("RAW_IRC"));
break;
@@ -335,32 +339,33 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
wprintw (GUI_CURSES(ptr_win)->win_status, ",");
}
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "] ");
}
/* display lag */
- if (SERVER(ptr_win->buffer))
+ if (GUI_SERVER(ptr_win->buffer))
{
- if (SERVER(ptr_win->buffer)->lag / 1000 >= cfg_irc_lag_min_show)
+ if (GUI_SERVER(ptr_win->buffer)->lag / 1000 >= cfg_irc_lag_min_show)
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "[");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status,
_("Lag: %.1f"),
- ((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
+ ((float)(GUI_SERVER(ptr_win->buffer)->lag)) / 1000);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
}
}
/* display "-MORE-" (if last line is not displayed) & nicks count */
- if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(ptr_win->buffer))
{
- snprintf (str_nicks, sizeof (str_nicks) - 1, "%d", CHANNEL(ptr_win->buffer)->nicks_count);
+ snprintf (str_nicks, sizeof (str_nicks) - 1, "%d",
+ GUI_CHANNEL(ptr_win->buffer)->nicks_count);
x = ptr_win->win_status_width - utf8_strlen (str_nicks) - 4;
}
else
@@ -369,7 +374,7 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
x -= utf8_strlen (more) - 1;
if (x < 0)
x = 0;
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS_MORE);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS_MORE);
if (ptr_win->scroll)
{
wmove (GUI_CURSES(ptr_win)->win_status, 0, x);
@@ -381,15 +386,15 @@ gui_status_draw (t_gui_buffer *buffer, int erase)
wmove (GUI_CURSES(ptr_win)->win_status, 0, x);
gui_window_wprintw (GUI_CURSES(ptr_win)->win_status, format, " ");
}
- if (BUFFER_HAS_NICKLIST(ptr_win->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(ptr_win->buffer))
{
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, " [");
- gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, COLOR_WIN_STATUS);
+ gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status, GUI_COLOR_WIN_STATUS);
wprintw (GUI_CURSES(ptr_win)->win_status, "%s", str_nicks);
gui_window_set_weechat_color (GUI_CURSES(ptr_win)->win_status,
- COLOR_WIN_STATUS_DELIMITERS);
+ GUI_COLOR_WIN_STATUS_DELIMITERS);
wprintw (GUI_CURSES(ptr_win)->win_status, "]");
}
free (more);
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index ae2096125..4d3cb509a 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -203,9 +203,9 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
add_bottom = gui_panel_window_get_size (NULL, window, GUI_PANEL_BOTTOM);
/* init chat & nicklist settings */
- if (cfg_look_nicklist && BUFFER_IS_CHANNEL(window->buffer))
+ if (cfg_look_nicklist && GUI_BUFFER_IS_CHANNEL(window->buffer))
{
- max_length = irc_nick_get_max_length (CHANNEL(window->buffer));
+ max_length = irc_nick_get_max_length (GUI_CHANNEL(window->buffer));
lines = 0;
@@ -223,7 +223,7 @@ gui_window_calculate_pos_size (t_gui_window *window, int force_calculate)
}
else
{
- irc_nick_count (CHANNEL(window->buffer), &num_nicks, &num_op,
+ irc_nick_count (GUI_CHANNEL(window->buffer), &num_nicks, &num_op,
&num_halfop, &num_voice, &num_normal);
width_used = (window->win_width - add_left - add_right)
- ((window->win_width - add_left - add_right) % (max_length + 2));
@@ -394,7 +394,7 @@ gui_window_draw_separator (t_gui_window *window)
1,
window->win_y,
window->win_x - 1);
- gui_window_set_weechat_color (GUI_CURSES(window)->win_separator, COLOR_WIN_SEPARATOR);
+ gui_window_set_weechat_color (GUI_CURSES(window)->win_separator, GUI_COLOR_WIN_SEPARATOR);
wborder (GUI_CURSES(window)->win_separator, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
wnoutrefresh (GUI_CURSES(window)->win_separator);
refresh ();
@@ -484,7 +484,7 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
window->win_input_width,
window->win_input_y,
window->win_input_x);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (GUI_CURSES(window)->win_chat)
delwin (GUI_CURSES(window)->win_chat);
@@ -500,7 +500,7 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
else
GUI_CURSES(window)->win_nick = NULL;
}
- if (!(BUFFER_IS_CHANNEL(buffer)))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
if (GUI_CURSES(window)->win_chat)
delwin (GUI_CURSES(window)->win_chat);
@@ -759,7 +759,7 @@ gui_window_nick_beginning (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
if (window->win_nick_start > 0)
{
@@ -781,10 +781,10 @@ gui_window_nick_end (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
new_start =
- CHANNEL(window->buffer)->nicks_count - window->win_nick_num_max;
+ GUI_CHANNEL(window->buffer)->nicks_count - window->win_nick_num_max;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
@@ -808,7 +808,7 @@ gui_window_nick_page_up (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
if (window->win_nick_start > 0)
{
@@ -830,11 +830,11 @@ gui_window_nick_page_down (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
- if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_num_max)
+ if ((GUI_CHANNEL(window->buffer)->nicks_count > window->win_nick_num_max)
&& (window->win_nick_start + window->win_nick_num_max - 1
- < CHANNEL(window->buffer)->nicks_count))
+ < GUI_CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_num_max - 1);
diff --git a/src/gui/gtk/gui-gtk-color.c b/src/gui/gtk/gui-gtk-color.c
index 1c40f00e1..f7ff20ed2 100644
--- a/src/gui/gtk/gui-gtk-color.c
+++ b/src/gui/gtk/gui-gtk-color.c
@@ -479,63 +479,7 @@ gui_color_init_pairs ()
void
gui_color_init_weechat ()
{
- int i;
-
- gui_color[COLOR_WIN_SEPARATOR] = gui_color_build (COLOR_WIN_SEPARATOR, cfg_col_separator, cfg_col_separator);
- gui_color[COLOR_WIN_TITLE] = gui_color_build (COLOR_WIN_TITLE, cfg_col_title, cfg_col_title_bg);
- gui_color[COLOR_WIN_CHAT] = gui_color_build (COLOR_WIN_CHAT, cfg_col_chat, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_TIME] = gui_color_build (COLOR_WIN_CHAT_TIME, cfg_col_chat_time, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_TIME_SEP] = gui_color_build (COLOR_WIN_CHAT_TIME_SEP, cfg_col_chat_time_sep, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PREFIX1] = gui_color_build (COLOR_WIN_CHAT_PREFIX1, cfg_col_chat_prefix1, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PREFIX2] = gui_color_build (COLOR_WIN_CHAT_PREFIX2, cfg_col_chat_prefix2, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_SERVER] = gui_color_build (COLOR_WIN_CHAT_SERVER, cfg_col_chat_server, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_JOIN] = gui_color_build (COLOR_WIN_CHAT_JOIN, cfg_col_chat_join, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_PART] = gui_color_build (COLOR_WIN_CHAT_PART, cfg_col_chat_part, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_NICK] = gui_color_build (COLOR_WIN_CHAT_NICK, cfg_col_chat_nick, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_HOST] = gui_color_build (COLOR_WIN_CHAT_HOST, cfg_col_chat_host, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_CHANNEL] = gui_color_build (COLOR_WIN_CHAT_CHANNEL, cfg_col_chat_channel, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_DARK] = gui_color_build (COLOR_WIN_CHAT_DARK, cfg_col_chat_dark, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_HIGHLIGHT] = gui_color_build (COLOR_WIN_CHAT_HIGHLIGHT, cfg_col_chat_highlight, cfg_col_chat_bg);
- gui_color[COLOR_WIN_CHAT_READ_MARKER] = gui_color_build (COLOR_WIN_CHAT_READ_MARKER, cfg_col_chat_read_marker, cfg_col_chat_read_marker_bg);
- gui_color[COLOR_WIN_STATUS] = gui_color_build (COLOR_WIN_STATUS, cfg_col_status, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DELIMITERS] = gui_color_build (COLOR_WIN_STATUS_DELIMITERS, cfg_col_status_delimiters, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_CHANNEL] = gui_color_build (COLOR_WIN_STATUS_CHANNEL, cfg_col_status_channel, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_MSG] = gui_color_build (COLOR_WIN_STATUS_DATA_MSG, cfg_col_status_data_msg, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_PRIVATE] = gui_color_build (COLOR_WIN_STATUS_DATA_PRIVATE, cfg_col_status_data_private, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_HIGHLIGHT] = gui_color_build (COLOR_WIN_STATUS_DATA_HIGHLIGHT, cfg_col_status_data_highlight, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_DATA_OTHER] = gui_color_build (COLOR_WIN_STATUS_DATA_OTHER, cfg_col_status_data_other, cfg_col_status_bg);
- gui_color[COLOR_WIN_STATUS_MORE] = gui_color_build (COLOR_WIN_STATUS_MORE, cfg_col_status_more, cfg_col_status_bg);
- gui_color[COLOR_WIN_INFOBAR] = gui_color_build (COLOR_WIN_INFOBAR, cfg_col_infobar, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INFOBAR_DELIMITERS] = gui_color_build (COLOR_WIN_INFOBAR_DELIMITERS, cfg_col_infobar_delimiters, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INFOBAR_HIGHLIGHT] = gui_color_build (COLOR_WIN_INFOBAR_HIGHLIGHT, cfg_col_infobar_highlight, cfg_col_infobar_bg);
- gui_color[COLOR_WIN_INPUT] = gui_color_build (COLOR_WIN_INPUT, cfg_col_input, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_CHANNEL] = gui_color_build (COLOR_WIN_INPUT_CHANNEL, cfg_col_input_channel, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_NICK] = gui_color_build (COLOR_WIN_INPUT_NICK, cfg_col_input_nick, cfg_col_input_bg);
- gui_color[COLOR_WIN_INPUT_DELIMITERS] = gui_color_build (COLOR_WIN_INPUT_DELIMITERS, cfg_col_input_delimiters, cfg_col_input_bg);
- gui_color[COLOR_WIN_NICK] = gui_color_build (COLOR_WIN_NICK, cfg_col_nick, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_AWAY] = gui_color_build (COLOR_WIN_NICK_AWAY, cfg_col_nick_away, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_CHANOWNER] = gui_color_build (COLOR_WIN_NICK_CHANOWNER, cfg_col_nick_chanowner, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_CHANADMIN] = gui_color_build (COLOR_WIN_NICK_CHANADMIN, cfg_col_nick_chanadmin, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_OP] = gui_color_build (COLOR_WIN_NICK_OP, cfg_col_nick_op, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_HALFOP] = gui_color_build (COLOR_WIN_NICK_HALFOP, cfg_col_nick_halfop, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_VOICE] = gui_color_build (COLOR_WIN_NICK_VOICE, cfg_col_nick_voice, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_MORE] = gui_color_build (COLOR_WIN_NICK_MORE, cfg_col_nick_more, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_SEP] = gui_color_build (COLOR_WIN_NICK_SEP, cfg_col_nick_sep, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_SELF] = gui_color_build (COLOR_WIN_NICK_SELF, cfg_col_nick_self, cfg_col_nick_bg);
- gui_color[COLOR_WIN_NICK_PRIVATE] = gui_color_build (COLOR_WIN_NICK_PRIVATE, cfg_col_nick_private, cfg_col_nick_bg);
-
- for (i = 0; i < COLOR_WIN_NICK_NUMBER; i++)
- {
- gui_color[COLOR_WIN_NICK_1 + i] = gui_color_build (COLOR_WIN_NICK_1 + i, cfg_col_nick_colors[i], cfg_col_chat_bg);
- }
-
- gui_color[COLOR_DCC_SELECTED] = gui_color_build (COLOR_DCC_SELECTED, cfg_col_dcc_selected, cfg_col_chat_bg);
- gui_color[COLOR_DCC_WAITING] = gui_color_build (COLOR_DCC_WAITING, cfg_col_dcc_waiting, cfg_col_chat_bg);
- gui_color[COLOR_DCC_CONNECTING] = gui_color_build (COLOR_DCC_CONNECTING, cfg_col_dcc_connecting, cfg_col_chat_bg);
- gui_color[COLOR_DCC_ACTIVE] = gui_color_build (COLOR_DCC_ACTIVE, cfg_col_dcc_active, cfg_col_chat_bg);
- gui_color[COLOR_DCC_DONE] = gui_color_build (COLOR_DCC_DONE, cfg_col_dcc_done, cfg_col_chat_bg);
- gui_color[COLOR_DCC_FAILED] = gui_color_build (COLOR_DCC_FAILED, cfg_col_dcc_failed, cfg_col_chat_bg);
- gui_color[COLOR_DCC_ABORTED] = gui_color_build (COLOR_DCC_ABORTED, cfg_col_dcc_aborted, cfg_col_chat_bg);
+ /* TODO: write this function for Gtk */
}
/*
diff --git a/src/gui/gtk/gui-gtk-input.c b/src/gui/gtk/gui-gtk-input.c
index 67345ca1f..30c7c9318 100644
--- a/src/gui/gtk/gui-gtk-input.c
+++ b/src/gui/gtk/gui-gtk-input.c
@@ -71,20 +71,20 @@ gui_input_get_prompt_length (t_gui_window *window, char *nick)
switch (pos[0])
{
case 'c':
- if (CHANNEL(window->buffer))
- length += utf8_strlen (CHANNEL(window->buffer)->name);
+ if (GUI_CHANNEL(window->buffer))
+ length += utf8_strlen (GUI_CHANNEL(window->buffer)->name);
else
{
- if (SERVER(window->buffer))
- length += utf8_strlen (SERVER(window->buffer)->name);
+ if (GUI_SERVER(window->buffer))
+ length += utf8_strlen (GUI_SERVER(window->buffer)->name);
}
pos++;
break;
case 'm':
- if (SERVER(window->buffer))
+ if (GUI_SERVER(window->buffer))
{
mode_found = 0;
- for (modes = SERVER(window->buffer)->nick_modes;
+ for (modes = GUI_SERVER(window->buffer)->nick_modes;
modes && modes[0]; modes++)
{
if (modes[0] != ' ')
diff --git a/src/gui/gtk/gui-gtk-main.c b/src/gui/gtk/gui-gtk-main.c
index e27bbc1de..ed0d9cb63 100644
--- a/src/gui/gtk/gui-gtk-main.c
+++ b/src/gui/gtk/gui-gtk-main.c
@@ -41,17 +41,17 @@
#endif
-GtkWidget *gtk_main_window;
-GtkWidget *vbox1;
-GtkWidget *entry_topic;
-GtkWidget *notebook1;
-GtkWidget *vbox2;
-GtkWidget *hbox1;
-GtkWidget *hpaned1;
-GtkWidget *scrolledwindow_chat;
-GtkWidget *scrolledwindow_nick;
-GtkWidget *entry_input;
-GtkWidget *label1;
+GtkWidget *gui_gtk_main_window;
+GtkWidget *gui_gtk_vbox1;
+GtkWidget *gui_gtk_entry_topic;
+GtkWidget *gui_gtk_notebook1;
+GtkWidget *gui_gtk_vbox2;
+GtkWidget *gui_gtk_hbox1;
+GtkWidget *gui_gtk_hpaned1;
+GtkWidget *gui_gtk_scrolledwindow_chat;
+GtkWidget *gui_gtk_scrolledwindow_nick;
+GtkWidget *gui_gtk_entry_input;
+GtkWidget *gui_gtk_label1;
/*
@@ -99,67 +99,74 @@ gui_main_init ()
gdk_color_parse ("white", &color_fg);
gdk_color_parse ("black", &color_bg);
- gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title (GTK_WINDOW (gtk_main_window), PACKAGE_STRING);
+ gui_gtk_main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title (GTK_WINDOW (gui_gtk_main_window), PACKAGE_STRING);
- g_signal_connect (G_OBJECT (gtk_main_window), "destroy", gtk_main_quit, NULL);
+ g_signal_connect (G_OBJECT (gui_gtk_main_window), "destroy", gtk_main_quit, NULL);
- vbox1 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox1);
- gtk_container_add (GTK_CONTAINER (gtk_main_window), vbox1);
+ gui_gtk_vbox1 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (gui_gtk_vbox1);
+ gtk_container_add (GTK_CONTAINER (gui_gtk_main_window), gui_gtk_vbox1);
- entry_topic = gtk_entry_new ();
- gtk_widget_show (entry_topic);
- gtk_box_pack_start (GTK_BOX (vbox1), entry_topic, FALSE, FALSE, 0);
- gtk_widget_modify_text (entry_topic, GTK_STATE_NORMAL, &color_fg);
- gtk_widget_modify_base (entry_topic, GTK_STATE_NORMAL, &color_bg);
+ gui_gtk_entry_topic = gtk_entry_new ();
+ gtk_widget_show (gui_gtk_entry_topic);
+ gtk_box_pack_start (GTK_BOX (gui_gtk_vbox1), gui_gtk_entry_topic, FALSE, FALSE, 0);
+ gtk_widget_modify_text (gui_gtk_entry_topic, GTK_STATE_NORMAL, &color_fg);
+ gtk_widget_modify_base (gui_gtk_entry_topic, GTK_STATE_NORMAL, &color_bg);
- notebook1 = gtk_notebook_new ();
- gtk_widget_show (notebook1);
- gtk_box_pack_start (GTK_BOX (vbox1), notebook1, TRUE, TRUE, 0);
- gtk_notebook_set_tab_pos (GTK_NOTEBOOK (notebook1), GTK_POS_BOTTOM);
+ gui_gtk_notebook1 = gtk_notebook_new ();
+ gtk_widget_show (gui_gtk_notebook1);
+ gtk_box_pack_start (GTK_BOX (gui_gtk_vbox1), gui_gtk_notebook1, TRUE, TRUE, 0);
+ gtk_notebook_set_tab_pos (GTK_NOTEBOOK (gui_gtk_notebook1), GTK_POS_BOTTOM);
- vbox2 = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (vbox2);
- gtk_container_add (GTK_CONTAINER (notebook1), vbox2);
+ gui_gtk_vbox2 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (gui_gtk_vbox2);
+ gtk_container_add (GTK_CONTAINER (gui_gtk_notebook1), gui_gtk_vbox2);
- hbox1 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (hbox1);
- gtk_box_pack_start (GTK_BOX (vbox2), hbox1, TRUE, TRUE, 0);
+ gui_gtk_hbox1 = gtk_hbox_new (FALSE, 0);
+ gtk_widget_show (gui_gtk_hbox1);
+ gtk_box_pack_start (GTK_BOX (gui_gtk_vbox2), gui_gtk_hbox1, TRUE, TRUE, 0);
- hpaned1 = gtk_hpaned_new ();
- gtk_widget_show (hpaned1);
- gtk_box_pack_start (GTK_BOX (hbox1), hpaned1, TRUE, TRUE, 0);
- gtk_paned_set_position (GTK_PANED (hpaned1), 0);
+ gui_gtk_hpaned1 = gtk_hpaned_new ();
+ gtk_widget_show (gui_gtk_hpaned1);
+ gtk_box_pack_start (GTK_BOX (gui_gtk_hbox1), gui_gtk_hpaned1, TRUE, TRUE, 0);
+ gtk_paned_set_position (GTK_PANED (gui_gtk_hpaned1), 0);
- scrolledwindow_chat = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_show (scrolledwindow_chat);
- gtk_paned_pack1 (GTK_PANED (hpaned1), scrolledwindow_chat, FALSE, TRUE);
+ gui_gtk_scrolledwindow_chat = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (gui_gtk_scrolledwindow_chat);
+ gtk_paned_pack1 (GTK_PANED (gui_gtk_hpaned1), gui_gtk_scrolledwindow_chat,
+ FALSE, TRUE);
//gtk_box_pack_start (GTK_PANED (hpaned1), scrolledwindow_chat, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_chat), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- gtk_widget_modify_text (scrolledwindow_chat, GTK_STATE_NORMAL, &color_fg);
- gtk_widget_modify_base (scrolledwindow_chat, GTK_STATE_NORMAL, &color_bg);
-
- scrolledwindow_nick = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_show (scrolledwindow_nick);
- gtk_paned_pack2 (GTK_PANED (hpaned1), scrolledwindow_nick, FALSE, TRUE);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gui_gtk_scrolledwindow_chat),
+ GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_widget_modify_text (gui_gtk_scrolledwindow_chat, GTK_STATE_NORMAL, &color_fg);
+ gtk_widget_modify_base (gui_gtk_scrolledwindow_chat, GTK_STATE_NORMAL, &color_bg);
+
+ gui_gtk_scrolledwindow_nick = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_show (gui_gtk_scrolledwindow_nick);
+ gtk_paned_pack2 (GTK_PANED (gui_gtk_hpaned1), gui_gtk_scrolledwindow_nick,
+ FALSE, TRUE);
//gtk_box_pack_start (GTK_PANED (hpaned1), scrolledwindow_nick, TRUE, TRUE, 0);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow_nick), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
- gtk_widget_modify_text (scrolledwindow_nick, GTK_STATE_NORMAL, &color_fg);
- gtk_widget_modify_base (scrolledwindow_nick, GTK_STATE_NORMAL, &color_bg);
-
- entry_input = gtk_entry_new ();
- gtk_widget_show (entry_input);
- gtk_box_pack_start (GTK_BOX (vbox2), entry_input, FALSE, FALSE, 0);
- gtk_widget_modify_text (entry_input, GTK_STATE_NORMAL, &color_fg);
- gtk_widget_modify_base (entry_input, GTK_STATE_NORMAL, &color_bg);
-
- label1 = gtk_label_new (_("server"));
- gtk_widget_show (label1);
- gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label1);
- gtk_label_set_justify (GTK_LABEL (label1), GTK_JUSTIFY_LEFT);
-
- gtk_widget_show_all (gtk_main_window);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (gui_gtk_scrolledwindow_nick),
+ GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_widget_modify_text (gui_gtk_scrolledwindow_nick, GTK_STATE_NORMAL, &color_fg);
+ gtk_widget_modify_base (gui_gtk_scrolledwindow_nick, GTK_STATE_NORMAL, &color_bg);
+
+ gui_gtk_entry_input = gtk_entry_new ();
+ gtk_widget_show (gui_gtk_entry_input);
+ gtk_box_pack_start (GTK_BOX (gui_gtk_vbox2), gui_gtk_entry_input, FALSE,
+ FALSE, 0);
+ gtk_widget_modify_text (gui_gtk_entry_input, GTK_STATE_NORMAL, &color_fg);
+ gtk_widget_modify_base (gui_gtk_entry_input, GTK_STATE_NORMAL, &color_bg);
+
+ gui_gtk_label1 = gtk_label_new (_("server"));
+ gtk_widget_show (gui_gtk_label1);
+ gtk_notebook_set_tab_label (GTK_NOTEBOOK (gui_gtk_notebook1),
+ gtk_notebook_get_nth_page (GTK_NOTEBOOK (gui_gtk_notebook1), 0),
+ gui_gtk_label1);
+ gtk_label_set_justify (GTK_LABEL (gui_gtk_label1), GTK_JUSTIFY_LEFT);
+
+ gtk_widget_show_all (gui_gtk_main_window);
/* create new window/buffer */
if (gui_window_new (NULL, 0, 0, 0, 0, 100, 100))
diff --git a/src/gui/gtk/gui-gtk-nicklist.c b/src/gui/gtk/gui-gtk-nicklist.c
index f70620990..aaf93c2c2 100644
--- a/src/gui/gtk/gui-gtk-nicklist.c
+++ b/src/gui/gtk/gui-gtk-nicklist.c
@@ -42,7 +42,7 @@ gui_nicklist_draw (t_gui_buffer *buffer, int erase, int calculate_size)
char format[32], format_empty[32];
t_irc_nick *ptr_nick;*/
- if (!gui_ok || !BUFFER_HAS_NICKLIST(buffer))
+ if (!gui_ok || !GUI_BUFFER_HAS_NICKLIST(buffer))
return;
/* TODO: write this function for Gtk */
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index 43342599a..28f7ff03d 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -193,7 +193,7 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
{
GUI_GTK(window)->textview_chat = gtk_text_view_new ();
gtk_widget_show (GUI_GTK(window)->textview_chat);
- gtk_container_add (GTK_CONTAINER (scrolledwindow_chat), GUI_GTK(window)->textview_chat);
+ gtk_container_add (GTK_CONTAINER (gui_gtk_scrolledwindow_chat), GUI_GTK(window)->textview_chat);
gtk_widget_set_size_request (GUI_GTK(window)->textview_chat, 300, -1);
gtk_text_view_set_editable (GTK_TEXT_VIEW (GUI_GTK(window)->textview_chat), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (GUI_GTK(window)->textview_chat), FALSE);
@@ -205,11 +205,11 @@ gui_window_switch_to_buffer (t_gui_window *window, t_gui_buffer *buffer)
gtk_text_buffer_get_bounds (GUI_GTK(window)->textbuffer_chat, &start, &end);
gtk_text_buffer_apply_tag (GUI_GTK(window)->textbuffer_chat, GUI_GTK(window)->texttag_chat, &start, &end);
}
- if (BUFFER_IS_CHANNEL(buffer) && !GUI_GTK(window)->textbuffer_nicklist)
+ if (GUI_BUFFER_IS_CHANNEL(buffer) && !GUI_GTK(window)->textbuffer_nicklist)
{
GUI_GTK(window)->textview_nicklist = gtk_text_view_new ();
gtk_widget_show (GUI_GTK(window)->textview_nicklist);
- gtk_container_add (GTK_CONTAINER (scrolledwindow_nick), GUI_GTK(window)->textview_nicklist);
+ gtk_container_add (GTK_CONTAINER (gui_gtk_scrolledwindow_nick), GUI_GTK(window)->textview_nicklist);
gtk_text_view_set_editable (GTK_TEXT_VIEW (GUI_GTK(window)->textview_nicklist), FALSE);
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (GUI_GTK(window)->textview_nicklist), FALSE);
@@ -421,7 +421,7 @@ gui_window_nick_beginning (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
if (window->win_nick_start > 0)
{
@@ -443,10 +443,10 @@ gui_window_nick_end (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
new_start =
- CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
+ GUI_CHANNEL(window->buffer)->nicks_count - window->win_nick_height;
if (new_start < 0)
new_start = 0;
else if (new_start >= 1)
@@ -470,7 +470,7 @@ gui_window_nick_page_up (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
if (window->win_nick_start > 0)
{
@@ -492,11 +492,11 @@ gui_window_nick_page_down (t_gui_window *window)
if (!gui_ok)
return;
- if (BUFFER_HAS_NICKLIST(window->buffer))
+ if (GUI_BUFFER_HAS_NICKLIST(window->buffer))
{
- if ((CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
+ if ((GUI_CHANNEL(window->buffer)->nicks_count > window->win_nick_height)
&& (window->win_nick_start + window->win_nick_height - 1
- < CHANNEL(window->buffer)->nicks_count))
+ < GUI_CHANNEL(window->buffer)->nicks_count))
{
if (window->win_nick_start == 0)
window->win_nick_start += (window->win_nick_height - 1);
diff --git a/src/gui/gtk/gui-gtk.h b/src/gui/gtk/gui-gtk.h
index 0aa008e01..cd04a0c9d 100644
--- a/src/gui/gtk/gui-gtk.h
+++ b/src/gui/gtk/gui-gtk.h
@@ -75,17 +75,17 @@ struct t_gui_gtk_objects
extern t_gui_color gui_weechat_colors[];
extern int gui_irc_colors[GUI_NUM_IRC_COLORS][2];
-extern GtkWidget *gtk_main_window;
-extern GtkWidget *vbox1;
-extern GtkWidget *entry_topic;
-extern GtkWidget *notebook1;
-extern GtkWidget *vbox2;
-extern GtkWidget *hbox1;
-extern GtkWidget *hpaned1;
-extern GtkWidget *scrolledwindow_chat;
-extern GtkWidget *scrolledwindow_nick;
-extern GtkWidget *entry_input;
-extern GtkWidget *label1;
+extern GtkWidget *gui_gtk_main_window;
+extern GtkWidget *gui_gtk_vbox1;
+extern GtkWidget *gui_gtk_entry_topic;
+extern GtkWidget *gui_gtk_notebook1;
+extern GtkWidget *gui_gtk_vbox2;
+extern GtkWidget *gui_gtk_hbox1;
+extern GtkWidget *gui_gtk_hpaned1;
+extern GtkWidget *gui_gtk_scrolledwindow_chat;
+extern GtkWidget *gui_gtk_scrolledwindow_nick;
+extern GtkWidget *gui_gtk_entry_input;
+extern GtkWidget *gui_gtk_label1;
/* color functions */
extern int gui_color_get_pair (int);
diff --git a/src/gui/gui-action.c b/src/gui/gui-action.c
index 69be9c6ac..e91ab362a 100644
--- a/src/gui/gui-action.c
+++ b/src/gui/gui-action.c
@@ -97,7 +97,7 @@ gui_action_return (t_gui_window *window, char *args)
if (window->buffer->has_input)
{
- if (window->buffer->text_search != TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED)
gui_buffer_search_stop (window);
else if (window->buffer->input_buffer_size > 0)
{
@@ -118,7 +118,7 @@ gui_action_return (t_gui_window *window, char *args)
window->buffer->ptr_history = NULL;
gui_input_optimize_size (window->buffer);
gui_input_draw (window->buffer, 0);
- user_command (SERVER(window->buffer), CHANNEL(window->buffer),
+ user_command (GUI_SERVER(window->buffer), GUI_CHANNEL(window->buffer),
command, 0);
free (command);
}
@@ -136,7 +136,7 @@ gui_action_tab (t_gui_window *window, char *args)
(void) args;
if (window->buffer->has_input
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
completion_search (&(window->buffer->completion), 1,
window->buffer->input_buffer,
@@ -158,7 +158,7 @@ gui_action_tab_previous (t_gui_window *window, char *args)
(void) args;
if (window->buffer->has_input
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
completion_search (&(window->buffer->completion), -1,
window->buffer->input_buffer,
@@ -669,9 +669,9 @@ gui_action_up (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->type == BUFFER_TYPE_DCC)
+ if (window->buffer->type == GUI_BUFFER_TYPE_DCC)
{
- if (dcc_list)
+ if (irc_dcc_list)
{
if (window->dcc_selected
&& ((t_irc_dcc *)(window->dcc_selected))->prev_dcc)
@@ -689,7 +689,7 @@ gui_action_up (t_gui_window *window, char *args)
}
else if (window->buffer->has_input)
{
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (window->buffer->ptr_history)
{
@@ -743,7 +743,7 @@ gui_action_up (t_gui_window *window, char *args)
else
{
/* search backward in buffer history */
- window->buffer->text_search = TEXT_SEARCH_BACKWARD;
+ window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD;
(void) gui_buffer_search_text (window);
}
}
@@ -760,7 +760,7 @@ gui_action_up_global (t_gui_window *window, char *args)
(void) args;
if (window->buffer->has_input
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
if (history_global_ptr)
{
@@ -798,9 +798,9 @@ gui_action_down (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->type == BUFFER_TYPE_DCC)
+ if (window->buffer->type == GUI_BUFFER_TYPE_DCC)
{
- if (dcc_list)
+ if (irc_dcc_list)
{
if (!window->dcc_selected
|| ((t_irc_dcc *)(window->dcc_selected))->next_dcc)
@@ -814,14 +814,14 @@ gui_action_down (t_gui_window *window, char *args)
((t_irc_dcc *)(window->dcc_first))->next_dcc;
else
window->dcc_first =
- dcc_list->next_dcc;
+ irc_dcc_list->next_dcc;
}
if (window->dcc_selected)
window->dcc_selected =
((t_irc_dcc *)(window->dcc_selected))->next_dcc;
else
window->dcc_selected =
- dcc_list->next_dcc;
+ irc_dcc_list->next_dcc;
gui_chat_draw (window->buffer, 1);
gui_input_draw (window->buffer, 1);
}
@@ -829,7 +829,7 @@ gui_action_down (t_gui_window *window, char *args)
}
else if (window->buffer->has_input)
{
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (window->buffer->ptr_history)
{
@@ -880,7 +880,7 @@ gui_action_down (t_gui_window *window, char *args)
else
{
/* search forward in buffer history */
- window->buffer->text_search = TEXT_SEARCH_FORWARD;
+ window->buffer->text_search = GUI_TEXT_SEARCH_FORWARD;
(void) gui_buffer_search_text (window);
}
}
@@ -897,7 +897,7 @@ gui_action_down_global (t_gui_window *window, char *args)
(void) args;
if (window->buffer->has_input
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
if (history_global_ptr)
{
@@ -1095,7 +1095,7 @@ gui_action_jump_smart (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (weechat_hotlist)
{
@@ -1126,9 +1126,9 @@ gui_action_jump_dcc (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
- if (window->buffer->type == BUFFER_TYPE_DCC)
+ if (window->buffer->type == GUI_BUFFER_TYPE_DCC)
{
if (gui_buffer_before_dcc)
{
@@ -1155,9 +1155,9 @@ gui_action_jump_raw_data (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
- if (window->buffer->type == BUFFER_TYPE_RAW_DATA)
+ if (window->buffer->type == GUI_BUFFER_TYPE_RAW_DATA)
{
if (gui_buffer_before_raw_data)
{
@@ -1184,7 +1184,7 @@ gui_action_jump_last_buffer (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (last_gui_buffer)
gui_buffer_switch_by_number (window, last_gui_buffer->number);
@@ -1202,7 +1202,7 @@ gui_action_jump_previous_buffer (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (gui_previous_buffer)
gui_buffer_switch_by_number (window, gui_previous_buffer->number);
@@ -1219,15 +1219,15 @@ gui_action_jump_server (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
- if (SERVER(window->buffer))
+ if (GUI_SERVER(window->buffer))
{
- if (SERVER(window->buffer)->buffer !=
+ if (GUI_SERVER(window->buffer)->buffer !=
window->buffer)
{
gui_window_switch_to_buffer (window,
- SERVER(window->buffer)->buffer);
+ GUI_SERVER(window->buffer)->buffer);
gui_window_redraw_buffer (window->buffer);
}
}
@@ -1247,24 +1247,24 @@ gui_action_jump_next_server (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
- if (SERVER(window->buffer))
+ if (GUI_SERVER(window->buffer))
{
- ptr_server = SERVER(window->buffer)->next_server;
+ ptr_server = GUI_SERVER(window->buffer)->next_server;
if (!ptr_server)
ptr_server = irc_servers;
- while (ptr_server != SERVER(window->buffer))
+ while (ptr_server != GUI_SERVER(window->buffer))
{
if (ptr_server->buffer)
break;
ptr_server = (ptr_server->next_server) ?
ptr_server->next_server : irc_servers;
}
- if (ptr_server != SERVER(window->buffer))
+ if (ptr_server != GUI_SERVER(window->buffer))
{
/* save current buffer */
- SERVER(window->buffer)->saved_buffer = window->buffer;
+ GUI_SERVER(window->buffer)->saved_buffer = window->buffer;
/* come back to memorized chan if found */
if (ptr_server->saved_buffer)
@@ -1308,8 +1308,8 @@ gui_action_scroll_previous_highlight (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if ((window->buffer->type == BUFFER_TYPE_STANDARD)
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ if ((window->buffer->type == GUI_BUFFER_TYPE_STANDARD)
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
if (window->buffer->lines)
{
@@ -1345,8 +1345,8 @@ gui_action_scroll_next_highlight (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if ((window->buffer->type == BUFFER_TYPE_STANDARD)
- && (window->buffer->text_search == TEXT_SEARCH_DISABLED))
+ if ((window->buffer->type == GUI_BUFFER_TYPE_STANDARD)
+ && (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED))
{
if (window->buffer->lines)
{
@@ -1380,11 +1380,11 @@ gui_action_scroll_unread (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
if (cfg_look_read_marker &&
cfg_look_read_marker[0] &&
- (window->buffer->type == BUFFER_TYPE_STANDARD) &&
+ (window->buffer->type == GUI_BUFFER_TYPE_STANDARD) &&
window->buffer->last_read_line &&
window->buffer->last_read_line != window->buffer->last_line)
{
@@ -1415,7 +1415,7 @@ gui_action_set_unread (t_gui_window *window, char *args)
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
- if (ptr_buffer->type == BUFFER_TYPE_STANDARD)
+ if (ptr_buffer->type == GUI_BUFFER_TYPE_STANDARD)
ptr_buffer->last_read_line = ptr_buffer->last_line;
}
@@ -1513,10 +1513,10 @@ gui_action_search_text (t_gui_window *window, char *args)
/* make C compiler happy */
(void) args;
- if (window->buffer->type == BUFFER_TYPE_STANDARD)
+ if (window->buffer->type == GUI_BUFFER_TYPE_STANDARD)
{
/* toggle search */
- if (window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
gui_buffer_search_start (window);
else
{
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index ecd372d9e..04e16ad18 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -95,8 +95,8 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
#endif
/* use first buffer if no server is assigned to this buffer */
- if ((type == BUFFER_TYPE_STANDARD) && gui_buffers
- && (!SERVER(gui_buffers)) && (!channel))
+ if ((type == GUI_BUFFER_TYPE_STANDARD) && gui_buffers
+ && (!GUI_SERVER(gui_buffers)) && (!channel))
{
if (server)
((t_irc_server *)(server))->buffer = gui_buffers;
@@ -113,7 +113,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
}
/* use "all servers" buffer if found */
- if (cfg_look_one_server_buffer && (type == BUFFER_TYPE_STANDARD) &&
+ if (cfg_look_one_server_buffer && (type == GUI_BUFFER_TYPE_STANDARD) &&
gui_buffers && server && !channel)
{
ptr_buffer = gui_buffer_servers_search ();
@@ -138,18 +138,18 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
new_buffer->all_servers = 0;
new_buffer->channel = channel;
new_buffer->type = type;
- if (new_buffer->type == BUFFER_TYPE_RAW_DATA)
+ if (new_buffer->type == GUI_BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = new_buffer;
/* assign buffer to server and channel */
if (server && !channel)
{
- SERVER(new_buffer)->buffer = new_buffer;
+ GUI_SERVER(new_buffer)->buffer = new_buffer;
new_buffer->all_servers = (cfg_look_one_server_buffer) ? 1 : 0;
}
if (!gui_buffers && cfg_look_one_server_buffer)
new_buffer->all_servers = 1;
if (channel)
- CHANNEL(new_buffer)->buffer = new_buffer;
+ GUI_CHANNEL(new_buffer)->buffer = new_buffer;
if (!window->buffer)
{
@@ -173,18 +173,18 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
/* create/append to log file */
new_buffer->log_filename = NULL;
new_buffer->log_file = NULL;
- if ((cfg_log_auto_server && BUFFER_IS_SERVER(new_buffer))
- || (cfg_log_auto_channel && BUFFER_IS_CHANNEL(new_buffer))
- || (cfg_log_auto_private && BUFFER_IS_PRIVATE(new_buffer)))
+ if ((cfg_log_auto_server && GUI_BUFFER_IS_SERVER(new_buffer))
+ || (cfg_log_auto_channel && GUI_BUFFER_IS_CHANNEL(new_buffer))
+ || (cfg_log_auto_private && GUI_BUFFER_IS_PRIVATE(new_buffer)))
gui_log_start (new_buffer);
/* init input buffer */
- new_buffer->has_input = (new_buffer->type == BUFFER_TYPE_STANDARD) ? 1 : 0;
+ new_buffer->has_input = (new_buffer->type == GUI_BUFFER_TYPE_STANDARD) ? 1 : 0;
if (new_buffer->has_input)
{
- new_buffer->input_buffer_alloc = INPUT_BUFFER_BLOCK_SIZE;
- new_buffer->input_buffer = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
- new_buffer->input_buffer_color_mask = (char *) malloc (INPUT_BUFFER_BLOCK_SIZE);
+ new_buffer->input_buffer_alloc = GUI_INPUT_BUFFER_BLOCK_SIZE;
+ new_buffer->input_buffer = (char *) malloc (GUI_INPUT_BUFFER_BLOCK_SIZE);
+ new_buffer->input_buffer_color_mask = (char *) malloc (GUI_INPUT_BUFFER_BLOCK_SIZE);
new_buffer->input_buffer[0] = '\0';
new_buffer->input_buffer_color_mask[0] = '\0';
}
@@ -208,7 +208,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
new_buffer->num_history = 0;
/* text search */
- new_buffer->text_search = TEXT_SEARCH_DISABLED;
+ new_buffer->text_search = GUI_TEXT_SEARCH_DISABLED;
new_buffer->text_search_exact = 0;
new_buffer->text_search_found = 0;
new_buffer->text_search_input = NULL;
@@ -225,7 +225,7 @@ gui_buffer_new (t_gui_window *window, void *server, void *channel, int type,
/* move buffer next to server */
if (server && cfg_look_open_near_server && (!cfg_look_one_server_buffer))
{
- ptr_buffer = SERVER(new_buffer)->buffer;
+ ptr_buffer = GUI_SERVER(new_buffer)->buffer;
while (ptr_buffer && (ptr_buffer->server == server))
{
ptr_buffer = ptr_buffer->next_buffer;
@@ -321,7 +321,7 @@ gui_buffer_search (char *server, char *channel)
if (!ptr_buffer)
return NULL;
- return (ptr_buffer->type != BUFFER_TYPE_STANDARD) ?
+ return (ptr_buffer->type != GUI_BUFFER_TYPE_STANDARD) ?
gui_buffers : ptr_buffer;
}
@@ -463,13 +463,13 @@ gui_buffer_get_dcc (t_gui_window *window)
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
- if (ptr_buffer->type == BUFFER_TYPE_DCC)
+ if (ptr_buffer->type == GUI_BUFFER_TYPE_DCC)
break;
}
if (ptr_buffer)
return ptr_buffer;
else
- return gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_DCC, 0);
+ return gui_buffer_new (window, NULL, NULL, GUI_BUFFER_TYPE_DCC, 0);
}
/*
@@ -485,7 +485,7 @@ gui_buffer_clear (t_gui_buffer *buffer)
if (!buffer)
return;
- if (buffer->type == BUFFER_TYPE_DCC)
+ if (buffer->type == GUI_BUFFER_TYPE_DCC)
return;
/* remove buffer from hotlist */
@@ -607,7 +607,7 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
if (gui_buffer_before_raw_data == buffer)
gui_buffer_before_raw_data = NULL;
- if (buffer->type == BUFFER_TYPE_RAW_DATA)
+ if (buffer->type == GUI_BUFFER_TYPE_RAW_DATA)
gui_buffer_raw_data = NULL;
for (ptr_server = irc_servers; ptr_server;
@@ -668,7 +668,7 @@ gui_buffer_free (t_gui_buffer *buffer, int switch_to_another)
/* always at least one buffer */
if (!gui_buffers && create_new && switch_to_another)
(void) gui_buffer_new (gui_windows, NULL, NULL,
- BUFFER_TYPE_STANDARD, 1);
+ GUI_BUFFER_TYPE_STANDARD, 1);
if (gui_windows && gui_current_window && gui_current_window->buffer)
gui_status_draw (gui_current_window->buffer, 1);
@@ -766,7 +766,7 @@ gui_buffer_merge_servers (t_gui_window *window)
for (ptr_buffer_server = gui_buffers; ptr_buffer_server;
ptr_buffer_server = ptr_buffer_server->next_buffer)
{
- if (BUFFER_IS_SERVER(ptr_buffer_server))
+ if (GUI_BUFFER_IS_SERVER(ptr_buffer_server))
break;
}
@@ -778,9 +778,9 @@ gui_buffer_merge_servers (t_gui_window *window)
while (ptr_buffer)
{
if ((ptr_buffer != ptr_buffer_server)
- && (BUFFER_IS_SERVER(ptr_buffer)))
+ && (GUI_BUFFER_IS_SERVER(ptr_buffer)))
{
- ptr_server = SERVER(ptr_buffer);
+ ptr_server = GUI_SERVER(ptr_buffer);
/* add (by pointer artefact) lines from buffer found to server buffer */
if (ptr_buffer->lines)
@@ -833,18 +833,18 @@ gui_buffer_split_server (t_gui_window *window)
if (ptr_buffer)
{
- if (SERVER(ptr_buffer))
+ if (GUI_SERVER(ptr_buffer))
{
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->buffer
- && (ptr_server != SERVER(ptr_buffer))
+ && (ptr_server != GUI_SERVER(ptr_buffer))
&& (ptr_server->buffer == ptr_buffer))
{
ptr_server->buffer = NULL;
gui_buffer_new (window, ptr_server, NULL,
- BUFFER_TYPE_STANDARD, 0);
+ GUI_BUFFER_TYPE_STANDARD, 0);
}
}
}
@@ -910,7 +910,7 @@ gui_buffer_switch_dcc (t_gui_window *window)
/* check if dcc buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
- if (ptr_buffer->type == BUFFER_TYPE_DCC)
+ if (ptr_buffer->type == GUI_BUFFER_TYPE_DCC)
break;
}
if (ptr_buffer)
@@ -919,7 +919,7 @@ gui_buffer_switch_dcc (t_gui_window *window)
gui_window_redraw_buffer (ptr_buffer);
}
else
- gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_DCC, 1);
+ gui_buffer_new (window, NULL, NULL, GUI_BUFFER_TYPE_DCC, 1);
}
/*
@@ -934,7 +934,7 @@ gui_buffer_switch_raw_data (t_gui_window *window)
/* check if raw IRC data buffer exists */
for (ptr_buffer = gui_buffers; ptr_buffer; ptr_buffer = ptr_buffer->next_buffer)
{
- if (ptr_buffer->type == BUFFER_TYPE_RAW_DATA)
+ if (ptr_buffer->type == GUI_BUFFER_TYPE_RAW_DATA)
break;
}
if (ptr_buffer)
@@ -943,7 +943,7 @@ gui_buffer_switch_raw_data (t_gui_window *window)
gui_window_redraw_buffer (ptr_buffer);
}
else
- gui_buffer_new (window, NULL, NULL, BUFFER_TYPE_RAW_DATA, 1);
+ gui_buffer_new (window, NULL, NULL, GUI_BUFFER_TYPE_RAW_DATA, 1);
}
/*
@@ -1090,7 +1090,7 @@ gui_buffer_search_text (t_gui_window *window)
{
t_gui_line *ptr_line;
- if (window->buffer->text_search == TEXT_SEARCH_BACKWARD)
+ if (window->buffer->text_search == GUI_TEXT_SEARCH_BACKWARD)
{
if (window->buffer->lines
&& window->buffer->input_buffer && window->buffer->input_buffer[0])
@@ -1114,7 +1114,7 @@ gui_buffer_search_text (t_gui_window *window)
}
}
}
- else if (window->buffer->text_search == TEXT_SEARCH_FORWARD)
+ else if (window->buffer->text_search == GUI_TEXT_SEARCH_FORWARD)
{
if (window->buffer->lines
&& window->buffer->input_buffer && window->buffer->input_buffer[0])
@@ -1148,7 +1148,7 @@ gui_buffer_search_text (t_gui_window *window)
void
gui_buffer_search_start (t_gui_window *window)
{
- window->buffer->text_search = TEXT_SEARCH_BACKWARD;
+ window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD;
window->buffer->text_search_exact = 0;
window->buffer->text_search_found = 0;
if (window->buffer->text_search_input)
@@ -1174,7 +1174,7 @@ gui_buffer_search_restart (t_gui_window *window)
{
window->start_line = NULL;
window->start_line_pos = 0;
- window->buffer->text_search = TEXT_SEARCH_BACKWARD;
+ window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD;
window->buffer->text_search_found = 0;
if (gui_buffer_search_text (window))
window->buffer->text_search_found = 1;
@@ -1192,7 +1192,7 @@ gui_buffer_search_restart (t_gui_window *window)
void
gui_buffer_search_stop (t_gui_window *window)
{
- window->buffer->text_search = TEXT_SEARCH_DISABLED;
+ window->buffer->text_search = GUI_TEXT_SEARCH_DISABLED;
window->buffer->text_search = 0;
gui_action_delete_line (window, NULL);
if (window->buffer->text_search_input)
diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h
index 98c0a9877..f1db925f0 100644
--- a/src/gui/gui-buffer.h
+++ b/src/gui/gui-buffer.h
@@ -23,36 +23,49 @@
#include "../common/completion.h"
#include "../common/history.h"
-#define BUFFER_TYPE_STANDARD 0
-#define BUFFER_TYPE_DCC 1
-#define BUFFER_TYPE_RAW_DATA 2
-
-#define SERVER(buffer) ((t_irc_server *)(buffer->server))
-#define CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
-
-#define BUFFER_IS_SERVER(buffer) ((SERVER(buffer) || (buffer->all_servers)) && !CHANNEL(buffer))
-#define BUFFER_IS_CHANNEL(buffer) (CHANNEL(buffer) && (CHANNEL(buffer)->type == CHANNEL_TYPE_CHANNEL))
-#define BUFFER_IS_PRIVATE(buffer) (CHANNEL(buffer) && \
- ((CHANNEL(buffer)->type == CHANNEL_TYPE_PRIVATE) \
- || (CHANNEL(buffer)->type == CHANNEL_TYPE_DCC_CHAT)))
-
-#define BUFFER_HAS_NICKLIST(buffer) (BUFFER_IS_CHANNEL(buffer))
-
-#define MSG_TYPE_TIME 1
-#define MSG_TYPE_PREFIX 2
-#define MSG_TYPE_NICK 4
-#define MSG_TYPE_INFO 8
-#define MSG_TYPE_MSG 16
-#define MSG_TYPE_HIGHLIGHT 32
-#define MSG_TYPE_NOLOG 64
-
-#define NOTIFY_LEVEL_MIN 0
-#define NOTIFY_LEVEL_MAX 3
-#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
-
-#define TEXT_SEARCH_DISABLED 0
-#define TEXT_SEARCH_BACKWARD 1
-#define TEXT_SEARCH_FORWARD 2
+#define GUI_BUFFER_TYPE_STANDARD 0
+#define GUI_BUFFER_TYPE_DCC 1
+#define GUI_BUFFER_TYPE_RAW_DATA 2
+
+#define GUI_SERVER(buffer) ((t_irc_server *)(buffer->server))
+#define GUI_CHANNEL(buffer) ((t_irc_channel *)(buffer->channel))
+
+#define GUI_BUFFER_IS_SERVER(buffer) ((GUI_SERVER(buffer) || (buffer->all_servers)) && !GUI_CHANNEL(buffer))
+#define GUI_BUFFER_IS_CHANNEL(buffer) (GUI_CHANNEL(buffer) && (GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_CHANNEL))
+#define GUI_BUFFER_IS_PRIVATE(buffer) (GUI_CHANNEL(buffer) && \
+ ((GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_PRIVATE) \
+ || (GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT)))
+
+#define GUI_BUFFER_HAS_NICKLIST(buffer) (GUI_BUFFER_IS_CHANNEL(buffer))
+
+#define GUI_MSG_TYPE_TIME 1
+#define GUI_MSG_TYPE_PREFIX 2
+#define GUI_MSG_TYPE_NICK 4
+#define GUI_MSG_TYPE_INFO 8
+#define GUI_MSG_TYPE_MSG 16
+#define GUI_MSG_TYPE_HIGHLIGHT 32
+#define GUI_MSG_TYPE_NOLOG 64
+
+#define GUI_PREFIX_SERVER "-@-"
+#define GUI_PREFIX_INFO "-=-"
+#define GUI_PREFIX_ACTION_ME "-*-"
+#define GUI_PREFIX_JOIN "-->"
+#define GUI_PREFIX_PART "<--"
+#define GUI_PREFIX_QUIT "<--"
+#define GUI_PREFIX_ERROR "=!="
+#define GUI_PREFIX_PLUGIN "-P-"
+#define GUI_PREFIX_RECV_MOD "==>"
+#define GUI_PREFIX_SEND_MOD "<=="
+
+#define GUI_NOTIFY_LEVEL_MIN 0
+#define GUI_NOTIFY_LEVEL_MAX 3
+#define GUI_NOTIFY_LEVEL_DEFAULT GUI_NOTIFY_LEVEL_MAX
+
+#define GUI_TEXT_SEARCH_DISABLED 0
+#define GUI_TEXT_SEARCH_BACKWARD 1
+#define GUI_TEXT_SEARCH_FORWARD 2
+
+#define GUI_INPUT_BUFFER_BLOCK_SIZE 256
/* buffer structures */
diff --git a/src/gui/gui-color.h b/src/gui/gui-color.h
index ba2f73a0a..ef2aa9d3d 100644
--- a/src/gui/gui-color.h
+++ b/src/gui/gui-color.h
@@ -20,77 +20,75 @@
#ifndef __WEECHAT_GUI_COLOR_H
#define __WEECHAT_GUI_COLOR_H 1
-#define INPUT_BUFFER_BLOCK_SIZE 256
-
-#define COLOR_WIN_NICK_NUMBER 10
+#define GUI_COLOR_WIN_NICK_NUMBER 10
typedef enum t_weechat_color t_weechat_color;
enum t_weechat_color
{
- COLOR_WIN_SEPARATOR = 0,
- COLOR_WIN_TITLE,
- COLOR_WIN_CHAT,
- COLOR_WIN_CHAT_TIME,
- COLOR_WIN_CHAT_TIME_SEP,
- COLOR_WIN_CHAT_PREFIX1,
- COLOR_WIN_CHAT_PREFIX2,
- COLOR_WIN_CHAT_SERVER,
- COLOR_WIN_CHAT_JOIN,
- COLOR_WIN_CHAT_PART,
- COLOR_WIN_CHAT_NICK,
- COLOR_WIN_CHAT_HOST,
- COLOR_WIN_CHAT_CHANNEL,
- COLOR_WIN_CHAT_DARK,
- COLOR_WIN_CHAT_HIGHLIGHT,
- COLOR_WIN_CHAT_READ_MARKER,
- COLOR_WIN_STATUS,
- COLOR_WIN_STATUS_DELIMITERS,
- COLOR_WIN_STATUS_CHANNEL,
- COLOR_WIN_STATUS_DATA_MSG,
- COLOR_WIN_STATUS_DATA_PRIVATE,
- COLOR_WIN_STATUS_DATA_HIGHLIGHT,
- COLOR_WIN_STATUS_DATA_OTHER,
- COLOR_WIN_STATUS_MORE,
- COLOR_WIN_INFOBAR,
- COLOR_WIN_INFOBAR_DELIMITERS,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
- COLOR_WIN_INPUT,
- COLOR_WIN_INPUT_CHANNEL,
- COLOR_WIN_INPUT_NICK,
- COLOR_WIN_INPUT_DELIMITERS,
- COLOR_WIN_NICK,
- COLOR_WIN_NICK_AWAY,
- COLOR_WIN_NICK_CHANOWNER,
- COLOR_WIN_NICK_CHANADMIN,
- COLOR_WIN_NICK_OP,
- COLOR_WIN_NICK_HALFOP,
- COLOR_WIN_NICK_VOICE,
- COLOR_WIN_NICK_MORE,
- COLOR_WIN_NICK_SEP,
- COLOR_WIN_NICK_SELF,
- COLOR_WIN_NICK_PRIVATE,
- COLOR_WIN_NICK_1,
- COLOR_WIN_NICK_2,
- COLOR_WIN_NICK_3,
- COLOR_WIN_NICK_4,
- COLOR_WIN_NICK_5,
- COLOR_WIN_NICK_6,
- COLOR_WIN_NICK_7,
- COLOR_WIN_NICK_8,
- COLOR_WIN_NICK_9,
- COLOR_WIN_NICK_10,
- COLOR_DCC_SELECTED,
- COLOR_DCC_WAITING,
- COLOR_DCC_CONNECTING,
- COLOR_DCC_ACTIVE,
- COLOR_DCC_DONE,
- COLOR_DCC_FAILED,
- COLOR_DCC_ABORTED,
- COLOR_WIN_INPUT_SERVER,
- COLOR_WIN_TITLE_MORE,
- COLOR_WIN_INPUT_TEXT_NOT_FOUND,
- COLOR_WIN_NICK_CHANUSER,
+ GUI_COLOR_WIN_SEPARATOR = 0,
+ GUI_COLOR_WIN_TITLE,
+ GUI_COLOR_WIN_CHAT,
+ GUI_COLOR_WIN_CHAT_TIME,
+ GUI_COLOR_WIN_CHAT_TIME_SEP,
+ GUI_COLOR_WIN_CHAT_PREFIX1,
+ GUI_COLOR_WIN_CHAT_PREFIX2,
+ GUI_COLOR_WIN_CHAT_SERVER,
+ GUI_COLOR_WIN_CHAT_JOIN,
+ GUI_COLOR_WIN_CHAT_PART,
+ GUI_COLOR_WIN_CHAT_NICK,
+ GUI_COLOR_WIN_CHAT_HOST,
+ GUI_COLOR_WIN_CHAT_CHANNEL,
+ GUI_COLOR_WIN_CHAT_DARK,
+ GUI_COLOR_WIN_CHAT_HIGHLIGHT,
+ GUI_COLOR_WIN_CHAT_READ_MARKER,
+ GUI_COLOR_WIN_STATUS,
+ GUI_COLOR_WIN_STATUS_DELIMITERS,
+ GUI_COLOR_WIN_STATUS_CHANNEL,
+ GUI_COLOR_WIN_STATUS_DATA_MSG,
+ GUI_COLOR_WIN_STATUS_DATA_PRIVATE,
+ GUI_COLOR_WIN_STATUS_DATA_HIGHLIGHT,
+ GUI_COLOR_WIN_STATUS_DATA_OTHER,
+ GUI_COLOR_WIN_STATUS_MORE,
+ GUI_COLOR_WIN_INFOBAR,
+ GUI_COLOR_WIN_INFOBAR_DELIMITERS,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INPUT,
+ GUI_COLOR_WIN_INPUT_CHANNEL,
+ GUI_COLOR_WIN_INPUT_NICK,
+ GUI_COLOR_WIN_INPUT_DELIMITERS,
+ GUI_COLOR_WIN_NICK,
+ GUI_COLOR_WIN_NICK_AWAY,
+ GUI_COLOR_WIN_NICK_CHANOWNER,
+ GUI_COLOR_WIN_NICK_CHANADMIN,
+ GUI_COLOR_WIN_NICK_OP,
+ GUI_COLOR_WIN_NICK_HALFOP,
+ GUI_COLOR_WIN_NICK_VOICE,
+ GUI_COLOR_WIN_NICK_MORE,
+ GUI_COLOR_WIN_NICK_SEP,
+ GUI_COLOR_WIN_NICK_SELF,
+ GUI_COLOR_WIN_NICK_PRIVATE,
+ GUI_COLOR_WIN_NICK_1,
+ GUI_COLOR_WIN_NICK_2,
+ GUI_COLOR_WIN_NICK_3,
+ GUI_COLOR_WIN_NICK_4,
+ GUI_COLOR_WIN_NICK_5,
+ GUI_COLOR_WIN_NICK_6,
+ GUI_COLOR_WIN_NICK_7,
+ GUI_COLOR_WIN_NICK_8,
+ GUI_COLOR_WIN_NICK_9,
+ GUI_COLOR_WIN_NICK_10,
+ GUI_COLOR_DCC_SELECTED,
+ GUI_COLOR_DCC_WAITING,
+ GUI_COLOR_DCC_CONNECTING,
+ GUI_COLOR_DCC_ACTIVE,
+ GUI_COLOR_DCC_DONE,
+ GUI_COLOR_DCC_FAILED,
+ GUI_COLOR_DCC_ABORTED,
+ GUI_COLOR_WIN_INPUT_SERVER,
+ GUI_COLOR_WIN_TITLE_MORE,
+ GUI_COLOR_WIN_INPUT_TEXT_NOT_FOUND,
+ GUI_COLOR_WIN_NICK_CHANUSER,
GUI_NUM_COLORS
};
diff --git a/src/gui/gui-common.c b/src/gui/gui-common.c
index 369b31b93..4017f3eff 100644
--- a/src/gui/gui-common.c
+++ b/src/gui/gui-common.c
@@ -140,20 +140,20 @@ gui_add_to_line (t_gui_buffer *buffer, int type, time_t date, char *nick, char *
length = strlen (buffer->last_line->data);
buffer->last_line->data = (char *) realloc (buffer->last_line->data,
length + strlen (message) + 1);
- if (((type & MSG_TYPE_TIME) == 0)
+ if (((type & GUI_MSG_TYPE_TIME) == 0)
&& (buffer->last_line->ofs_after_date < 0))
buffer->last_line->ofs_after_date = length;
- if (((type & (MSG_TYPE_TIME | MSG_TYPE_NICK)) == 0)
+ if (((type & (GUI_MSG_TYPE_TIME | GUI_MSG_TYPE_NICK)) == 0)
&& (buffer->last_line->ofs_start_message < 0))
buffer->last_line->ofs_start_message = length;
strcat (buffer->last_line->data, message);
}
else
{
- if (((type & MSG_TYPE_TIME) == 0)
+ if (((type & GUI_MSG_TYPE_TIME) == 0)
&& (buffer->last_line->ofs_after_date < 0))
buffer->last_line->ofs_after_date = 0;
- if (((type & (MSG_TYPE_TIME | MSG_TYPE_NICK)) == 0)
+ if (((type & (GUI_MSG_TYPE_TIME | GUI_MSG_TYPE_NICK)) == 0)
&& (buffer->last_line->ofs_start_message < 0))
buffer->last_line->ofs_start_message = 0;
buffer->last_line->data = strdup (message);
@@ -161,13 +161,13 @@ gui_add_to_line (t_gui_buffer *buffer, int type, time_t date, char *nick, char *
length = gui_word_strlen (NULL, message);
buffer->last_line->length += length;
- if (type & MSG_TYPE_MSG)
+ if (type & GUI_MSG_TYPE_MSG)
buffer->last_line->line_with_message = 1;
- if (type & MSG_TYPE_HIGHLIGHT)
+ if (type & GUI_MSG_TYPE_HIGHLIGHT)
buffer->last_line->line_with_highlight = 1;
- if ((type & MSG_TYPE_TIME) || (type & MSG_TYPE_NICK) || (type & MSG_TYPE_PREFIX))
+ if ((type & GUI_MSG_TYPE_TIME) || (type & GUI_MSG_TYPE_NICK) || (type & GUI_MSG_TYPE_PREFIX))
buffer->last_line->length_align += length;
- if (type & MSG_TYPE_NOLOG)
+ if (type & GUI_MSG_TYPE_NOLOG)
buffer->last_line->log_write = 0;
if (pos)
{
@@ -185,13 +185,13 @@ gui_add_to_line (t_gui_buffer *buffer, int type, time_t date, char *nick, char *
buffer->notify_level)
{
if (buffer->last_line->line_with_highlight)
- hotlist_add (HOTLIST_HIGHLIGHT, NULL, SERVER(buffer), buffer, 0);
- else if (BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
- hotlist_add (HOTLIST_PRIVATE, NULL, SERVER(buffer), buffer, 0);
+ hotlist_add (HOTLIST_HIGHLIGHT, NULL, GUI_SERVER(buffer), buffer, 0);
+ else if (GUI_BUFFER_IS_PRIVATE(buffer) && (buffer->last_line->line_with_message))
+ hotlist_add (HOTLIST_PRIVATE, NULL, GUI_SERVER(buffer), buffer, 0);
else if (buffer->last_line->line_with_message)
- hotlist_add (HOTLIST_MSG, NULL, SERVER(buffer), buffer, 0);
+ hotlist_add (HOTLIST_MSG, NULL, GUI_SERVER(buffer), buffer, 0);
else
- hotlist_add (HOTLIST_LOW, NULL, SERVER(buffer), buffer, 0);
+ hotlist_add (HOTLIST_LOW, NULL, GUI_SERVER(buffer), buffer, 0);
gui_status_draw (gui_current_window->buffer, 1);
}
}
@@ -237,13 +237,13 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type,
{
if (buffer == NULL)
{
- type |= MSG_TYPE_NOLOG;
- if (SERVER(gui_current_window->buffer))
- buffer = SERVER(gui_current_window->buffer)->buffer;
+ type |= GUI_MSG_TYPE_NOLOG;
+ if (GUI_SERVER(gui_current_window->buffer))
+ buffer = GUI_SERVER(gui_current_window->buffer)->buffer;
else
buffer = gui_current_window->buffer;
- if (!buffer || (buffer->type != BUFFER_TYPE_STANDARD))
+ if (!buffer || (buffer->type != GUI_BUFFER_TYPE_STANDARD))
buffer = gui_buffers;
}
@@ -255,10 +255,10 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type,
return;
}
- if (buffer->type == BUFFER_TYPE_DCC)
+ if (buffer->type == GUI_BUFFER_TYPE_DCC)
buffer = gui_buffers;
- if (buffer->type == BUFFER_TYPE_DCC)
+ if (buffer->type == GUI_BUFFER_TYPE_DCC)
return;
}
@@ -314,44 +314,44 @@ gui_printf_internal (t_gui_buffer *buffer, int display_time, int type,
text_time_char[0] = text_time[i];
if (time_first_digit < 0)
{
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
- NULL, GUI_COLOR(COLOR_WIN_CHAT_TIME));
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
+ NULL, GUI_COLOR(GUI_COLOR_WIN_CHAT_TIME));
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
NULL, text_time_char);
}
else
{
if ((i < time_first_digit) || (i > time_last_digit))
{
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
- NULL, GUI_COLOR(COLOR_WIN_CHAT_DARK));
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
+ NULL, GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
NULL, text_time_char);
}
else
{
if (isdigit (text_time[i]))
{
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
- NULL, GUI_COLOR(COLOR_WIN_CHAT_TIME));
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
+ NULL, GUI_COLOR(GUI_COLOR_WIN_CHAT_TIME));
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
NULL, text_time_char);
}
else
{
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
- NULL, GUI_COLOR(COLOR_WIN_CHAT_TIME_SEP));
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
+ NULL, GUI_COLOR(GUI_COLOR_WIN_CHAT_TIME_SEP));
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
NULL, text_time_char);
}
}
}
i++;
}
- gui_add_to_line (buffer, MSG_TYPE_TIME, date,
- NULL, GUI_COLOR(COLOR_WIN_CHAT));
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date,
+ NULL, GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
- gui_add_to_line (buffer, MSG_TYPE_TIME, date, NULL, " ");
+ gui_add_to_line (buffer, GUI_MSG_TYPE_TIME, date, NULL, " ");
}
gui_add_to_line (buffer, type, date, nick, pos);
pos = strchr (pos, '\n');
@@ -390,14 +390,14 @@ gui_printf_raw_data (void *server, int send, int modified, char *message)
pos[0] = '\0';
gui_printf_nolog (gui_buffer_raw_data,
"%s[%s%s%s] %s%s%s %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
((t_irc_server *)server)->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR((send) ? COLOR_WIN_CHAT_PART : COLOR_WIN_CHAT_JOIN),
- (send) ? ((modified) ? PREFIX_SEND_MOD : PREFIX_PART) :
- ((modified) ? PREFIX_RECV_MOD : PREFIX_JOIN),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR((send) ? GUI_COLOR_WIN_CHAT_PART : GUI_COLOR_WIN_CHAT_JOIN),
+ (send) ? ((modified) ? GUI_PREFIX_SEND_MOD : GUI_PREFIX_PART) :
+ ((modified) ? GUI_PREFIX_RECV_MOD : GUI_PREFIX_JOIN),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
message);
if (pos)
{
@@ -493,8 +493,8 @@ gui_input_optimize_size (t_gui_buffer *buffer)
if (buffer->has_input)
{
- optimal_size = ((buffer->input_buffer_size / INPUT_BUFFER_BLOCK_SIZE) *
- INPUT_BUFFER_BLOCK_SIZE) + INPUT_BUFFER_BLOCK_SIZE;
+ optimal_size = ((buffer->input_buffer_size / GUI_INPUT_BUFFER_BLOCK_SIZE) *
+ GUI_INPUT_BUFFER_BLOCK_SIZE) + GUI_INPUT_BUFFER_BLOCK_SIZE;
if (buffer->input_buffer_alloc != optimal_size)
{
buffer->input_buffer_alloc = optimal_size;
@@ -672,7 +672,7 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
if (actions[0] >= 32)
{
dcc_selected = (window->dcc_selected) ?
- (t_irc_dcc *) window->dcc_selected : dcc_list;
+ (t_irc_dcc *) window->dcc_selected : irc_dcc_list;
switch (actions[0])
{
@@ -680,8 +680,8 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
case 'a':
case 'A':
if (dcc_selected
- && (DCC_IS_RECV(dcc_selected->status))
- && (dcc_selected->status == DCC_WAITING))
+ && (IRC_DCC_IS_RECV(dcc_selected->status))
+ && (dcc_selected->status == IRC_DCC_WAITING))
{
irc_dcc_accept (dcc_selected);
}
@@ -690,9 +690,9 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
case 'c':
case 'C':
if (dcc_selected
- && (!DCC_ENDED(dcc_selected->status)))
+ && (!IRC_DCC_ENDED(dcc_selected->status)))
{
- irc_dcc_close (dcc_selected, DCC_ABORTED);
+ irc_dcc_close (dcc_selected, IRC_DCC_ABORTED);
gui_window_redraw_buffer (window->buffer);
}
break;
@@ -702,11 +702,11 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
window->dcc_first = NULL;
window->dcc_selected = NULL;
window->dcc_last_displayed = NULL;
- ptr_dcc = dcc_list;
+ ptr_dcc = irc_dcc_list;
while (ptr_dcc)
{
ptr_dcc_next = ptr_dcc->next_dcc;
- if (DCC_ENDED(ptr_dcc->status))
+ if (IRC_DCC_ENDED(ptr_dcc->status))
irc_dcc_free (ptr_dcc);
ptr_dcc = ptr_dcc_next;
}
@@ -736,7 +736,7 @@ gui_exec_action_dcc (t_gui_window *window, char *actions)
case 'r':
case 'R':
if (dcc_selected
- && (DCC_ENDED(dcc_selected->status)))
+ && (IRC_DCC_ENDED(dcc_selected->status)))
{
if (dcc_selected->next_dcc)
window->dcc_selected = dcc_selected->next_dcc;
diff --git a/src/gui/gui-keyboard.c b/src/gui/gui-keyboard.c
index c4d3f0991..3c8749748 100644
--- a/src/gui/gui-keyboard.c
+++ b/src/gui/gui-keyboard.c
@@ -592,8 +592,8 @@ gui_keyboard_pressed (char *key_str)
{
for (ptr_cmd = commands; *ptr_cmd; ptr_cmd++)
{
- user_command (SERVER(gui_current_window->buffer),
- CHANNEL(gui_current_window->buffer),
+ user_command (GUI_SERVER(gui_current_window->buffer),
+ GUI_CHANNEL(gui_current_window->buffer),
*ptr_cmd, 0);
}
free_multi_command (commands);
@@ -602,7 +602,7 @@ gui_keyboard_pressed (char *key_str)
else
(void)(ptr_key->function)(gui_current_window, ptr_key->args);
#ifdef PLUGINS
- if (gui_current_window->buffer->text_search == TEXT_SEARCH_DISABLED)
+ if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)
{
(void) plugin_keyboard_handler_exec (
(ptr_key->command) ?
diff --git a/src/gui/gui-keyboard.h b/src/gui/gui-keyboard.h
index 9d9b62bb6..5f6c94dd6 100644
--- a/src/gui/gui-keyboard.h
+++ b/src/gui/gui-keyboard.h
@@ -20,9 +20,6 @@
#ifndef __WEECHAT_GUI_KEY_H
#define __WEECHAT_GUI_KEY_H 1
-#define KEY_SHOW_MODE_DISPLAY 1
-#define KEY_SHOW_MODE_BIND 2
-
/* key structures */
typedef void (t_gui_key_func)(t_gui_window *, char *);
diff --git a/src/gui/gui-log.c b/src/gui/gui-log.c
index 515a9c5e0..d8a51c202 100644
--- a/src/gui/gui-log.c
+++ b/src/gui/gui-log.c
@@ -112,21 +112,21 @@ gui_log_start (t_gui_buffer *buffer)
log_path = weechat_strreplace (cfg_log_path, "~", getenv ("HOME"));
log_path2 = weechat_strreplace (log_path, "%h", weechat_home);
- if (SERVER(buffer))
- server_name = weechat_strreplace (SERVER(buffer)->name, DIR_SEPARATOR, "_");
+ if (GUI_SERVER(buffer))
+ server_name = weechat_strreplace (GUI_SERVER(buffer)->name, DIR_SEPARATOR, "_");
else
server_name = NULL;
- if (CHANNEL(buffer))
- channel_name = weechat_strreplace (CHANNEL(buffer)->name, DIR_SEPARATOR, "_");
+ if (GUI_CHANNEL(buffer))
+ channel_name = weechat_strreplace (GUI_CHANNEL(buffer)->name, DIR_SEPARATOR, "_");
else
channel_name = NULL;
- if (!log_path || !log_path2 || (SERVER(buffer) && !server_name) ||
- (CHANNEL(buffer) && !channel_name))
+ if (!log_path || !log_path2 || (GUI_SERVER(buffer) && !server_name) ||
+ (GUI_CHANNEL(buffer) && !channel_name))
{
weechat_log_printf (_("Not enough memory to write log file \"%s\"\n"),
(log_path2) ? log_path2 : ((log_path) ? log_path : cfg_log_path));
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL, _("Not enough memory to write log file \"%s\"\n"),
(log_path2) ? log_path2 : ((log_path) ? log_path : cfg_log_path));
if (log_path)
@@ -141,9 +141,9 @@ gui_log_start (t_gui_buffer *buffer)
}
length = strlen (log_path2) + 128;
- if (SERVER(buffer))
+ if (GUI_SERVER(buffer))
length += strlen (server_name);
- if (CHANNEL(buffer))
+ if (GUI_CHANNEL(buffer))
length += strlen (channel_name);
buffer->log_filename = (char *) malloc (length);
@@ -151,7 +151,7 @@ gui_log_start (t_gui_buffer *buffer)
{
weechat_log_printf (_("Not enough memory to write log file \"%s\"\n"),
(log_path2) ? log_path2 : ((log_path) ? log_path : cfg_log_path));
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL, _("Not enough memory to write log file \"%s\"\n"),
(log_path2) ? log_path2 : ((log_path) ? log_path : cfg_log_path));
free (log_path);
@@ -171,17 +171,17 @@ gui_log_start (t_gui_buffer *buffer)
if (buffer->log_filename[strlen (buffer->log_filename) - 1] != DIR_SEPARATOR_CHAR)
strcat (buffer->log_filename, DIR_SEPARATOR);
- if (SERVER(buffer))
+ if (GUI_SERVER(buffer))
{
strcat (buffer->log_filename, server_name);
strcat (buffer->log_filename, ".");
}
- if (CHANNEL(buffer)
- && (CHANNEL(buffer)->type == CHANNEL_TYPE_DCC_CHAT))
+ if (GUI_CHANNEL(buffer)
+ && (GUI_CHANNEL(buffer)->type == IRC_CHANNEL_TYPE_DCC_CHAT))
{
strcat (buffer->log_filename, "dcc.");
}
- if (CHANNEL(buffer))
+ if (GUI_CHANNEL(buffer))
{
strcat (buffer->log_filename, channel_name);
strcat (buffer->log_filename, ".");
@@ -198,7 +198,7 @@ gui_log_start (t_gui_buffer *buffer)
{
weechat_log_printf (_("Unable to write log file \"%s\"\n"),
buffer->log_filename);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("Unable to write log file \"%s\"\n"),
buffer->log_filename);
free (buffer->log_filename);
diff --git a/src/gui/gui-window.c b/src/gui/gui-window.c
index b851f7313..f99255e64 100644
--- a/src/gui/gui-window.c
+++ b/src/gui/gui-window.c
@@ -315,9 +315,10 @@ gui_window_switch_server (t_gui_window *window)
if (ptr_buffer)
{
- ptr_server = (SERVER(ptr_buffer) && SERVER(ptr_buffer)->next_server) ?
- SERVER(ptr_buffer)->next_server : irc_servers;
- while (ptr_server != SERVER(window->buffer))
+ ptr_server = (GUI_SERVER(ptr_buffer)
+ && GUI_SERVER(ptr_buffer)->next_server) ?
+ GUI_SERVER(ptr_buffer)->next_server : irc_servers;
+ while (ptr_server != GUI_SERVER(window->buffer))
{
if (ptr_server->buffer)
break;
@@ -325,7 +326,7 @@ gui_window_switch_server (t_gui_window *window)
ptr_server = ptr_server->next_server;
else
{
- if (SERVER(ptr_buffer) == NULL)
+ if (GUI_SERVER(ptr_buffer) == NULL)
{
ptr_server = NULL;
break;
@@ -333,7 +334,7 @@ gui_window_switch_server (t_gui_window *window)
ptr_server = irc_servers;
}
}
- if (ptr_server && (ptr_server != SERVER(ptr_buffer)))
+ if (ptr_server && (ptr_server != GUI_SERVER(ptr_buffer)))
{
ptr_buffer->server = ptr_server;
gui_status_draw (window->buffer, 1);
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 159eb501b..1382a4aba 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -28,10 +28,10 @@
#define gui_printf(buffer, fmt, argz...) \
- gui_printf_internal(buffer, 1, MSG_TYPE_INFO, -1, NULL, fmt, ##argz)
+ gui_printf_internal(buffer, 1, GUI_MSG_TYPE_INFO, -1, NULL, fmt, ##argz)
#define gui_printf_keep_colors(buffer, fmt, argz...) \
- gui_printf_internal(buffer, 1, MSG_TYPE_INFO, 1, NULL, fmt, ##argz)
+ gui_printf_internal(buffer, 1, GUI_MSG_TYPE_INFO, 1, NULL, fmt, ##argz)
#define gui_printf_type(buffer, type, fmt, argz...) \
gui_printf_internal(buffer, 1, type, -1, NULL, fmt, ##argz)
@@ -40,10 +40,10 @@
gui_printf_internal(buffer, 1, type, -1, nick, fmt, ##argz)
#define gui_printf_nolog(buffer, fmt, argz...) \
- gui_printf_internal(buffer, 1, MSG_TYPE_INFO | MSG_TYPE_NOLOG, -1, NULL, fmt, ##argz)
+ gui_printf_internal(buffer, 1, GUI_MSG_TYPE_INFO | GUI_MSG_TYPE_NOLOG, -1, NULL, fmt, ##argz)
#define gui_printf_nolog_notime(buffer, fmt, argz...) \
- gui_printf_internal(buffer, 0, MSG_TYPE_NOLOG, -1, NULL, fmt, ##argz)
+ gui_printf_internal(buffer, 0, GUI_MSG_TYPE_NOLOG, -1, NULL, fmt, ##argz)
typedef struct t_gui_infobar t_gui_infobar;
diff --git a/src/irc/irc-channel.c b/src/irc/irc-channel.c
index 0b286898f..37fd63eb4 100644
--- a/src/irc/irc-channel.c
+++ b/src/irc/irc-channel.c
@@ -36,9 +36,6 @@
#include "../gui/gui.h"
-char *channel_modes = "iklmnstp";
-
-
/*
* irc_channel_new: allocate a new channel for a server and add it to the
* server queue
@@ -106,9 +103,9 @@ irc_channel_free (t_irc_server *server, t_irc_channel *channel)
if (channel->dcc_chat)
{
((t_irc_dcc *)(channel->dcc_chat))->channel = NULL;
- if (!DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status))
+ if (!IRC_DCC_ENDED(((t_irc_dcc *)(channel->dcc_chat))->status))
{
- irc_dcc_close ((t_irc_dcc *)(channel->dcc_chat), DCC_ABORTED);
+ irc_dcc_close ((t_irc_dcc *)(channel->dcc_chat), IRC_DCC_ABORTED);
irc_dcc_redraw (1);
}
}
@@ -174,7 +171,7 @@ irc_channel_search (t_irc_server *server, char *channel_name)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if ((ptr_channel->type != CHANNEL_TYPE_DCC_CHAT)
+ if ((ptr_channel->type != IRC_CHANNEL_TYPE_DCC_CHAT)
&& (ascii_strcasecmp (ptr_channel->name, channel_name) == 0))
return ptr_channel;
}
@@ -240,7 +237,7 @@ irc_channel_search_dcc (t_irc_server *server, char *channel_name)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if ((ptr_channel->type == CHANNEL_TYPE_DCC_CHAT)
+ if ((ptr_channel->type == IRC_CHANNEL_TYPE_DCC_CHAT)
&& (ascii_strcasecmp (ptr_channel->name, channel_name) == 0))
return ptr_channel;
}
@@ -261,7 +258,7 @@ irc_channel_is_channel (char *string)
first_char[0] = string[0];
first_char[1] = '\0';
- return (strpbrk (first_char, CHANNEL_PREFIX)) ? 1 : 0;
+ return (strpbrk (first_char, IRC_CHANNEL_PREFIX)) ? 1 : 0;
}
/*
@@ -273,11 +270,11 @@ irc_channel_remove_away (t_irc_channel *channel)
{
t_irc_nick *ptr_nick;
- if (channel->type == CHANNEL_TYPE_CHANNEL)
+ if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
for (ptr_nick = channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
- NICK_SET_FLAG(ptr_nick, 0, NICK_AWAY);
+ IRC_NICK_SET_FLAG(ptr_nick, 0, IRC_NICK_AWAY);
}
gui_nicklist_draw (channel->buffer, 0, 0);
}
@@ -290,7 +287,7 @@ irc_channel_remove_away (t_irc_channel *channel)
void
irc_channel_check_away (t_irc_server *server, t_irc_channel *channel, int force)
{
- if (channel->type == CHANNEL_TYPE_CHANNEL)
+ if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
if (force || (cfg_irc_away_check_max_nicks == 0) ||
(channel->nicks_count <= cfg_irc_away_check_max_nicks))
@@ -312,7 +309,7 @@ irc_channel_set_away (t_irc_channel *channel, char *nick, int is_away)
{
t_irc_nick *ptr_nick;
- if (channel->type == CHANNEL_TYPE_CHANNEL)
+ if (channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
ptr_nick = irc_nick_search (channel, nick);
if (ptr_nick)
@@ -332,16 +329,17 @@ irc_channel_create_dcc (t_irc_dcc *ptr_dcc)
ptr_channel = irc_channel_search_dcc (ptr_dcc->server, ptr_dcc->nick);
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (ptr_dcc->server, CHANNEL_TYPE_DCC_CHAT,
+ ptr_channel = irc_channel_new (ptr_dcc->server,
+ IRC_CHANNEL_TYPE_DCC_CHAT,
ptr_dcc->nick);
if (!ptr_channel)
return 0;
gui_buffer_new (gui_current_window, ptr_dcc->server, ptr_channel,
- BUFFER_TYPE_STANDARD, 0);
+ GUI_BUFFER_TYPE_STANDARD, 0);
}
if (ptr_channel->dcc_chat &&
- (!DCC_ENDED(((t_irc_dcc *)(ptr_channel->dcc_chat))->status)))
+ (!IRC_DCC_ENDED(((t_irc_dcc *)(ptr_channel->dcc_chat))->status)))
return 0;
ptr_channel->dcc_chat = ptr_dcc;
@@ -361,13 +359,13 @@ irc_channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
int server_default_notify, notify;
if ((!server) || (!channel))
- return NOTIFY_LEVEL_DEFAULT;
+ return GUI_NOTIFY_LEVEL_DEFAULT;
if ((!server->notify_levels) || (!server->notify_levels[0]))
- return NOTIFY_LEVEL_DEFAULT;
+ return GUI_NOTIFY_LEVEL_DEFAULT;
server_default_notify = irc_server_get_default_notify_level (server);
- if ((channel->type != CHANNEL_TYPE_CHANNEL)
+ if ((channel->type != IRC_CHANNEL_TYPE_CHANNEL)
&& (server_default_notify == 1))
server_default_notify = 2;
@@ -387,7 +385,7 @@ irc_channel_get_notify_level (t_irc_server *server, t_irc_channel *channel)
return server_default_notify;
notify = (int)(pos2[0] - '0');
- if ((notify >= NOTIFY_LEVEL_MIN) && (notify <= NOTIFY_LEVEL_MAX))
+ if ((notify >= GUI_NOTIFY_LEVEL_MIN) && (notify <= GUI_NOTIFY_LEVEL_MAX))
return notify;
return server_default_notify;
@@ -424,9 +422,9 @@ irc_channel_add_nick_speaking (t_irc_channel *channel, char *nick)
nick, WEELIST_POS_END);
size = weelist_get_size (channel->nicks_speaking);
- if (size > CHANNEL_NICKS_SPEAKING_LIMIT)
+ if (size > IRC_CHANNEL_NICKS_SPEAKING_LIMIT)
{
- to_remove = size - CHANNEL_NICKS_SPEAKING_LIMIT;
+ to_remove = size - IRC_CHANNEL_NICKS_SPEAKING_LIMIT;
for (i = 0; i < to_remove; i++)
{
weelist_remove (&(channel->nicks_speaking),
diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c
index f9b758fb2..2fc5f2123 100644
--- a/src/irc/irc-dcc.c
+++ b/src/irc/irc-dcc.c
@@ -48,9 +48,9 @@
#include "../gui/gui.h"
-t_irc_dcc *dcc_list = NULL; /* DCC files & chat list */
-t_irc_dcc *last_dcc = NULL; /* last DCC in list */
-char *dcc_status_string[] = /* strings for DCC status */
+t_irc_dcc *irc_dcc_list = NULL; /* DCC files & chat list */
+t_irc_dcc *irc_last_dcc = NULL; /* last DCC in list */
+char *irc_dcc_status_string[] = /* strings for DCC status */
{ N_("Waiting"), N_("Connecting"), N_("Active"), N_("Done"), N_("Failed"),
N_("Aborted") };
@@ -82,7 +82,7 @@ irc_dcc_search (t_irc_server *server, int type, int status, int port)
{
t_irc_dcc *ptr_dcc;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if ((ptr_dcc->server == server)
&& (ptr_dcc->type == type)
@@ -106,9 +106,9 @@ irc_dcc_port_in_use (int port)
t_irc_dcc *ptr_dcc;
/* skip any currently used ports */
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
- if ((ptr_dcc->port == port) && (!DCC_ENDED(ptr_dcc->status)))
+ if ((ptr_dcc->port == port) && (!IRC_DCC_ENDED(ptr_dcc->status)))
return 1;
}
@@ -157,7 +157,7 @@ irc_dcc_find_filename (t_irc_dcc *ptr_dcc)
{
char *dir1, *dir2, *filename2;
- if (!DCC_IS_FILE(ptr_dcc->type))
+ if (!IRC_DCC_IS_FILE(ptr_dcc->type))
return;
dir1 = weechat_strreplace (cfg_dcc_download_path, "~", getenv ("HOME"));
@@ -197,7 +197,7 @@ irc_dcc_find_filename (t_irc_dcc *ptr_dcc)
/* if auto rename is not set, then abort DCC */
if (!cfg_dcc_auto_rename)
{
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return;
}
@@ -205,7 +205,7 @@ irc_dcc_find_filename (t_irc_dcc *ptr_dcc)
filename2 = (char *) malloc (strlen (ptr_dcc->local_filename) + 16);
if (!filename2)
{
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return;
}
@@ -327,10 +327,10 @@ irc_dcc_connect_to_sender (t_irc_dcc *ptr_dcc)
int
irc_dcc_connect (t_irc_dcc *ptr_dcc)
{
- if (ptr_dcc->type == DCC_CHAT_SEND)
- ptr_dcc->status = DCC_WAITING;
+ if (ptr_dcc->type == IRC_DCC_CHAT_SEND)
+ ptr_dcc->status = IRC_DCC_WAITING;
else
- ptr_dcc->status = DCC_CONNECTING;
+ ptr_dcc->status = IRC_DCC_CONNECTING;
if (ptr_dcc->sock < 0)
{
@@ -340,7 +340,7 @@ irc_dcc_connect (t_irc_dcc *ptr_dcc)
}
/* for chat or file sending, listen to socket for a connection */
- if (DCC_IS_SEND(ptr_dcc->type))
+ if (IRC_DCC_IS_SEND(ptr_dcc->type))
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
@@ -351,7 +351,7 @@ irc_dcc_connect (t_irc_dcc *ptr_dcc)
}
/* for chat receiving, connect to listening host */
- if (ptr_dcc->type == DCC_CHAT_RECV)
+ if (ptr_dcc->type == IRC_DCC_CHAT_RECV)
{
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
return 0;
@@ -381,7 +381,7 @@ irc_dcc_free (t_irc_dcc *ptr_dcc)
{
/* check if channel is used for another active DCC CHAT */
if (!ptr_dcc->channel->dcc_chat
- || (DCC_ENDED(((t_irc_dcc *)(ptr_dcc->channel->dcc_chat))->status)))
+ || (IRC_DCC_ENDED(((t_irc_dcc *)(ptr_dcc->channel->dcc_chat))->status)))
{
gui_buffer_free (ptr_dcc->channel->buffer, 1);
if (ptr_dcc->channel)
@@ -390,12 +390,12 @@ irc_dcc_free (t_irc_dcc *ptr_dcc)
}
/* remove DCC from list */
- if (last_dcc == ptr_dcc)
- last_dcc = ptr_dcc->prev_dcc;
+ if (irc_last_dcc == ptr_dcc)
+ irc_last_dcc = ptr_dcc->prev_dcc;
if (ptr_dcc->prev_dcc)
{
(ptr_dcc->prev_dcc)->next_dcc = ptr_dcc->next_dcc;
- new_dcc_list = dcc_list;
+ new_dcc_list = irc_dcc_list;
}
else
new_dcc_list = ptr_dcc->next_dcc;
@@ -411,7 +411,7 @@ irc_dcc_free (t_irc_dcc *ptr_dcc)
free (ptr_dcc->filename);
free (ptr_dcc);
- dcc_list = new_dcc_list;
+ irc_dcc_list = new_dcc_list;
}
/*
@@ -454,62 +454,62 @@ irc_dcc_close (t_irc_dcc *ptr_dcc, int status)
ptr_dcc->status = status;
- if ((status == DCC_DONE) || (status == DCC_ABORTED) || (status == DCC_FAILED))
+ if ((status == IRC_DCC_DONE) || (status == IRC_DCC_ABORTED) || (status == IRC_DCC_FAILED))
{
- if (DCC_IS_FILE(ptr_dcc->type))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type))
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_INFO);
+ GUI_PREFIX_INFO);
gui_printf (ptr_dcc->server->buffer,
_("DCC: file %s%s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_dcc->filename,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (ptr_dcc->local_filename)
gui_printf (ptr_dcc->server->buffer,
_(" (local filename: %s%s%s)"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_dcc->local_filename,
- GUI_COLOR(COLOR_WIN_CHAT));
- if (ptr_dcc->type == DCC_FILE_SEND)
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
+ if (ptr_dcc->type == IRC_DCC_FILE_SEND)
gui_printf (ptr_dcc->server->buffer, _(" sent to "));
else
gui_printf (ptr_dcc->server->buffer, _(" received from "));
gui_printf (ptr_dcc->server->buffer, "%s%s%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
ptr_dcc->nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- (status == DCC_DONE) ? _("OK") : _("FAILED"));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ (status == IRC_DCC_DONE) ? _("OK") : _("FAILED"));
irc_dcc_file_child_kill (ptr_dcc);
}
}
- if (status == DCC_ABORTED)
+ if (status == IRC_DCC_ABORTED)
{
- if (DCC_IS_CHAT(ptr_dcc->type))
+ if (IRC_DCC_IS_CHAT(ptr_dcc->type))
{
if (ptr_dcc->channel)
ptr_buffer = ptr_dcc->channel->buffer;
else
ptr_buffer = ptr_dcc->server->buffer;
- irc_display_prefix (ptr_dcc->server, ptr_buffer, PREFIX_INFO);
+ irc_display_prefix (ptr_dcc->server, ptr_buffer, GUI_PREFIX_INFO);
gui_printf (ptr_buffer,
_("DCC chat closed with %s%s %s(%s%d.%d.%d.%d%s)\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
ptr_dcc->nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
ptr_dcc->addr >> 24,
(ptr_dcc->addr >> 16) & 0xff,
(ptr_dcc->addr >> 8) & 0xff,
ptr_dcc->addr & 0xff,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
/* remove empty file if received file failed and nothing was transfered */
- if (((status == DCC_FAILED) || (status == DCC_ABORTED))
- && DCC_IS_FILE(ptr_dcc->type)
- && DCC_IS_RECV(ptr_dcc->type)
+ if (((status == IRC_DCC_FAILED) || (status == IRC_DCC_ABORTED))
+ && IRC_DCC_IS_FILE(ptr_dcc->type)
+ && IRC_DCC_IS_RECV(ptr_dcc->type)
&& ptr_dcc->local_filename
&& ptr_dcc->pos == 0)
{
@@ -521,7 +521,7 @@ irc_dcc_close (t_irc_dcc *ptr_dcc, int status)
}
}
- if (DCC_IS_FILE(ptr_dcc->type))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type))
irc_dcc_calculate_speed (ptr_dcc, 1);
if (ptr_dcc->sock >= 0)
@@ -546,30 +546,30 @@ irc_dcc_channel_for_chat (t_irc_dcc *ptr_dcc)
if (!irc_channel_create_dcc (ptr_dcc))
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s can't associate DCC chat with private buffer "
"(maybe private buffer has already DCC CHAT?)\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return;
}
irc_display_prefix (ptr_dcc->server, ptr_dcc->channel->buffer,
- PREFIX_INFO);
- gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_MSG,
+ GUI_PREFIX_INFO);
+ gui_printf_type (ptr_dcc->channel->buffer, GUI_MSG_TYPE_MSG,
_("Connected to %s%s %s(%s%d.%d.%d.%d%s)%s via DCC chat\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
ptr_dcc->nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
ptr_dcc->addr >> 24,
(ptr_dcc->addr >> 16) & 0xff,
(ptr_dcc->addr >> 8) & 0xff,
ptr_dcc->addr & 0xff,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
/*
@@ -584,7 +584,7 @@ irc_dcc_chat_remove_channel (t_irc_channel *channel)
if (!channel)
return;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->channel == channel)
ptr_dcc->channel = NULL;
@@ -600,21 +600,21 @@ irc_dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
{
if (!irc_dcc_connect (ptr_dcc))
{
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
}
else
{
/* DCC file => launch child process */
- if (DCC_IS_FILE(ptr_dcc->type))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type))
{
- ptr_dcc->status = DCC_CONNECTING;
+ ptr_dcc->status = IRC_DCC_CONNECTING;
irc_dcc_file_recv_fork (ptr_dcc);
}
else
{
/* DCC CHAT => associate DCC with channel */
- ptr_dcc->status = DCC_ACTIVE;
+ ptr_dcc->status = IRC_DCC_ACTIVE;
irc_dcc_channel_for_chat (ptr_dcc);
}
}
@@ -628,9 +628,9 @@ irc_dcc_recv_connect_init (t_irc_dcc *ptr_dcc)
void
irc_dcc_accept (t_irc_dcc *ptr_dcc)
{
- if (DCC_IS_FILE(ptr_dcc->type) && (ptr_dcc->start_resume > 0))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type) && (ptr_dcc->start_resume > 0))
{
- ptr_dcc->status = DCC_CONNECTING;
+ ptr_dcc->status = IRC_DCC_CONNECTING;
irc_server_sendf (ptr_dcc->server,
(strchr (ptr_dcc->filename, ' ')) ?
"PRIVMSG %s :\01DCC RESUME \"%s\" %d %u\01\n" :
@@ -653,7 +653,7 @@ irc_dcc_accept_resume (t_irc_server *server, char *filename, int port,
{
t_irc_dcc *ptr_dcc;
- ptr_dcc = irc_dcc_search (server, DCC_FILE_SEND, DCC_CONNECTING, port);
+ ptr_dcc = irc_dcc_search (server, IRC_DCC_FILE_SEND, IRC_DCC_CONNECTING, port);
if (ptr_dcc)
{
ptr_dcc->pos = pos_start;
@@ -668,12 +668,12 @@ irc_dcc_accept_resume (t_irc_server *server, char *filename, int port,
ptr_dcc->port, ptr_dcc->start_resume);
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_INFO);
+ GUI_PREFIX_INFO);
gui_printf (ptr_dcc->server->buffer,
_("DCC: file %s%s%s resumed at position %u\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_dcc->filename,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_dcc->start_resume);
irc_dcc_redraw (HOTLIST_MSG);
}
@@ -693,7 +693,7 @@ irc_dcc_start_resume (t_irc_server *server, char *filename, int port,
{
t_irc_dcc *ptr_dcc;
- ptr_dcc = irc_dcc_search (server, DCC_FILE_RECV, DCC_CONNECTING, port);
+ ptr_dcc = irc_dcc_search (server, IRC_DCC_FILE_RECV, IRC_DCC_CONNECTING, port);
if (ptr_dcc)
{
ptr_dcc->pos = pos_start;
@@ -753,12 +753,12 @@ irc_dcc_alloc ()
new_dcc->eta = 0;
new_dcc->prev_dcc = NULL;
- new_dcc->next_dcc = dcc_list;
- if (dcc_list)
- dcc_list->prev_dcc = new_dcc;
+ new_dcc->next_dcc = irc_dcc_list;
+ if (irc_dcc_list)
+ irc_dcc_list->prev_dcc = new_dcc;
else
- last_dcc = new_dcc;
- dcc_list = new_dcc;
+ irc_last_dcc = new_dcc;
+ irc_dcc_list = new_dcc;
return new_dcc;
}
@@ -776,7 +776,7 @@ irc_dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char
new_dcc = irc_dcc_alloc ();
if (!new_dcc)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for new DCC\n"),
WEECHAT_ERROR);
@@ -787,7 +787,7 @@ irc_dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char
new_dcc->server = server;
new_dcc->channel = NULL;
new_dcc->type = type;
- new_dcc->status = DCC_WAITING;
+ new_dcc->status = IRC_DCC_WAITING;
new_dcc->start_time = time (NULL);
new_dcc->start_transfer = time (NULL);
new_dcc->addr = addr;
@@ -796,7 +796,7 @@ irc_dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char
new_dcc->sock = sock;
new_dcc->unterminated_message = NULL;
new_dcc->file = -1;
- if (DCC_IS_CHAT(type))
+ if (IRC_DCC_IS_CHAT(type))
new_dcc->filename = strdup (_("DCC chat"));
else
new_dcc->filename = (filename) ? strdup (filename) : NULL;
@@ -820,113 +820,113 @@ irc_dcc_add (t_irc_server *server, int type, unsigned long addr, int port, char
gui_current_window->dcc_selected = NULL;
/* write info message on server buffer */
- if (type == DCC_FILE_RECV)
+ if (type == IRC_DCC_FILE_RECV)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("Incoming DCC file from %s%s%s (%s%d.%d.%d.%d%s)%s: %s%s%s, %s%lu%s bytes\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
addr >> 24,
(addr >> 16) & 0xff,
(addr >> 8) & 0xff,
addr & 0xff,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
filename,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
size,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
irc_dcc_redraw (HOTLIST_MSG);
}
- if (type == DCC_FILE_SEND)
+ if (type == IRC_DCC_FILE_SEND)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("Sending DCC file to %s%s%s: %s%s%s "
"(local filename: %s%s%s), %s%lu%s bytes\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
filename,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
local_filename,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
size,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
irc_dcc_redraw (HOTLIST_MSG);
}
- if (type == DCC_CHAT_RECV)
+ if (type == IRC_DCC_CHAT_RECV)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("Incoming DCC chat request from %s%s%s "
"(%s%d.%d.%d.%d%s)\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
addr >> 24,
(addr >> 16) & 0xff,
(addr >> 8) & 0xff,
addr & 0xff,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
irc_dcc_redraw (HOTLIST_MSG);
}
- if (type == DCC_CHAT_SEND)
+ if (type == IRC_DCC_CHAT_SEND)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("Sending DCC chat request to %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
irc_dcc_redraw (HOTLIST_MSG);
}
- if (DCC_IS_FILE(type) && (!new_dcc->local_filename))
+ if (IRC_DCC_IS_FILE(type) && (!new_dcc->local_filename))
{
- irc_dcc_close (new_dcc, DCC_FAILED);
+ irc_dcc_close (new_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return NULL;
}
- if (DCC_IS_FILE(type) && (new_dcc->start_resume > 0))
+ if (IRC_DCC_IS_FILE(type) && (new_dcc->start_resume > 0))
{
irc_display_prefix (new_dcc->server, new_dcc->server->buffer,
- PREFIX_INFO);
+ GUI_PREFIX_INFO);
gui_printf (new_dcc->server->buffer,
_("DCC: file %s%s%s (local filename: %s%s%s) "
"will be resumed at position %u\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
new_dcc->filename,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
new_dcc->local_filename,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
new_dcc->start_resume);
irc_dcc_redraw (HOTLIST_MSG);
}
/* connect if needed and redraw DCC buffer */
- if (DCC_IS_SEND(type))
+ if (IRC_DCC_IS_SEND(type))
{
if (!irc_dcc_connect (new_dcc))
{
- irc_dcc_close (new_dcc, DCC_FAILED);
+ irc_dcc_close (new_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return NULL;
}
}
- if ( ( (type == DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) )
- || ( (type == DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
+ if ( ( (type == IRC_DCC_CHAT_RECV) && (cfg_dcc_auto_accept_chats) )
+ || ( (type == IRC_DCC_FILE_RECV) && (cfg_dcc_auto_accept_files) ) )
irc_dcc_accept (new_dcc);
else
irc_dcc_redraw (HOTLIST_PRIVATE);
@@ -957,7 +957,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
short_filename = NULL;
spaces = 0;
- if (type == DCC_FILE_SEND)
+ if (type == IRC_DCC_FILE_SEND)
{
/* add home if filename not beginning with '/' or '~' (not for Win32) */
#ifdef _WIN32
@@ -982,7 +982,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
strlen (filename) + 4);
if (!filename2)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for DCC SEND\n"),
WEECHAT_ERROR);
@@ -1002,7 +1002,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
/* check if file exists */
if (stat (filename2, &st) == -1)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot access file \"%s\"\n"),
WEECHAT_ERROR, filename2);
@@ -1044,7 +1044,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
sock = socket (AF_INET, SOCK_STREAM, 0);
if (sock < 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket for DCC\n"),
WEECHAT_ERROR);
@@ -1102,7 +1102,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
if (port == -1)
{
/* Could not find any port to bind */
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot find available port for DCC\n"),
WEECHAT_ERROR);
@@ -1112,7 +1112,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
return;
}
- if (type == DCC_FILE_SEND)
+ if (type == IRC_DCC_FILE_SEND)
{
/* extract short filename (without path) */
pos = strrchr (filename2, DIR_SEPARATOR_CHAR);
@@ -1138,15 +1138,15 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
}
/* add DCC entry and listen to socket */
- if (type == DCC_CHAT_SEND)
- ptr_dcc = irc_dcc_add (server, DCC_CHAT_SEND, local_addr, port, nick, sock,
+ if (type == IRC_DCC_CHAT_SEND)
+ ptr_dcc = irc_dcc_add (server, IRC_DCC_CHAT_SEND, local_addr, port, nick, sock,
NULL, NULL, 0);
else
- ptr_dcc = irc_dcc_add (server, DCC_FILE_SEND, local_addr, port, nick, sock,
+ ptr_dcc = irc_dcc_add (server, IRC_DCC_FILE_SEND, local_addr, port, nick, sock,
short_filename, filename2, st.st_size);
if (!ptr_dcc)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot send DCC\n"),
WEECHAT_ERROR);
@@ -1159,7 +1159,7 @@ irc_dcc_send_request (t_irc_server *server, int type, char *nick, char *filename
}
/* send DCC request to nick */
- if (type == DCC_CHAT_SEND)
+ if (type == IRC_DCC_CHAT_SEND)
irc_server_sendf (server,
"PRIVMSG %s :\01DCC CHAT chat %lu %d\01",
nick, local_addr, port);
@@ -1222,11 +1222,11 @@ irc_dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...)
if (irc_dcc_chat_send (ptr_dcc, buffer, strlen (buffer)) <= 0)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s error sending data to \"%s\" via DCC CHAT\n"),
WEECHAT_ERROR, ptr_dcc->nick);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
}
}
@@ -1307,23 +1307,23 @@ irc_dcc_chat_recv (t_irc_dcc *ptr_dcc)
if (irc_recv_is_highlight (ptr_buf, ptr_dcc->server->nick))
{
irc_display_nick (ptr_dcc->channel->buffer, NULL, ptr_dcc->nick,
- MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1,
- COLOR_WIN_CHAT_HIGHLIGHT, 0);
+ GUI_MSG_TYPE_NICK | GUI_MSG_TYPE_HIGHLIGHT, 1,
+ GUI_COLOR_WIN_CHAT_HIGHLIGHT, 0);
if ((cfg_look_infobar_delay_highlight > 0)
&& (ptr_dcc->channel->buffer != gui_current_window->buffer))
{
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private %s> %s"),
ptr_dcc->nick, ptr_buf);
}
}
else
irc_display_nick (ptr_dcc->channel->buffer, NULL, ptr_dcc->nick,
- MSG_TYPE_NICK, 1, COLOR_WIN_NICK_PRIVATE, 0);
- gui_printf_type (ptr_dcc->channel->buffer, MSG_TYPE_MSG,
+ GUI_MSG_TYPE_NICK, 1, GUI_COLOR_WIN_NICK_PRIVATE, 0);
+ gui_printf_type (ptr_dcc->channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ptr_buf);
}
@@ -1335,7 +1335,7 @@ irc_dcc_chat_recv (t_irc_dcc *ptr_dcc)
}
else
{
- irc_dcc_close (ptr_dcc, DCC_ABORTED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_ABORTED);
irc_dcc_redraw (HOTLIST_MSG);
}
}
@@ -1353,11 +1353,11 @@ irc_dcc_file_create_pipe (t_irc_dcc *ptr_dcc)
if (pipe (child_pipe) < 0)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to create pipe\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return 0;
}
@@ -1389,7 +1389,7 @@ void
irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
{
int num_read, num_sent;
- static char buffer[DCC_MAX_BLOCKSIZE];
+ static char buffer[IRC_DCC_MAX_BLOCKSIZE];
uint32_t ack;
time_t last_sent, new_time;
@@ -1406,7 +1406,7 @@ irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
if ((num_read < 1) &&
((num_read != -1) || (errno != EAGAIN)))
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_SEND_BLOCK);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_SEND_BLOCK);
return;
}
if (num_read == 4)
@@ -1418,7 +1418,7 @@ irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
if ((ptr_dcc->pos >= ptr_dcc->size)
&& (ptr_dcc->ack >= ptr_dcc->size))
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_DONE, DCC_NO_ERROR);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_DONE, IRC_DCC_NO_ERROR);
return;
}
}
@@ -1435,7 +1435,7 @@ irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
num_read = read (ptr_dcc->file, buffer, ptr_dcc->blocksize);
if (num_read < 1)
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_READ_LOCAL);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_READ_LOCAL);
return;
}
num_sent = send (ptr_dcc->sock, buffer, num_read, 0);
@@ -1447,7 +1447,7 @@ irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
usleep (1000);
else
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_SEND_BLOCK);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_SEND_BLOCK);
return;
}
}
@@ -1458,7 +1458,7 @@ irc_dcc_file_send_child (t_irc_dcc *ptr_dcc)
if (last_sent != new_time)
{
last_sent = new_time;
- irc_dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_ACTIVE, IRC_DCC_NO_ERROR);
}
}
}
@@ -1475,19 +1475,19 @@ void
irc_dcc_file_recv_child (t_irc_dcc *ptr_dcc)
{
int num_read;
- static char buffer[DCC_MAX_BLOCKSIZE];
+ static char buffer[IRC_DCC_MAX_BLOCKSIZE];
uint32_t pos;
time_t last_sent, new_time;
/* first connect to sender (blocking) */
if (!irc_dcc_connect_to_sender (ptr_dcc))
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_CONNECT_SENDER);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_CONNECT_SENDER);
return;
}
/* connection is ok, change DCC status (inform parent process) */
- irc_dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_ACTIVE, IRC_DCC_NO_ERROR);
last_sent = time (NULL);
while (1)
@@ -1500,7 +1500,7 @@ irc_dcc_file_recv_child (t_irc_dcc *ptr_dcc)
usleep (1000);
else
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_RECV_BLOCK);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_RECV_BLOCK);
return;
}
}
@@ -1508,13 +1508,13 @@ irc_dcc_file_recv_child (t_irc_dcc *ptr_dcc)
{
if (num_read == 0)
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_RECV_BLOCK);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_RECV_BLOCK);
return;
}
if (write (ptr_dcc->file, buffer, num_read) == -1)
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_FAILED, DCC_ERROR_WRITE_LOCAL);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_FAILED, IRC_DCC_ERROR_WRITE_LOCAL);
return;
}
@@ -1527,7 +1527,7 @@ irc_dcc_file_recv_child (t_irc_dcc *ptr_dcc)
/* file received ok? */
if (ptr_dcc->pos >= ptr_dcc->size)
{
- irc_dcc_file_write_pipe (ptr_dcc, DCC_DONE, DCC_NO_ERROR);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_DONE, IRC_DCC_NO_ERROR);
return;
}
@@ -1535,7 +1535,7 @@ irc_dcc_file_recv_child (t_irc_dcc *ptr_dcc)
if (last_sent != new_time)
{
last_sent = new_time;
- irc_dcc_file_write_pipe (ptr_dcc, DCC_ACTIVE, DCC_NO_ERROR);
+ irc_dcc_file_write_pipe (ptr_dcc, IRC_DCC_ACTIVE, IRC_DCC_NO_ERROR);
}
}
}
@@ -1579,45 +1579,45 @@ irc_dcc_file_child_read (t_irc_dcc *ptr_dcc)
switch (bufpipe[1] - '0')
{
/* errors for sender */
- case DCC_ERROR_READ_LOCAL:
+ case IRC_DCC_ERROR_READ_LOCAL:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to read local file\n"),
WEECHAT_ERROR);
break;
- case DCC_ERROR_SEND_BLOCK:
+ case IRC_DCC_ERROR_SEND_BLOCK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to send block to receiver\n"),
WEECHAT_ERROR);
break;
- case DCC_ERROR_READ_ACK:
+ case IRC_DCC_ERROR_READ_ACK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to read ACK from receiver\n"),
WEECHAT_ERROR);
break;
/* errors for receiver */
- case DCC_ERROR_CONNECT_SENDER:
+ case IRC_DCC_ERROR_CONNECT_SENDER:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to connect to sender\n"),
WEECHAT_ERROR);
break;
- case DCC_ERROR_RECV_BLOCK:
+ case IRC_DCC_ERROR_RECV_BLOCK:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to receive block from sender\n"),
WEECHAT_ERROR);
break;
- case DCC_ERROR_WRITE_LOCAL:
+ case IRC_DCC_ERROR_WRITE_LOCAL:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to write local file\n"),
WEECHAT_ERROR);
@@ -1627,11 +1627,11 @@ irc_dcc_file_child_read (t_irc_dcc *ptr_dcc)
/* read new DCC status */
switch (bufpipe[0] - '0')
{
- case DCC_ACTIVE:
- if (ptr_dcc->status == DCC_CONNECTING)
+ case IRC_DCC_ACTIVE:
+ if (ptr_dcc->status == IRC_DCC_CONNECTING)
{
/* connection was successful by child, init transfert times */
- ptr_dcc->status = DCC_ACTIVE;
+ ptr_dcc->status = IRC_DCC_ACTIVE;
ptr_dcc->start_transfer = time (NULL);
ptr_dcc->last_check_time = time (NULL);
irc_dcc_redraw (HOTLIST_MSG);
@@ -1639,12 +1639,12 @@ irc_dcc_file_child_read (t_irc_dcc *ptr_dcc)
else
irc_dcc_redraw (HOTLIST_LOW);
break;
- case DCC_DONE:
- irc_dcc_close (ptr_dcc, DCC_DONE);
+ case IRC_DCC_DONE:
+ irc_dcc_close (ptr_dcc, IRC_DCC_DONE);
irc_dcc_redraw (HOTLIST_MSG);
break;
- case DCC_FAILED:
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ case IRC_DCC_FAILED:
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
break;
}
@@ -1670,11 +1670,11 @@ irc_dcc_file_send_fork (t_irc_dcc *ptr_dcc)
/* fork failed */
case -1:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to fork\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return;
/* child process */
@@ -1713,11 +1713,11 @@ irc_dcc_file_recv_fork (t_irc_dcc *ptr_dcc)
/* fork failed */
case -1:
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to fork\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
return;
/* child process */
@@ -1745,27 +1745,27 @@ irc_dcc_handle ()
struct sockaddr_in addr;
socklen_t length;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
/* check DCC timeout */
- if (DCC_IS_FILE(ptr_dcc->type) && !DCC_ENDED(ptr_dcc->status))
+ if (IRC_DCC_IS_FILE(ptr_dcc->type) && !IRC_DCC_ENDED(ptr_dcc->status))
{
if ((cfg_dcc_timeout != 0) && (time (NULL) > ptr_dcc->last_activity + cfg_dcc_timeout))
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: timeout\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
continue;
}
}
- if (ptr_dcc->status == DCC_CONNECTING)
+ if (ptr_dcc->status == IRC_DCC_CONNECTING)
{
- if (ptr_dcc->type == DCC_FILE_SEND)
+ if (ptr_dcc->type == IRC_DCC_FILE_SEND)
{
FD_ZERO (&read_fd);
FD_SET (ptr_dcc->sock, &read_fd);
@@ -1785,11 +1785,11 @@ irc_dcc_handle ()
if (sock < 0)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to create socket for sending file\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
continue;
}
@@ -1797,32 +1797,32 @@ irc_dcc_handle ()
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer,
- PREFIX_ERROR);
+ GUI_PREFIX_ERROR);
gui_printf (ptr_dcc->server->buffer,
_("%s DCC: unable to set 'nonblock' option for socket\n"),
WEECHAT_ERROR);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
- ptr_dcc->status = DCC_ACTIVE;
+ ptr_dcc->status = IRC_DCC_ACTIVE;
ptr_dcc->start_transfer = time (NULL);
irc_dcc_redraw (HOTLIST_MSG);
irc_dcc_file_send_fork (ptr_dcc);
}
}
}
- if (ptr_dcc->type == DCC_FILE_RECV)
+ if (ptr_dcc->type == IRC_DCC_FILE_RECV)
{
if (ptr_dcc->child_read != -1)
irc_dcc_file_child_read (ptr_dcc);
}
}
- if (ptr_dcc->status == DCC_WAITING)
+ if (ptr_dcc->status == IRC_DCC_WAITING)
{
- if (ptr_dcc->type == DCC_CHAT_SEND)
+ if (ptr_dcc->type == IRC_DCC_CHAT_SEND)
{
FD_ZERO (&read_fd);
FD_SET (ptr_dcc->sock, &read_fd);
@@ -1840,19 +1840,19 @@ irc_dcc_handle ()
ptr_dcc->sock = -1;
if (sock < 0)
{
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->sock = sock;
if (fcntl (ptr_dcc->sock, F_SETFL, O_NONBLOCK) == -1)
{
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
irc_dcc_redraw (HOTLIST_MSG);
continue;
}
ptr_dcc->addr = ntohl (addr.sin_addr.s_addr);
- ptr_dcc->status = DCC_ACTIVE;
+ ptr_dcc->status = IRC_DCC_ACTIVE;
irc_dcc_redraw (HOTLIST_MSG);
irc_dcc_channel_for_chat (ptr_dcc);
}
@@ -1860,9 +1860,9 @@ irc_dcc_handle ()
}
}
- if (ptr_dcc->status == DCC_ACTIVE)
+ if (ptr_dcc->status == IRC_DCC_ACTIVE)
{
- if (DCC_IS_CHAT(ptr_dcc->type))
+ if (IRC_DCC_IS_CHAT(ptr_dcc->type))
irc_dcc_chat_recv (ptr_dcc);
else
irc_dcc_file_child_read (ptr_dcc);
@@ -1879,14 +1879,14 @@ irc_dcc_end ()
{
t_irc_dcc *ptr_dcc;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
if (ptr_dcc->sock >= 0)
{
- if (ptr_dcc->status == DCC_ACTIVE)
+ if (ptr_dcc->status == IRC_DCC_ACTIVE)
weechat_log_printf (_("Aborting active DCC: \"%s\" from %s\n"),
ptr_dcc->filename, ptr_dcc->nick);
- irc_dcc_close (ptr_dcc, DCC_FAILED);
+ irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
}
}
}
@@ -1900,7 +1900,7 @@ irc_dcc_print_log ()
{
t_irc_dcc *ptr_dcc;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
weechat_log_printf ("\n");
weechat_log_printf ("[DCC (addr:0x%X)]\n", ptr_dcc);
diff --git a/src/irc/irc-display.c b/src/irc/irc-display.c
index 2253df819..673430dc1 100644
--- a/src/irc/irc-display.c
+++ b/src/irc/irc-display.c
@@ -98,49 +98,49 @@ irc_display_prefix (t_irc_server *server, t_gui_buffer *buffer, char *prefix)
int type;
char format[32];
- type = MSG_TYPE_INFO | MSG_TYPE_PREFIX;
+ type = GUI_MSG_TYPE_INFO | GUI_MSG_TYPE_PREFIX;
- if (!cfg_log_plugin_msg && (prefix == PREFIX_PLUGIN))
- type |= MSG_TYPE_NOLOG;
+ if (!cfg_log_plugin_msg && (prefix == GUI_PREFIX_PLUGIN))
+ type |= GUI_MSG_TYPE_NOLOG;
if (buffer)
{
if (cfg_look_align_other
- && (BUFFER_IS_CHANNEL(buffer) || BUFFER_IS_PRIVATE(buffer)))
+ && (GUI_BUFFER_IS_CHANNEL(buffer) || GUI_BUFFER_IS_PRIVATE(buffer)))
{
snprintf (format, 32, "%%-%ds", cfg_look_align_size - 2);
- gui_printf_type (buffer, MSG_TYPE_NICK, format, " ");
+ gui_printf_type (buffer, GUI_MSG_TYPE_NICK, format, " ");
}
}
if (prefix[0] == prefix[2])
{
gui_printf_type (buffer, type, "%s%c%s%c%s%c ",
- GUI_COLOR(COLOR_WIN_CHAT_PREFIX1),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_PREFIX1),
prefix[0],
- GUI_COLOR(COLOR_WIN_CHAT_PREFIX2),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_PREFIX2),
prefix[1],
- GUI_COLOR(COLOR_WIN_CHAT_PREFIX1),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_PREFIX1),
prefix[2]);
}
else
{
- if (strcmp (prefix, PREFIX_JOIN) == 0)
+ if (strcmp (prefix, GUI_PREFIX_JOIN) == 0)
gui_printf_type (buffer, type, "%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT_JOIN), prefix);
- else if (strcmp (prefix, PREFIX_PART) == 0)
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_JOIN), prefix);
+ else if (strcmp (prefix, GUI_PREFIX_PART) == 0)
gui_printf_type (buffer, type, "%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT_PART), prefix);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_PART), prefix);
else
gui_printf_type (buffer, type, "%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT_PREFIX1), prefix);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_PREFIX1), prefix);
}
if (server && (server->buffer == buffer) && buffer->all_servers)
{
gui_printf_type (buffer, type, "%s[%s%s%s] ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER), server->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER), server->name,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
gui_printf_type (buffer, type, GUI_NO_COLOR);
}
@@ -164,7 +164,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
if (!ptr_nickname)
return;
nickname_length = utf8_width_screen (ptr_nickname);
- external_nick = (!nick && !BUFFER_IS_PRIVATE(buffer));
+ external_nick = (!nick && !GUI_BUFFER_IS_PRIVATE(buffer));
disable_prefix_suffix = ((cfg_look_align_nick != CFG_LOOK_ALIGN_NICK_NONE)
&& ((int)strlen (cfg_look_nick_prefix) +
(int)strlen (cfg_look_nick_suffix) > max_align - 4));
@@ -177,8 +177,9 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
length += 2;
if (nick && cfg_look_nickmode)
{
- if (nick->flags & (NICK_CHANOWNER | NICK_CHANADMIN | NICK_CHANADMIN2 |
- NICK_OP | NICK_HALFOP | NICK_VOICE | NICK_CHANUSER))
+ if (nick->flags & (IRC_NICK_CHANOWNER | IRC_NICK_CHANADMIN |
+ IRC_NICK_CHANADMIN2 | IRC_NICK_OP | IRC_NICK_HALFOP |
+ IRC_NICK_VOICE | IRC_NICK_CHANUSER))
length += 1;
else if (cfg_look_nickmode_empty && !no_nickmode)
length += 1;
@@ -202,7 +203,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
if (display_around && !disable_prefix_suffix
&& cfg_look_nick_prefix && cfg_look_nick_prefix[0])
gui_printf_type (buffer, type, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
cfg_look_nick_prefix);
/* display spaces before nick, if needed */
@@ -217,36 +218,36 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
/* display nick mode */
if (nick && cfg_look_nickmode)
{
- if (nick->flags & NICK_CHANOWNER)
+ if (nick->flags & IRC_NICK_CHANOWNER)
gui_printf_type (buffer, type, "%s~",
- GUI_COLOR(COLOR_WIN_NICK_OP));
- else if (nick->flags & NICK_CHANADMIN)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_OP));
+ else if (nick->flags & IRC_NICK_CHANADMIN)
gui_printf_type (buffer, type, "%s&",
- GUI_COLOR(COLOR_WIN_NICK_OP));
- else if (nick->flags & NICK_CHANADMIN2)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_OP));
+ else if (nick->flags & IRC_NICK_CHANADMIN2)
gui_printf_type (buffer, type, "%s!",
- GUI_COLOR(COLOR_WIN_NICK_OP));
- else if (nick->flags & NICK_OP)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_OP));
+ else if (nick->flags & IRC_NICK_OP)
gui_printf_type (buffer, type, "%s@",
- GUI_COLOR(COLOR_WIN_NICK_OP));
- else if (nick->flags & NICK_HALFOP)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_OP));
+ else if (nick->flags & IRC_NICK_HALFOP)
gui_printf_type (buffer, type, "%s%%",
- GUI_COLOR(COLOR_WIN_NICK_HALFOP));
- else if (nick->flags & NICK_VOICE)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_HALFOP));
+ else if (nick->flags & IRC_NICK_VOICE)
gui_printf_type (buffer, type, "%s+",
- GUI_COLOR(COLOR_WIN_NICK_VOICE));
- else if (nick->flags & NICK_CHANUSER)
+ GUI_COLOR(GUI_COLOR_WIN_NICK_VOICE));
+ else if (nick->flags & IRC_NICK_CHANUSER)
gui_printf_type (buffer, type, "%s-",
- GUI_COLOR(COLOR_WIN_NICK_CHANUSER));
+ GUI_COLOR(GUI_COLOR_WIN_NICK_CHANUSER));
else if (cfg_look_nickmode_empty && !no_nickmode)
gui_printf_type (buffer, type, "%s ",
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
/* display nick */
if (external_nick)
gui_printf_type (buffer, type, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
"(");
if (display_around && (spaces < 0))
{
@@ -266,21 +267,21 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
"%s%s",
(force_color >= 0) ?
GUI_COLOR(force_color) :
- GUI_COLOR((nick) ? nick->color : COLOR_WIN_CHAT),
+ GUI_COLOR((nick) ? nick->color : GUI_COLOR_WIN_CHAT),
ptr_nickname);
else
gui_printf_type (buffer, type,
"%s%s",
(force_color >= 0) ?
GUI_COLOR(force_color) :
- GUI_COLOR((nick) ? nick->color : COLOR_WIN_CHAT),
+ GUI_COLOR((nick) ? nick->color : GUI_COLOR_WIN_CHAT),
ptr_nickname);
if (display_around && (spaces < 0))
gui_printf_type (buffer, type, "%s+",
- GUI_COLOR(COLOR_WIN_NICK_MORE));
+ GUI_COLOR(GUI_COLOR_WIN_NICK_MORE));
if (external_nick)
gui_printf_type (buffer, type, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
")");
/* display spaces after nick, if needed */
@@ -296,7 +297,7 @@ irc_display_nick (t_gui_buffer *buffer, t_irc_nick *nick, char *nickname,
if (display_around && !disable_prefix_suffix
&& cfg_look_nick_suffix && cfg_look_nick_suffix[0])
gui_printf_type (buffer, type, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
cfg_look_nick_suffix);
gui_printf_type (buffer, type, "%s%s",
@@ -318,23 +319,23 @@ irc_display_away (t_irc_server *server, char *string1, char *string2)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
if (cfg_look_align_other)
{
snprintf (format, 32, "%%-%ds", cfg_look_align_size + 1);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_NICK,
format, " ");
}
gui_printf_nolog (ptr_channel->buffer,
"%s[%s%s%s %s: %s%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
server->nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
string1,
string2,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
}
@@ -348,29 +349,29 @@ irc_display_mode (t_irc_server *server, t_gui_buffer *buffer,
char *channel_name, char *nick_name, char set_flag,
char *symbol, char *nick_host, char *message, char *param)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
gui_printf (buffer, "%s[%s%s%s/%s%c%s%s] %s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
(channel_name) ?
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL) :
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL) :
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
(channel_name) ? channel_name : nick_name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
set_flag,
symbol,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick_host);
if (param)
gui_printf (buffer, " %s%s %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
message,
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
param);
else
gui_printf (buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
message);
}
@@ -388,14 +389,14 @@ irc_display_server (t_irc_server *server, int with_detail)
{
gui_printf (NULL, "\n");
gui_printf (NULL, _("%sServer: %s%s %s[%s%s%s]\n"),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(server->is_connected) ?
_("connected") : _("not connected"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
gui_printf (NULL, " server_autoconnect . . . . : %s%s\n",
(server->autoconnect) ? _("on") : _("off"),
@@ -419,11 +420,11 @@ irc_display_server (t_irc_server *server, int with_detail)
_("(hidden)") : "");
gui_printf (NULL, " server_nick1/2/3 . . . . . : %s %s/ %s%s %s/ %s%s\n",
server->nick1,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
server->nick2,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
server->nick3);
gui_printf (NULL, " server_username . . . . . : %s\n",
server->username);
@@ -461,11 +462,11 @@ irc_display_server (t_irc_server *server, int with_detail)
{
gui_printf (NULL, " %s %s%s ",
(server->is_connected) ? "*" : " ",
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server->name);
gui_printf (NULL, "%s[%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(server->is_connected) ?
_("connected") : _("not connected"));
if (server->is_connected)
@@ -479,8 +480,8 @@ irc_display_server (t_irc_server *server, int with_detail)
gui_printf (NULL, _("%d pv"), num_pv);
}
gui_printf (NULL, "%s]%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(server->temp_server) ? _(" (temporary)") : "");
}
}
diff --git a/src/irc/irc-ignore.c b/src/irc/irc-ignore.c
index 467e09c39..f80be928d 100644
--- a/src/irc/irc-ignore.c
+++ b/src/irc/irc-ignore.c
@@ -33,9 +33,6 @@
#include "../common/util.h"
-char *ignore_types[] =
-{ IGNORE_ACTION, IGNORE_CTCP, IGNORE_DCC, IGNORE_PRIVATE, NULL };
-
t_irc_ignore *irc_ignore = NULL;
t_irc_ignore *last_irc_ignore = NULL;
@@ -193,7 +190,7 @@ irc_ignore_add (char *mask, char *type, char *channel_name, char *server_name)
if (!mask || !mask[0] || !type || !type[0] || !channel_name || !channel_name[0]
|| !server_name || !server_name[0])
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s too few arguments for ignore\n"),
WEECHAT_ERROR);
@@ -211,7 +208,7 @@ irc_ignore_add (char *mask, char *type, char *channel_name, char *server_name)
if ((strcmp (mask, "*") == 0) && (strcmp (type, "*") == 0))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s mask or type/command should be non generic value for ignore\n"),
WEECHAT_ERROR);
@@ -220,7 +217,7 @@ irc_ignore_add (char *mask, char *type, char *channel_name, char *server_name)
if (irc_ignore_search (mask, type, channel_name, server_name))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s ignore already exists\n"),
WEECHAT_ERROR);
@@ -247,7 +244,7 @@ irc_ignore_add (char *mask, char *type, char *channel_name, char *server_name)
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s not enough memory to create ignore\n"),
WEECHAT_ERROR);
@@ -370,7 +367,7 @@ irc_ignore_search_free (char *mask, char *type,
found++;
if (found == 1)
gui_printf (NULL, "\n");
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
next_ignore = ptr_ignore->next_ignore;
irc_ignore_free (ptr_ignore);
@@ -406,7 +403,7 @@ irc_ignore_search_free_by_number (int number)
if (i == number)
{
gui_printf (NULL, "\n");
- irc_display_prefix (NULL, NULL, PREFIX_INFO);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_INFO);
weechat_cmd_ignore_display (_("Removing ignore:"), ptr_ignore);
irc_ignore_free (ptr_ignore);
return 1;
diff --git a/src/irc/irc-mode.c b/src/irc/irc-mode.c
index ba76c7dfc..6b12bb9b5 100644
--- a/src/irc/irc-mode.c
+++ b/src/irc/irc-mode.c
@@ -47,7 +47,7 @@ irc_mode_channel_set_nick (t_irc_channel *channel, char *nick,
ptr_nick = irc_nick_search (channel, nick);
if (ptr_nick)
{
- NICK_SET_FLAG(ptr_nick, (set_flag == '+'), flag);
+ IRC_NICK_SET_FLAG(ptr_nick, (set_flag == '+'), flag);
irc_nick_resort (channel, ptr_nick);
gui_nicklist_draw (channel->buffer, 1, 1);
}
@@ -124,14 +124,14 @@ irc_mode_channel_set (t_irc_server *server, t_irc_channel *channel,
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '~'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_CHANADMIN);
+ set_flag, IRC_NICK_CHANADMIN);
break;
case 'h': /* half-op */
ptr_arg = ((argc > 0) && (current_arg >= 0)) ?
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '%'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_HALFOP);
+ set_flag, IRC_NICK_HALFOP);
break;
case 'k': /* channel key */
if (channel->key)
@@ -163,28 +163,28 @@ irc_mode_channel_set (t_irc_server *server, t_irc_channel *channel,
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '@'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_OP);
+ set_flag, IRC_NICK_OP);
break;
case 'q': /* channel owner (unrealircd specific flag) */
ptr_arg = ((argc > 0) && (current_arg >= 0)) ?
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '~'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_CHANOWNER);
+ set_flag, IRC_NICK_CHANOWNER);
break;
case 'u': /* channel user */
ptr_arg = ((argc > 0) && (current_arg >= 0)) ?
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '-'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_CHANUSER);
+ set_flag, IRC_NICK_CHANUSER);
break;
case 'v': /* voice */
ptr_arg = ((argc > 0) && (current_arg >= 0)) ?
argv[current_arg--] : NULL;
if (irc_mode_nick_prefix_allowed (server, '+'))
irc_mode_channel_set_nick (channel, ptr_arg,
- set_flag, NICK_VOICE);
+ set_flag, IRC_NICK_VOICE);
break;
}
break;
diff --git a/src/irc/irc-nick.c b/src/irc/irc-nick.c
index 7adf1152d..9f07c673e 100644
--- a/src/irc/irc-nick.c
+++ b/src/irc/irc-nick.c
@@ -51,7 +51,7 @@ irc_nick_find_color (t_irc_nick *nick)
}
color = (color % cfg_look_color_nicks_number);
- return COLOR_WIN_NICK_1 + color;
+ return GUI_COLOR_WIN_NICK_1 + color;
}
/*
@@ -61,19 +61,19 @@ irc_nick_find_color (t_irc_nick *nick)
int
irc_nick_score_for_sort (t_irc_nick *nick)
{
- if (nick->flags & NICK_CHANOWNER)
+ if (nick->flags & IRC_NICK_CHANOWNER)
return -128;
- if (nick->flags & NICK_CHANADMIN)
+ if (nick->flags & IRC_NICK_CHANADMIN)
return -64;
- if (nick->flags & NICK_CHANADMIN2)
+ if (nick->flags & IRC_NICK_CHANADMIN2)
return -32;
- if (nick->flags & NICK_OP)
+ if (nick->flags & IRC_NICK_OP)
return -16;
- if (nick->flags & NICK_HALFOP)
+ if (nick->flags & IRC_NICK_HALFOP)
return -8;
- if (nick->flags & NICK_VOICE)
+ if (nick->flags & IRC_NICK_VOICE)
return -4;
- if (nick->flags & NICK_CHANUSER)
+ if (nick->flags & IRC_NICK_CHANUSER)
return -2;
return 0;
}
@@ -205,13 +205,13 @@ irc_nick_new (t_irc_server *server, t_irc_channel *channel, char *nick_name,
if ((new_nick = irc_nick_search (channel, nick_name)))
{
/* update nick */
- NICK_SET_FLAG(new_nick, is_chanowner, NICK_CHANOWNER);
- NICK_SET_FLAG(new_nick, is_chanadmin, NICK_CHANADMIN);
- NICK_SET_FLAG(new_nick, is_chanadmin2, NICK_CHANADMIN2);
- NICK_SET_FLAG(new_nick, is_op, NICK_OP);
- NICK_SET_FLAG(new_nick, is_halfop, NICK_HALFOP);
- NICK_SET_FLAG(new_nick, has_voice, NICK_VOICE);
- NICK_SET_FLAG(new_nick, is_chanuser, NICK_CHANUSER);
+ IRC_NICK_SET_FLAG(new_nick, is_chanowner, IRC_NICK_CHANOWNER);
+ IRC_NICK_SET_FLAG(new_nick, is_chanadmin, IRC_NICK_CHANADMIN);
+ IRC_NICK_SET_FLAG(new_nick, is_chanadmin2, IRC_NICK_CHANADMIN2);
+ IRC_NICK_SET_FLAG(new_nick, is_op, IRC_NICK_OP);
+ IRC_NICK_SET_FLAG(new_nick, is_halfop, IRC_NICK_HALFOP);
+ IRC_NICK_SET_FLAG(new_nick, has_voice, IRC_NICK_VOICE);
+ IRC_NICK_SET_FLAG(new_nick, is_chanuser, IRC_NICK_CHANUSER);
irc_nick_resort (channel, new_nick);
return new_nick;
}
@@ -224,15 +224,15 @@ irc_nick_new (t_irc_server *server, t_irc_channel *channel, char *nick_name,
new_nick->nick = strdup (nick_name);
new_nick->host = NULL;
new_nick->flags = 0;
- NICK_SET_FLAG(new_nick, is_chanowner, NICK_CHANOWNER);
- NICK_SET_FLAG(new_nick, is_chanadmin, NICK_CHANADMIN);
- NICK_SET_FLAG(new_nick, is_chanadmin2, NICK_CHANADMIN2);
- NICK_SET_FLAG(new_nick, is_op, NICK_OP);
- NICK_SET_FLAG(new_nick, is_halfop, NICK_HALFOP);
- NICK_SET_FLAG(new_nick, has_voice, NICK_VOICE);
- NICK_SET_FLAG(new_nick, is_chanuser, NICK_CHANUSER);
+ IRC_NICK_SET_FLAG(new_nick, is_chanowner, IRC_NICK_CHANOWNER);
+ IRC_NICK_SET_FLAG(new_nick, is_chanadmin, IRC_NICK_CHANADMIN);
+ IRC_NICK_SET_FLAG(new_nick, is_chanadmin2, IRC_NICK_CHANADMIN2);
+ IRC_NICK_SET_FLAG(new_nick, is_op, IRC_NICK_OP);
+ IRC_NICK_SET_FLAG(new_nick, is_halfop, IRC_NICK_HALFOP);
+ IRC_NICK_SET_FLAG(new_nick, has_voice, IRC_NICK_VOICE);
+ IRC_NICK_SET_FLAG(new_nick, is_chanuser, IRC_NICK_CHANUSER);
if (ascii_strcasecmp (new_nick->nick, server->nick) == 0)
- new_nick->color = COLOR_WIN_NICK_SELF;
+ new_nick->color = GUI_COLOR_WIN_NICK_SELF;
else
new_nick->color = irc_nick_find_color (new_nick);
@@ -256,7 +256,7 @@ irc_nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick)
int nick_is_me;
t_weelist *ptr_weelist;
- nick_is_me = (strcmp (nick->nick, SERVER(channel->buffer)->nick) == 0) ? 1 : 0;
+ nick_is_me = (strcmp (nick->nick, GUI_SERVER(channel->buffer)->nick) == 0) ? 1 : 0;
if (!nick_is_me && channel->nicks_speaking)
{
@@ -273,7 +273,7 @@ irc_nick_change (t_irc_channel *channel, t_irc_nick *nick, char *new_nick)
free (nick->nick);
nick->nick = strdup (new_nick);
if (nick_is_me)
- nick->color = COLOR_WIN_NICK_SELF;
+ nick->color = GUI_COLOR_WIN_NICK_SELF;
else
nick->color = irc_nick_find_color (nick);
@@ -378,18 +378,18 @@ irc_nick_count (t_irc_channel *channel, int *total, int *count_op,
ptr_nick = ptr_nick->next_nick)
{
(*total)++;
- if ((ptr_nick->flags & NICK_CHANOWNER) ||
- (ptr_nick->flags & NICK_CHANADMIN) ||
- (ptr_nick->flags & NICK_CHANADMIN2) ||
- (ptr_nick->flags & NICK_OP))
+ if ((ptr_nick->flags & IRC_NICK_CHANOWNER) ||
+ (ptr_nick->flags & IRC_NICK_CHANADMIN) ||
+ (ptr_nick->flags & IRC_NICK_CHANADMIN2) ||
+ (ptr_nick->flags & IRC_NICK_OP))
(*count_op)++;
else
{
- if (ptr_nick->flags & NICK_HALFOP)
+ if (ptr_nick->flags & IRC_NICK_HALFOP)
(*count_halfop)++;
else
{
- if (ptr_nick->flags & NICK_VOICE)
+ if (ptr_nick->flags & IRC_NICK_VOICE)
(*count_voice)++;
else
(*count_normal)++;
@@ -429,10 +429,10 @@ irc_nick_set_away (t_irc_channel *channel, t_irc_nick *nick, int is_away)
&& ((cfg_irc_away_check_max_nicks == 0) ||
(channel->nicks_count <= cfg_irc_away_check_max_nicks)))
{
- if (((is_away) && (!(nick->flags & NICK_AWAY))) ||
- ((!is_away) && (nick->flags & NICK_AWAY)))
+ if (((is_away) && (!(nick->flags & IRC_NICK_AWAY))) ||
+ ((!is_away) && (nick->flags & IRC_NICK_AWAY)))
{
- NICK_SET_FLAG(nick, is_away, NICK_AWAY);
+ IRC_NICK_SET_FLAG(nick, is_away, IRC_NICK_AWAY);
gui_nicklist_draw (channel->buffer, 0, 0);
}
}
diff --git a/src/irc/irc-recv.c b/src/irc/irc-recv.c
index 03960d788..ec081004e 100644
--- a/src/irc/irc-recv.c
+++ b/src/irc/irc-recv.c
@@ -353,9 +353,9 @@ irc_recv_cmd_error (t_irc_server *server, char *host, char *nick, char *argument
{
arguments++;
if (first)
- irc_display_prefix (server, ptr_buffer, PREFIX_ERROR);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_ERROR);
gui_printf (ptr_buffer, "%s%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(first) ? "" : ": ",
arguments);
if (strncmp (arguments, "Closing Link", 12) == 0)
@@ -374,10 +374,10 @@ irc_recv_cmd_error (t_irc_server *server, char *host, char *nick, char *argument
ptr_channel = irc_channel_search (server, arguments);
if (ptr_channel)
ptr_buffer = ptr_channel->buffer;
- irc_display_prefix (server, ptr_buffer, PREFIX_ERROR);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_ERROR);
}
gui_printf (ptr_buffer, "%s%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
(first) ? "" : " ",
arguments);
first = 0;
@@ -415,12 +415,12 @@ irc_recv_cmd_invite (t_irc_server *server, char *host, char *nick, char *argumen
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("You have been invited to %s%s%s by %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
if (gui_add_hotlist
&& ((server->buffer->num_displayed == 0) || (gui_buffer_is_scrolled (server->buffer))))
@@ -432,7 +432,7 @@ irc_recv_cmd_invite (t_irc_server *server, char *host, char *nick, char *argumen
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "invite");
@@ -456,7 +456,7 @@ irc_recv_cmd_join (t_irc_server *server, char *host, char *nick, char *arguments
/* no host => we can't identify sender of message! */
if (!host)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host\n"),
WEECHAT_ERROR, "join");
@@ -471,33 +471,33 @@ irc_recv_cmd_join (t_irc_server *server, char *host, char *nick, char *arguments
ptr_channel = irc_channel_search (server, arguments);
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (server, CHANNEL_TYPE_CHANNEL, arguments);
+ ptr_channel = irc_channel_new (server, IRC_CHANNEL_TYPE_CHANNEL, arguments);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create new channel \"%s\"\n"),
WEECHAT_ERROR, arguments);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel,
- BUFFER_TYPE_STANDARD, 1);
+ GUI_BUFFER_TYPE_STANDARD, 1);
}
pos = strchr (host, '!');
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_JOIN);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_JOIN);
gui_printf (ptr_channel->buffer,
_("%s%s %s(%s%s%s)%s has joined %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
(pos) ? pos + 1 : host,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments);
}
@@ -559,7 +559,7 @@ irc_recv_cmd_kick (t_irc_server *server, char *host, char *nick, char *arguments
ptr_channel = irc_channel_search (server, arguments);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, arguments, "kick");
@@ -568,29 +568,29 @@ irc_recv_cmd_kick (t_irc_server *server, char *host, char *nick, char *arguments
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_PART);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_PART);
gui_printf (ptr_channel->buffer, _("%s%s%s has kicked %s%s%s from %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments);
if (pos_comment)
gui_printf (ptr_channel->buffer, " %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_comment,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
else
gui_printf (ptr_channel->buffer, "\n");
}
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nick \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "kick");
@@ -658,20 +658,20 @@ irc_recv_cmd_kill (t_irc_server *server, char *host, char *nick, char *arguments
if (!command_ignored
&& !irc_ignore_check (host, "kill", ptr_channel->name, server->name))
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_PART);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_PART);
gui_printf (ptr_channel->buffer, _("%s%s%s has killed %s%s%s from server"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (pos_comment)
gui_printf (ptr_channel->buffer, " %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_comment,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
else
gui_printf (ptr_channel->buffer, "\n");
}
@@ -679,7 +679,7 @@ irc_recv_cmd_kill (t_irc_server *server, char *host, char *nick, char *arguments
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s host not found for \"%s\" command\n"),
WEECHAT_ERROR, "kill");
@@ -701,7 +701,7 @@ irc_recv_cmd_mode (t_irc_server *server, char *host, char *nick, char *arguments
/* no host => we can't identify sender of message! */
if (!host)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host\n"),
WEECHAT_ERROR, "mode");
@@ -711,7 +711,7 @@ irc_recv_cmd_mode (t_irc_server *server, char *host, char *nick, char *arguments
pos_modes = strchr (arguments, ' ');
if (!pos_modes)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without channel or nickname\n"),
WEECHAT_ERROR, "mode");
@@ -741,17 +741,17 @@ irc_recv_cmd_mode (t_irc_server *server, char *host, char *nick, char *arguments
ptr_channel->name, server->name);
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_INFO);
gui_printf (ptr_channel->buffer,
_("Mode %s%s %s[%s%s%s]%s by %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_channel->name,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_modes,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
}
irc_mode_channel_set (server, ptr_channel, pos_modes);
@@ -759,7 +759,7 @@ irc_recv_cmd_mode (t_irc_server *server, char *host, char *nick, char *arguments
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, arguments, "mode");
@@ -770,15 +770,15 @@ irc_recv_cmd_mode (t_irc_server *server, char *host, char *nick, char *arguments
{
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("User mode %s[%s%s%s]%s by %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_modes,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
}
irc_mode_user_set (server, pos_modes);
@@ -802,7 +802,7 @@ irc_recv_cmd_nick (t_irc_server *server, char *host, char *nick, char *arguments
/* no host => we can't identify sender of message! */
if (!host)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host\n"),
WEECHAT_ERROR, "nick");
@@ -816,16 +816,16 @@ irc_recv_cmd_nick (t_irc_server *server, char *host, char *nick, char *arguments
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)
{
- if ((SERVER(ptr_buffer) == server) && BUFFER_IS_PRIVATE(ptr_buffer))
+ if ((GUI_SERVER(ptr_buffer) == server) && GUI_BUFFER_IS_PRIVATE(ptr_buffer))
{
- if ((CHANNEL(ptr_buffer)->name)
- && (ascii_strcasecmp (nick, CHANNEL(ptr_buffer)->name) == 0))
+ if ((GUI_CHANNEL(ptr_buffer)->name)
+ && (ascii_strcasecmp (nick, GUI_CHANNEL(ptr_buffer)->name) == 0))
{
ptr_channel = irc_channel_search_any (server, arguments);
if (!ptr_channel)
{
- free (CHANNEL(ptr_buffer)->name);
- CHANNEL(ptr_buffer)->name = strdup (arguments);
+ free (GUI_CHANNEL(ptr_buffer)->name);
+ GUI_CHANNEL(ptr_buffer)->name = strdup (arguments);
}
}
}
@@ -844,17 +844,17 @@ irc_recv_cmd_nick (t_irc_server *server, char *host, char *nick, char *arguments
if (!command_ignored
&& !irc_ignore_check (host, "nick", ptr_channel->name, server->name))
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_INFO);
if (nick_is_me)
gui_printf (ptr_channel->buffer, _("You are now known as %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments);
else
gui_printf (ptr_channel->buffer, _("%s%s%s is now known as %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments);
}
gui_nicklist_draw (ptr_channel->buffer, 1, 1);
@@ -915,7 +915,7 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nickname not found for \"%s\" command\n"),
WEECHAT_ERROR, "notice");
@@ -930,13 +930,13 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
pos2 = strchr (pos, '\01');
if (pos2)
pos2[0] = '\0';
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("CTCP %sVERSION%s reply from %s%s%s: %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
}
else
@@ -964,13 +964,13 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
difftime = ((sec2 * 1000000) + usec2) - ((sec1 * 1000000) + usec1);
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("CTCP %sPING%s reply from %s%s%s: %ld.%ld seconds\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
difftime / 1000000,
(difftime % 1000000) / 1000);
}
@@ -983,17 +983,17 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
ptr_channel = irc_channel_search (server, nick);
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
+ ptr_channel = irc_channel_new (server, IRC_CHANNEL_TYPE_PRIVATE, nick);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create new private window \"%s\"\n"),
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel,
- BUFFER_TYPE_STANDARD, 0);
+ GUI_BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
{
@@ -1001,38 +1001,38 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
gui_chat_draw_title (ptr_channel->buffer, 1);
}
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_NICK,
"%s<",
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
if (irc_recv_is_highlight (pos, server->nick))
{
gui_printf_type (ptr_channel->buffer,
- MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
+ GUI_MSG_TYPE_NICK | GUI_MSG_TYPE_HIGHLIGHT,
"%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HIGHLIGHT),
nick);
if ( (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private %s> %s"),
nick, pos);
highlight = 1;
}
else
{
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_NICK,
"%s%s",
- GUI_COLOR(COLOR_WIN_NICK_PRIVATE),
+ GUI_COLOR(GUI_COLOR_WIN_NICK_PRIVATE),
nick);
highlight = 0;
}
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_NICK,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_NICK,
"%s> ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
#ifdef PLUGINS
if (highlight)
@@ -1043,22 +1043,22 @@ irc_recv_cmd_notice (t_irc_server *server, char *host, char *nick, char *argumen
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
if (host)
{
gui_printf (server->buffer, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_NICK), nick);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK), nick);
if (host2)
gui_printf (server->buffer, " %s(%s%s%s)",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
host2,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
gui_printf (server->buffer, "%s: ",
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
gui_printf (server->buffer, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
if ((nick) && (ascii_strcasecmp (nick, "nickserv") != 0) &&
(ascii_strcasecmp (nick, "chanserv") != 0) &&
@@ -1093,7 +1093,7 @@ irc_recv_cmd_part (t_irc_server *server, char *host, char *nick, char *arguments
/* no host => we can't identify sender of message! */
if (!host || !arguments)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host or channel\n"),
WEECHAT_ERROR, "part");
@@ -1125,23 +1125,23 @@ irc_recv_cmd_part (t_irc_server *server, char *host, char *nick, char *arguments
if (!command_ignored)
{
pos = strchr (host, '!');
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_PART);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_PART);
gui_printf (ptr_channel->buffer, _("%s%s %s(%s%s%s)%s has left %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
(pos) ? pos + 1 : "",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_channel->name);
if (pos_args && pos_args[0])
gui_printf (ptr_channel->buffer, " %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_args,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
else
gui_printf (ptr_channel->buffer, "\n");
}
@@ -1194,7 +1194,7 @@ irc_recv_cmd_part (t_irc_server *server, char *host, char *nick, char *arguments
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, arguments, "part");
@@ -1307,16 +1307,16 @@ irc_cmd_reply_version (t_irc_server *server, t_irc_channel *channel,
" compiled on %s%s",
nick, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
"\01");
- irc_display_prefix (server, ptr_buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_buffer,
_("CTCP %sVERSION%s received from %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
if (pos)
gui_printf (ptr_buffer, "%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
else
gui_printf (ptr_buffer, "\n");
@@ -1344,7 +1344,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
/* no host => we can't identify sender of message! */
if (!host)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host\n"),
WEECHAT_ERROR, "privmsg");
@@ -1382,23 +1382,23 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2[0] = '\0';
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_ACTION_ME);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_ACTION_ME);
if (irc_recv_is_highlight (pos, server->nick))
{
gui_printf_type (ptr_channel->buffer,
- MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
+ GUI_MSG_TYPE_MSG | GUI_MSG_TYPE_HIGHLIGHT,
"%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HIGHLIGHT),
nick);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel %s: * %s %s"),
ptr_channel->name, nick, pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT), pos);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
@@ -1407,12 +1407,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
}
else
{
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
gui_printf (ptr_channel->buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT), pos);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), pos);
}
irc_channel_add_nick_speaking (ptr_channel, nick);
}
@@ -1427,13 +1427,13 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2[0] = '\0';
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_channel->buffer,
_("Received a CTCP %sSOUND%s \"%s\" from %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos,
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
}
return 0;
@@ -1457,12 +1457,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
else
irc_server_sendf (server, "NOTICE %s :\01PING\01",
nick);
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_channel->buffer,
_("CTCP %sPING%s received from %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
return 0;
}
@@ -1491,17 +1491,17 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
}
if (!command_ignored)
{
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_channel->buffer,
_("Unknown CTCP %s%s%s received from %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
if (pos2)
gui_printf (ptr_channel->buffer, "%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos2);
else
gui_printf (ptr_channel->buffer, "\n");
@@ -1518,16 +1518,16 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
- MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT,
- 1, COLOR_WIN_CHAT_HIGHLIGHT, 0);
+ GUI_MSG_TYPE_NICK | GUI_MSG_TYPE_HIGHLIGHT,
+ 1, GUI_COLOR_WIN_CHAT_HIGHLIGHT, 0);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel %s: %s> %s"),
ptr_channel->name, nick, pos);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s\n", pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
@@ -1539,8 +1539,8 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
irc_display_nick (ptr_channel->buffer, ptr_nick,
(ptr_nick) ? NULL : nick,
- MSG_TYPE_NICK, 1, -1, 0);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ GUI_MSG_TYPE_NICK, 1, -1, 0);
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s\n", pos);
}
irc_channel_add_nick_speaking (ptr_channel, nick);
@@ -1548,7 +1548,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, arguments, "privmsg");
@@ -1597,12 +1597,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
else
irc_server_sendf (server, "NOTICE %s :\01PING\01",
nick);
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
_("CTCP %sPING%s received from %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
@@ -1620,7 +1620,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2 = strchr (pos + 1, '\01');
if (!pos2)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1641,7 +1641,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_size = strrchr (pos_file, ' ');
if (!pos_size)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1657,7 +1657,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_port = strrchr (pos_file, ' ');
if (!pos_port)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1673,7 +1673,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_addr = strrchr (pos_file, ' ');
if (!pos_addr)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1685,7 +1685,8 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2--;
pos2[1] = '\0';
- irc_dcc_add (server, DCC_FILE_RECV, strtoul (pos_addr, NULL, 10),
+ irc_dcc_add (server, IRC_DCC_FILE_RECV,
+ strtoul (pos_addr, NULL, 10),
atoi (pos_port), nick, -1, pos_file, NULL,
strtoul (pos_size, NULL, 10));
#ifdef PLUGINS
@@ -1704,7 +1705,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2 = strchr (pos + 1, '\01');
if (!pos2)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1725,7 +1726,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_start_resume = strrchr (pos_file, ' ');
if (!pos_start_resume)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1741,7 +1742,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_port = strrchr (pos_file, ' ');
if (!pos_port)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1771,7 +1772,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2 = strchr (pos + 1, '\01');
if (!pos2)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1792,7 +1793,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_start_resume = strrchr (pos_file, ' ');
if (!pos_start_resume)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1808,7 +1809,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_port = strrchr (pos_file, ' ');
if (!pos_port)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1838,7 +1839,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2 = strchr (pos + 1, '\01');
if (!pos2)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1859,7 +1860,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_addr = strchr (pos_file, ' ');
if (!pos_addr)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1874,7 +1875,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos_port = strchr (pos_addr, ' ');
if (!pos_port)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -1887,19 +1888,20 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if (ascii_strcasecmp (pos_file, "chat") != 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s unknown DCC CHAT type received from "),
WEECHAT_ERROR);
gui_printf (server->buffer, "%s%s%s: \"%s\"\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_file);
return -1;
}
- irc_dcc_add (server, DCC_CHAT_RECV, strtoul (pos_addr, NULL, 10),
+ irc_dcc_add (server, IRC_DCC_CHAT_RECV,
+ strtoul (pos_addr, NULL, 10),
atoi (pos_port), nick, -1, NULL, NULL, 0);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
@@ -1922,17 +1924,19 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
+ ptr_channel = irc_channel_new (server,
+ IRC_CHANNEL_TYPE_PRIVATE,
+ nick);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create new private window \"%s\"\n"),
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel,
- BUFFER_TYPE_STANDARD, 0);
+ GUI_BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
{
@@ -1944,23 +1948,23 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
pos2 = strchr (pos, '\01');
if (pos2)
pos2[0] = '\0';
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_ACTION_ME);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_ACTION_ME);
if (irc_recv_is_highlight (pos, server->nick))
{
gui_printf_type (ptr_channel->buffer,
- MSG_TYPE_MSG | MSG_TYPE_HIGHLIGHT,
+ GUI_MSG_TYPE_MSG | GUI_MSG_TYPE_HIGHLIGHT,
"%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_HIGHLIGHT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HIGHLIGHT),
nick);
if ( (cfg_look_infobar)
&& (cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer) )
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Channel %s: * %s %s"),
ptr_channel->name, nick, pos);
gui_printf (ptr_channel->buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT), pos);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_highlight",
@@ -1969,12 +1973,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
}
else
{
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
gui_printf (ptr_channel->buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT), pos);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
"weechat_pv",
@@ -2005,17 +2009,17 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if (!pos2[0])
pos2 = NULL;
}
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
_("Unknown CTCP %s%s%s received from %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick);
if (pos2)
gui_printf (server->buffer, "%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos2);
else
gui_printf (server->buffer, "\n");
@@ -2035,17 +2039,19 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
{
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (server, CHANNEL_TYPE_PRIVATE, nick);
+ ptr_channel = irc_channel_new (server,
+ IRC_CHANNEL_TYPE_PRIVATE,
+ nick);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create new private window \"%s\"\n"),
WEECHAT_ERROR, nick);
return -1;
}
gui_buffer_new (gui_current_window, server, ptr_channel,
- BUFFER_TYPE_STANDARD, 0);
+ GUI_BUFFER_TYPE_STANDARD, 0);
}
if (!ptr_channel->topic)
{
@@ -2056,12 +2062,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
if (irc_recv_is_highlight (pos, server->nick))
{
irc_display_nick (ptr_channel->buffer, NULL, nick,
- MSG_TYPE_NICK | MSG_TYPE_HIGHLIGHT, 1,
- COLOR_WIN_CHAT_HIGHLIGHT, 0);
+ GUI_MSG_TYPE_NICK | GUI_MSG_TYPE_HIGHLIGHT, 1,
+ GUI_COLOR_WIN_CHAT_HIGHLIGHT, 0);
if ((cfg_look_infobar_delay_highlight > 0)
&& (ptr_channel->buffer != gui_current_window->buffer))
gui_infobar_printf (cfg_look_infobar_delay_highlight,
- COLOR_WIN_INFOBAR_HIGHLIGHT,
+ GUI_COLOR_WIN_INFOBAR_HIGHLIGHT,
_("Private %s> %s"),
nick, pos);
highlight = 1;
@@ -2069,12 +2075,12 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
else
{
irc_display_nick (ptr_channel->buffer, NULL, nick,
- MSG_TYPE_NICK, 1, COLOR_WIN_NICK_PRIVATE, 0);
+ GUI_MSG_TYPE_NICK, 1, GUI_COLOR_WIN_NICK_PRIVATE, 0);
highlight = 0;
}
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
#ifdef PLUGINS
(void) plugin_msg_handler_exec (server->name,
@@ -2091,7 +2097,7 @@ irc_recv_cmd_privmsg (t_irc_server *server, char *host, char *nick, char *argume
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "privmsg");
@@ -2115,7 +2121,7 @@ irc_recv_cmd_quit (t_irc_server *server, char *host, char *nick, char *arguments
/* no host => we can't identify sender of message! */
if (!host)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without host\n"),
WEECHAT_ERROR, "quit");
@@ -2128,8 +2134,8 @@ irc_recv_cmd_quit (t_irc_server *server, char *host, char *nick, char *arguments
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if ((ptr_channel->type == CHANNEL_TYPE_PRIVATE)
- || (ptr_channel->type == CHANNEL_TYPE_DCC_CHAT))
+ if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
+ || (ptr_channel->type == IRC_CHANNEL_TYPE_DCC_CHAT))
ptr_nick = NULL;
else
ptr_nick = irc_nick_search (ptr_channel, nick);
@@ -2142,22 +2148,22 @@ irc_recv_cmd_quit (t_irc_server *server, char *host, char *nick, char *arguments
&& !irc_ignore_check (host, "quit", ptr_channel->name, server->name))
{
pos = strchr (host, '!');
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_QUIT);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_QUIT);
gui_printf (ptr_channel->buffer,
_("%s%s %s(%s%s%s)%s has quit"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
(pos) ? pos + 1 : "",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
gui_printf (ptr_channel->buffer,
" %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
gui_nicklist_draw (ptr_channel->buffer, 1, 1);
gui_status_draw (ptr_channel->buffer, 1);
@@ -2203,9 +2209,9 @@ irc_recv_cmd_server_mode_reason (t_irc_server *server, char *host,
ptr_msg++;
}
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT), arguments,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), arguments,
(ptr_msg) ? ptr_msg : "");
}
return 0;
@@ -2238,9 +2244,9 @@ irc_recv_cmd_server_msg (t_irc_server *server, char *host, char *nick, char *arg
if (arguments[0] == ':')
arguments++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT), arguments);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), arguments);
}
return 0;
}
@@ -2273,7 +2279,7 @@ irc_recv_cmd_server_reply (t_irc_server *server, char *host, char *nick, char *a
else
pos = arguments;
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
first = 1;
while (pos && pos[0])
@@ -2284,7 +2290,7 @@ irc_recv_cmd_server_reply (t_irc_server *server, char *host, char *nick, char *a
if (pos[0] == ':')
pos++;
gui_printf (server->buffer, "%s%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(first) ? "" : ": ",
pos);
pos = NULL;
@@ -2293,7 +2299,7 @@ irc_recv_cmd_server_reply (t_irc_server *server, char *host, char *nick, char *a
{
pos2[0] = '\0';
gui_printf (server->buffer, "%s%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
(first) ? "" : " ",
pos);
first = 0;
@@ -2317,7 +2323,7 @@ irc_recv_cmd_topic (t_irc_server *server, char *host, char *nick, char *argument
if (!irc_channel_is_channel (arguments))
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command received without channel\n"),
WEECHAT_ERROR, "topic");
@@ -2344,26 +2350,26 @@ irc_recv_cmd_topic (t_irc_server *server, char *host, char *nick, char *argument
if (!command_ignored)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
if (pos)
{
gui_printf (buffer,
_("%s%s%s has changed topic for %s%s%s to:"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
gui_printf (buffer, " \"%s%s\"\n", pos, GUI_NO_COLOR);
}
else
gui_printf (buffer,
_("%s%s%s has unset topic for %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments);
}
@@ -2392,14 +2398,14 @@ irc_recv_cmd_wallops (t_irc_server *server, char *host, char *nick, char *argume
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
if (arguments[0] == ':')
arguments++;
gui_printf (server->buffer,
_("WALLOPS from %s%s%s: %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
arguments);
}
@@ -2463,7 +2469,7 @@ irc_recv_cmd_001 (t_irc_server *server, char *host, char *nick, char *arguments)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
if (ptr_channel->key)
irc_server_sendf (server, "JOIN %s %s",
@@ -2557,21 +2563,21 @@ irc_recv_cmd_221 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
_("User mode for %s%s%s is %s[%s%s%s]\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_mode,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "221");
@@ -2621,12 +2627,12 @@ irc_recv_cmd_301 (t_irc_server *server, char *host, char *nick, char *arguments)
(strcmp (ptr_channel->away_message, pos_message) != 0))
{
ptr_buffer = (ptr_channel) ? ptr_channel->buffer : server->buffer;
- irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_INFO);
gui_printf (ptr_buffer,
_("%s%s%s is away: %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_message);
if (ptr_channel)
{
@@ -2680,12 +2686,12 @@ irc_recv_cmd_302 (t_irc_server *server, char *host, char *nick, char *arguments)
ptr_next++;
}
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s%s%s=%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_host);
}
else
@@ -2714,7 +2720,7 @@ irc_recv_cmd_303 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("Users online: "));
arguments = strchr (arguments, ' ');
@@ -2735,7 +2741,7 @@ irc_recv_cmd_303 (t_irc_server *server, char *host, char *nick, char *arguments)
ptr_next++;
}
gui_printf (server->buffer, "%s%s ",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments);
arguments = ptr_next;
if (arguments && !arguments[0])
@@ -2769,7 +2775,7 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
arguments++;
if (arguments[0] == ':')
arguments++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", arguments);
}
}
@@ -2777,7 +2783,7 @@ irc_recv_cmd_305 (t_irc_server *server, char *host, char *nick, char *arguments)
server->away_time = 0;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
- if (SERVER(ptr_win->buffer) == server)
+ if (GUI_SERVER(ptr_win->buffer) == server)
gui_status_draw (ptr_win->buffer, 1);
}
return 0;
@@ -2805,7 +2811,7 @@ irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
arguments++;
if (arguments[0] == ':')
arguments++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", arguments);
}
}
@@ -2813,9 +2819,9 @@ irc_recv_cmd_306 (t_irc_server *server, char *host, char *nick, char *arguments)
server->away_time = time (NULL);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
- if (SERVER(ptr_win->buffer) == server)
+ if (GUI_SERVER(ptr_win->buffer) == server)
gui_status_draw (ptr_win->buffer, 1);
- if (SERVER(ptr_win->buffer) == server)
+ if (GUI_SERVER(ptr_win->buffer) == server)
ptr_win->buffer->last_read_line =
ptr_win->buffer->last_line;
}
@@ -2852,13 +2858,13 @@ irc_recv_cmd_whois_nick_msg (t_irc_server *server, char *host, char *nick, char
if (pos_msg[0] == ':')
pos_msg++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s[%s%s%s] %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_msg);
}
}
@@ -2887,13 +2893,13 @@ irc_recv_cmd_310 (t_irc_server *server, char *host, char *nick, char *arguments)
while (pos_nick[0] == ' ')
pos_nick++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("%s[%s%s%s]%s help mode (+h)\n"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
}
return 0;
@@ -2947,18 +2953,18 @@ irc_recv_cmd_311 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_realname[0] == ':')
pos_realname++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
"%s[%s%s%s] (%s%s@%s%s)%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_user,
pos_host,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_realname);
}
}
@@ -3005,19 +3011,19 @@ irc_recv_cmd_312 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_serverinfo[0] == ':')
pos_serverinfo++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
"%s[%s%s%s] %s%s %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_server,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_serverinfo,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
}
@@ -3076,17 +3082,17 @@ irc_recv_cmd_314 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_realname[0] == ':')
pos_realname++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
_("%s%s %s(%s%s@%s%s)%s was %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_user,
pos_host,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_realname);
}
}
@@ -3132,11 +3138,11 @@ irc_recv_cmd_315 (t_irc_server *server, char *host, char *nick, char *arguments)
}
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s%s %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
}
}
@@ -3144,7 +3150,7 @@ irc_recv_cmd_315 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", arguments);
}
}
@@ -3198,37 +3204,37 @@ irc_recv_cmd_317 (t_irc_server *server, char *host, char *nick, char *arguments)
min = ((idle_time % (60 * 60 * 24)) % (60 * 60)) / 60;
sec = ((idle_time % (60 * 60 * 24)) % (60 * 60)) % 60;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("%s[%s%s%s]%s idle: "),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (day > 0)
gui_printf (server->buffer, "%s%d %s%s, ",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
day,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(day > 1) ? _("days") : _("day"));
datetime = (time_t)(atol (pos_signon));
gui_printf (server->buffer,
_("%s%02d %s%s %s%02d %s%s %s%02d %s%s, signon at: %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
hour,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(hour > 1) ? _("hours") : _("hour"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
min,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(min > 1) ? _("minutes") : _("minute"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
sec,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(sec > 1) ? _("seconds") : _("second"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ctime (&datetime));
}
}
@@ -3269,13 +3275,13 @@ irc_recv_cmd_319 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_channel[0] == ':')
pos_channel++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s[%s%s%s]%s Channels: ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
while (pos_channel && pos_channel[0])
{
if (irc_mode_nick_prefix_allowed (server, pos_channel[0]))
@@ -3283,32 +3289,32 @@ irc_recv_cmd_319 (t_irc_server *server, char *host, char *nick, char *arguments)
switch (pos_channel[0])
{
case '@': /* op */
- color = COLOR_WIN_NICK_OP;
+ color = GUI_COLOR_WIN_NICK_OP;
break;
case '%': /* half-op */
- color = COLOR_WIN_NICK_HALFOP;
+ color = GUI_COLOR_WIN_NICK_HALFOP;
break;
case '+': /* voice */
- color = COLOR_WIN_NICK_VOICE;
+ color = GUI_COLOR_WIN_NICK_VOICE;
break;
case '~': /* channel owner */
- color = COLOR_WIN_NICK_CHANOWNER;
+ color = GUI_COLOR_WIN_NICK_CHANOWNER;
break;
case '&': /* channel admin */
- color = COLOR_WIN_NICK_CHANADMIN;
+ color = GUI_COLOR_WIN_NICK_CHANADMIN;
break;
case '!': /* channel admin (2) */
- color = COLOR_WIN_NICK_CHANADMIN;
+ color = GUI_COLOR_WIN_NICK_CHANADMIN;
break;
case '-': /* channel user */
- color = COLOR_WIN_NICK_CHANUSER;
+ color = GUI_COLOR_WIN_NICK_CHANUSER;
break;
default:
- color = COLOR_WIN_CHAT;
+ color = GUI_COLOR_WIN_CHAT;
break;
}
gui_printf (server->buffer, "%s%c",
- GUI_COLOR(COLOR_WIN_NICK_OP),
+ GUI_COLOR(GUI_COLOR_WIN_NICK_OP),
pos_channel[0]);
pos_channel++;
}
@@ -3322,7 +3328,7 @@ irc_recv_cmd_319 (t_irc_server *server, char *host, char *nick, char *arguments)
pos++;
}
gui_printf (server->buffer, "%s%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
(pos && pos[0]) ? " " : "\n");
pos_channel = pos;
@@ -3359,7 +3365,7 @@ irc_recv_cmd_321 (t_irc_server *server, char *host, char *nick, char *arguments)
else
pos = arguments;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", pos);
}
return 0;
@@ -3394,13 +3400,13 @@ irc_recv_cmd_322 (t_irc_server *server, char *host, char *nick, char *arguments)
if (server->cmd_list_regexp)
{
if (regexec (server->cmd_list_regexp, pos, 0, NULL, 0) == 0) {
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", pos);
}
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", pos);
}
}
@@ -3433,7 +3439,7 @@ irc_recv_cmd_323 (t_irc_server *server, char *host, char *nick, char *arguments)
else
pos = arguments;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", pos);
}
return 0;
@@ -3550,21 +3556,21 @@ irc_recv_cmd_327 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_other++;
}
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
"%s[%s%s%s] %s%s %s %s%s%s%s%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_host1,
pos_host2,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
(pos_other) ? "(" : "",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(pos_other) ? pos_other : "",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
(pos_other) ? ")" : "");
}
}
@@ -3603,7 +3609,7 @@ irc_recv_cmd_329 (t_irc_server *server, char *host, char *nick, char *arguments)
ptr_channel = irc_channel_search (server, pos_channel);
if (!ptr_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, pos_channel, "329");
@@ -3615,7 +3621,7 @@ irc_recv_cmd_329 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored && (ptr_channel->display_creation_date))
{
datetime = (time_t)(atol (pos_date));
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_INFO);
gui_printf (ptr_channel->buffer, _("Channel created on %s"),
ctime (&datetime));
}
@@ -3623,7 +3629,7 @@ irc_recv_cmd_329 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify date/time for \"%s\" command\n"),
WEECHAT_ERROR, "329");
@@ -3632,7 +3638,7 @@ irc_recv_cmd_329 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "329");
@@ -3669,7 +3675,7 @@ irc_recv_cmd_331 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s channel \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, "", "331");
@@ -3684,10 +3690,10 @@ irc_recv_cmd_331 (t_irc_server *server, char *host, char *nick, char *arguments)
{
irc_display_prefix (server,
(ptr_channel) ? ptr_channel->buffer : NULL,
- PREFIX_INFO);
+ GUI_PREFIX_INFO);
gui_printf ((ptr_channel) ? ptr_channel->buffer : NULL,
_("No topic set for %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel);
}
}
@@ -3735,11 +3741,11 @@ irc_recv_cmd_332 (t_irc_server *server, char *host, char *nick, char *arguments)
command_ignored |= irc_ignore_check (host, "332", pos, server->name);
if (!command_ignored)
{
- irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_INFO);
gui_printf (ptr_buffer, _("Topic for %s%s%s is: "),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
gui_printf (ptr_buffer, "\"%s%s\"\n", pos2, GUI_NO_COLOR);
}
@@ -3749,7 +3755,7 @@ irc_recv_cmd_332 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "332");
@@ -3802,17 +3808,17 @@ irc_recv_cmd_333 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
datetime = (time_t)(atol (pos_date));
- irc_display_prefix (server, ptr_buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_INFO);
gui_printf (ptr_buffer, _("Topic set by %s%s%s, %s"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ctime (&datetime));
}
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify date/time for \"%s\" command\n"),
WEECHAT_ERROR, "333");
@@ -3821,7 +3827,7 @@ irc_recv_cmd_333 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify nickname for \"%s\" command\n"),
WEECHAT_ERROR, "333");
@@ -3830,7 +3836,7 @@ irc_recv_cmd_333 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "333");
@@ -3876,17 +3882,17 @@ irc_recv_cmd_338 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_message[0] == ':')
pos_message++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s[%s%s%s] %s%s %s%s %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_message,
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_host);
}
}
@@ -3926,22 +3932,22 @@ irc_recv_cmd_341 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_channel[0] == ':')
pos_channel++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer,
_("%s%s%s has invited %s%s%s on %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel);
gui_status_draw (gui_current_window->buffer, 1);
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify channel for \"%s\" command\n"),
WEECHAT_ERROR, "341");
@@ -3950,7 +3956,7 @@ irc_recv_cmd_341 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot identify nickname for \"%s\" command\n"),
WEECHAT_ERROR, "341");
@@ -3987,12 +3993,12 @@ irc_recv_cmd_344 (t_irc_server *server, char *host, char *nick, char *arguments)
while (pos_host[0] == ' ')
pos_host++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, _("Channel reop %s%s%s: %s%s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_host);
}
}
@@ -4028,11 +4034,11 @@ irc_recv_cmd_345 (t_irc_server *server, char *host, char *nick, char *arguments)
pos++;
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s%s %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos);
}
}
@@ -4040,7 +4046,7 @@ irc_recv_cmd_345 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s\n", arguments);
}
}
@@ -4066,7 +4072,7 @@ irc_recv_cmd_348 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_channel = strchr (arguments, ' ');
if (!pos_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "348");
@@ -4081,7 +4087,7 @@ irc_recv_cmd_348 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_exception = strchr (pos_channel, ' ');
if (!pos_exception)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "348");
@@ -4121,16 +4127,16 @@ irc_recv_cmd_348 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
gui_printf (buffer, "%s[%s%s%s]%s exception %s%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_exception,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
if (pos_user)
{
pos = strchr (pos_user, '!');
@@ -4138,23 +4144,23 @@ irc_recv_cmd_348 (t_irc_server *server, char *host, char *nick, char *arguments)
{
pos[0] = '\0';
gui_printf (buffer, _(" by %s%s %s(%s%s%s)"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_user,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos + 1,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
else
gui_printf (buffer, _(" by %s%s"),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_user);
}
if (pos_date)
{
datetime = (time_t)(atol (pos_date));
gui_printf_nolog (buffer, "%s, %s",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ctime (&datetime));
}
else
@@ -4180,7 +4186,7 @@ irc_recv_cmd_349 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_channel = strchr (arguments, ' ');
if (!pos_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "349");
@@ -4194,7 +4200,7 @@ irc_recv_cmd_349 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_msg = strchr (pos_channel, ' ');
if (!pos_msg)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "349");
@@ -4214,13 +4220,13 @@ irc_recv_cmd_349 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
gui_printf (buffer, "%s[%s%s%s] %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_msg);
}
return 0;
@@ -4258,7 +4264,7 @@ irc_recv_cmd_351 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
if (pos2)
gui_printf (server->buffer, "%s %s\n", pos, pos2);
else
@@ -4363,24 +4369,24 @@ irc_recv_cmd_352 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
irc_display_prefix (server, server->buffer,
- PREFIX_SERVER);
+ GUI_PREFIX_SERVER);
gui_printf (server->buffer,
"%s%s%s on %s%s%s %s %s %s%s@%s %s(%s%s%s)\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_attr,
pos_hopcount,
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_user,
pos_host,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_realname,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
}
@@ -4441,7 +4447,7 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
pos++;
if (pos[0] != ':')
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "353");
@@ -4456,12 +4462,12 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored && !ptr_channel)
{
/* display users on channel */
- irc_display_prefix (server, ptr_buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_buffer, _("Nicks %s%s%s: %s["),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
pos++;
@@ -4489,34 +4495,34 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
{
case '@': /* op */
is_op = 1;
- color = COLOR_WIN_NICK_OP;
+ color = GUI_COLOR_WIN_NICK_OP;
break;
case '%': /* half-op */
is_halfop = 1;
- color = COLOR_WIN_NICK_HALFOP;
+ color = GUI_COLOR_WIN_NICK_HALFOP;
break;
case '+': /* voice */
has_voice = 1;
- color = COLOR_WIN_NICK_VOICE;
+ color = GUI_COLOR_WIN_NICK_VOICE;
break;
case '~': /* channel owner */
is_chanowner = 1;
- color = COLOR_WIN_NICK_CHANOWNER;
+ color = GUI_COLOR_WIN_NICK_CHANOWNER;
break;
case '&': /* channel admin */
is_chanadmin = 1;
- color = COLOR_WIN_NICK_CHANADMIN;
+ color = GUI_COLOR_WIN_NICK_CHANADMIN;
break;
case '!': /* channel admin (2) */
is_chanadmin2 = 1;
- color = COLOR_WIN_NICK_CHANADMIN;
+ color = GUI_COLOR_WIN_NICK_CHANADMIN;
break;
case '-': /* channel user */
is_chanuser = 1;
- color = COLOR_WIN_NICK_CHANUSER;
+ color = GUI_COLOR_WIN_NICK_CHANUSER;
break;
default:
- color = COLOR_WIN_CHAT;
+ color = GUI_COLOR_WIN_CHAT;
break;
}
if (!command_ignored && !ptr_channel)
@@ -4540,7 +4546,7 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
is_chanowner, is_chanadmin, is_chanadmin2,
is_op, is_halfop, has_voice, is_chanuser))
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create nick \"%s\" for channel \"%s\"\n"),
WEECHAT_ERROR, pos_nick, ptr_channel->name);
@@ -4551,7 +4557,7 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
gui_printf (ptr_buffer, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT), pos_nick);
+ GUI_COLOR(GUI_COLOR_WIN_CHAT), pos_nick);
if (pos && pos[0])
gui_printf (ptr_buffer, " ");
}
@@ -4567,12 +4573,12 @@ irc_recv_cmd_353 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (!command_ignored)
gui_printf (ptr_buffer, "%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "353");
@@ -4619,55 +4625,55 @@ irc_recv_cmd_366 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
/* display users on channel */
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_SERVER);
gui_printf (ptr_channel->buffer, _("Nicks %s%s%s: %s["),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_channel->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
for (ptr_nick = ptr_channel->nicks; ptr_nick; ptr_nick = ptr_nick->next_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
- MSG_TYPE_MSG, 0, COLOR_WIN_CHAT, 1);
+ GUI_MSG_TYPE_MSG, 0, GUI_COLOR_WIN_CHAT, 1);
if (ptr_nick != ptr_channel->last_nick)
gui_printf (ptr_channel->buffer, " ");
}
gui_printf (ptr_channel->buffer, "%s]\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
/* display number of nicks, ops, halfops & voices on the channel */
irc_nick_count (ptr_channel, &num_nicks, &num_op, &num_halfop, &num_voice,
&num_normal);
- irc_display_prefix (server, ptr_channel->buffer, PREFIX_INFO);
+ irc_display_prefix (server, ptr_channel->buffer, GUI_PREFIX_INFO);
gui_printf (ptr_channel->buffer,
_("Channel %s%s%s: %s%d%s %s %s(%s%d%s %s, "
"%s%d%s %s, %s%d%s %s, %s%d%s %s%s)\n"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
ptr_channel->name,
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
num_nicks,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(num_nicks > 1) ? _("nicks") : _("nick"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
num_op,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(num_op > 1) ? _("ops") : _("op"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
num_halfop,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(num_halfop > 1) ? _("halfops") : _("halfop"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
num_voice,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(num_voice > 1) ? _("voices") : _("voice"),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
num_normal,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
_("normal"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
irc_send_cmd_mode (server, NULL, ptr_channel->name);
irc_channel_check_away (server, ptr_channel, 1);
@@ -4676,11 +4682,11 @@ irc_recv_cmd_366 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (!command_ignored)
{
- irc_display_prefix (server, gui_current_window->buffer, PREFIX_INFO);
+ irc_display_prefix (server, gui_current_window->buffer, GUI_PREFIX_INFO);
gui_printf (gui_current_window->buffer, "%s%s%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos2);
}
return 0;
@@ -4709,7 +4715,7 @@ irc_recv_cmd_367 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_channel = strchr (arguments, ' ');
if (!pos_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "367");
@@ -4724,7 +4730,7 @@ irc_recv_cmd_367 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_ban = strchr (pos_channel, ' ');
if (!pos_ban)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "367");
@@ -4763,38 +4769,38 @@ irc_recv_cmd_367 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
if (pos_user)
{
gui_printf_nolog (buffer, _("%s[%s%s%s] %s%s%s banned by "),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_ban,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
pos = strchr (pos_user, '!');
if (pos)
{
pos[0] = '\0';
gui_printf (buffer, "%s%s %s(%s%s%s)",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_user,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos + 1,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
}
else
gui_printf (buffer, "%s%s",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_user);
if (pos_date)
{
datetime = (time_t)(atol (pos_date));
gui_printf (buffer, "%s, %s",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
ctime (&datetime));
}
else
@@ -4802,13 +4808,13 @@ irc_recv_cmd_367 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
gui_printf_nolog (buffer, _("%s[%s%s%s] %s%s%s banned\n"),
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_HOST),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_HOST),
pos_ban,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
return 0;
}
@@ -4830,7 +4836,7 @@ irc_recv_cmd_368 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_channel = strchr (arguments, ' ');
if (!pos_channel)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "368");
@@ -4844,7 +4850,7 @@ irc_recv_cmd_368 (t_irc_server *server, char *host, char *nick, char *arguments)
pos_msg = strchr (pos_channel, ' ');
if (!pos_msg)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot parse \"%s\" command\n"),
WEECHAT_ERROR, "368");
@@ -4864,13 +4870,13 @@ irc_recv_cmd_368 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
- irc_display_prefix (server, buffer, PREFIX_INFO);
+ irc_display_prefix (server, buffer, GUI_PREFIX_INFO);
gui_printf_nolog (buffer, "%s[%s%s%s] %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_channel,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_msg);
}
return 0;
@@ -4891,7 +4897,7 @@ irc_recv_cmd_432 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick1) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: trying 2nd nickname \"%s\"\n"),
PACKAGE_NAME, server->nick2);
@@ -4902,7 +4908,7 @@ irc_recv_cmd_432 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick2) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: trying 3rd nickname \"%s\"\n"),
PACKAGE_NAME, server->nick3);
@@ -4913,7 +4919,7 @@ irc_recv_cmd_432 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick3) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: all declared nicknames are already in "
"use or invalid, closing connection with "
@@ -4924,7 +4930,7 @@ irc_recv_cmd_432 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: trying 1st nickname \"%s\"\n"),
PACKAGE_NAME, server->nick1);
@@ -4951,7 +4957,7 @@ irc_recv_cmd_433 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick1) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: nickname \"%s\" is already in use, "
"trying 2nd nickname \"%s\"\n"),
@@ -4963,7 +4969,7 @@ irc_recv_cmd_433 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick2) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: nickname \"%s\" is already in use, "
"trying 3rd nickname \"%s\"\n"),
@@ -4975,7 +4981,7 @@ irc_recv_cmd_433 (t_irc_server *server, char *host, char *nick, char *arguments)
{
if (strcmp (server->nick, server->nick3) == 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: all declared nicknames are already in use, "
"closing connection with server!\n"),
@@ -4985,7 +4991,7 @@ irc_recv_cmd_433 (t_irc_server *server, char *host, char *nick, char *arguments)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer,
_("%s: nickname \"%s\" is already in use, "
"trying 1st nickname \"%s\"\n"),
@@ -5020,7 +5026,7 @@ irc_recv_cmd_438 (t_irc_server *server, char *host, char *nick, char *arguments)
if (!command_ignored)
{
pos = strchr (arguments, ' ');
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
if (pos)
{
pos[0] = '\0';
@@ -5072,13 +5078,13 @@ irc_recv_cmd_671 (t_irc_server *server, char *host, char *nick, char *arguments)
if (pos_message[0] == ':')
pos_message++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "%s[%s%s%s] %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
pos_nick,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_message);
}
}
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index 8e84702e0..ea3d5edf9 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -94,13 +94,13 @@ irc_send_me (t_irc_server *server, t_irc_channel *channel,
irc_server_sendf (server, "PRIVMSG %s :\01ACTION %s\01",
channel->name,
(arguments && arguments[0]) ? arguments : "");
- irc_display_prefix (NULL, channel->buffer, PREFIX_ACTION_ME);
+ irc_display_prefix (NULL, channel->buffer, GUI_PREFIX_ACTION_ME);
string = (arguments && arguments[0]) ?
(char *)gui_color_decode ((unsigned char *)arguments, 1, 0) : NULL;
gui_printf (channel->buffer, "%s%s %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
server->nick,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : "");
if (string)
free (string);
@@ -119,7 +119,7 @@ irc_send_me_all_channels (t_irc_server *server, char *arguments)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
irc_send_me (server, ptr_channel, arguments);
}
return 0;
@@ -149,7 +149,7 @@ irc_send_cmd_ame (t_irc_server *server, t_irc_channel *channel,
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
irc_send_me (ptr_server, ptr_channel, arguments);
}
}
@@ -186,7 +186,7 @@ irc_send_cmd_amsg (t_irc_server *server, t_irc_channel *channel,
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
{
irc_server_sendf (ptr_server, "PRIVMSG %s :%s",
ptr_channel->name, arguments);
@@ -194,7 +194,7 @@ irc_send_cmd_amsg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
- MSG_TYPE_NICK, 1, -1, 0);
+ GUI_MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)arguments, 1, 0);
gui_printf (ptr_channel->buffer, "%s\n", (string) ? string : arguments);
if (string)
@@ -202,7 +202,7 @@ irc_send_cmd_amsg (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (ptr_server, ptr_server->buffer, PREFIX_ERROR);
+ irc_display_prefix (ptr_server, ptr_server->buffer, GUI_PREFIX_ERROR);
gui_printf (ptr_server->buffer,
_("%s cannot find nick for sending message\n"),
WEECHAT_ERROR);
@@ -263,7 +263,7 @@ irc_send_away (t_irc_server *server, char *arguments)
for (ptr_window = gui_windows; ptr_window;
ptr_window = ptr_window->next_window)
{
- if (SERVER(ptr_window->buffer) == server)
+ if (GUI_SERVER(ptr_window->buffer) == server)
ptr_window->buffer->last_read_line =
ptr_window->buffer->last_line;
}
@@ -273,12 +273,12 @@ irc_send_away (t_irc_server *server, char *arguments)
/* server not connected, store away for future usage
(when connecting to server) */
string = (char *)gui_color_decode ((unsigned char *)arguments, 1, 0);
- irc_display_prefix (NULL, server->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_INFO);
gui_printf_nolog (server->buffer,
_("Future away on %s%s%s: %s\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server->name,
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : arguments);
if (string)
free (string);
@@ -330,12 +330,12 @@ irc_send_away (t_irc_server *server, char *arguments)
else
{
/* server not connected, remove away message but do not send anything */
- irc_display_prefix (NULL, server->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_INFO);
gui_printf_nolog (server->buffer,
_("Future away on %s%s%s removed.\n"),
- GUI_COLOR(COLOR_WIN_CHAT_SERVER),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_SERVER),
server->name,
- GUI_COLOR(COLOR_WIN_CHAT));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
}
}
}
@@ -421,15 +421,15 @@ irc_send_cmd_ban (t_irc_server *server, t_irc_channel *channel,
/* channel not given, use default buffer */
if (!pos_channel)
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "ban");
return -1;
}
- pos_channel = CHANNEL(buffer)->name;
+ pos_channel = GUI_CHANNEL(buffer)->name;
}
/* loop on users */
@@ -449,15 +449,15 @@ irc_send_cmd_ban (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "ban");
return -1;
}
- irc_server_sendf (server, "MODE %s +b", CHANNEL(buffer)->name);
+ irc_server_sendf (server, "MODE %s +b", GUI_CHANNEL(buffer)->name);
}
return 0;
@@ -502,14 +502,14 @@ irc_send_cmd_ctcp (t_irc_server *server, t_irc_channel *channel,
pos++;
}
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "CTCP%s(%s%s%s)%s: %s%s",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
- GUI_COLOR(COLOR_WIN_CHAT_CHANNEL),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_CHANNEL),
pos_type);
if ((ascii_strcasecmp (pos_type, "ping") == 0) && (!pos_args))
@@ -518,7 +518,7 @@ irc_send_cmd_ctcp (t_irc_server *server, t_irc_channel *channel,
irc_server_sendf (server, "PRIVMSG %s :\01PING %d %d\01",
arguments, tv.tv_sec, tv.tv_usec);
gui_printf (server->buffer, " %s%d %d\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
tv.tv_sec, tv.tv_usec);
}
else
@@ -528,7 +528,7 @@ irc_send_cmd_ctcp (t_irc_server *server, t_irc_channel *channel,
irc_server_sendf (server, "PRIVMSG %s :\01%s %s\01",
arguments, pos_type, pos_args);
gui_printf (server->buffer, " %s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
pos_args);
}
else
@@ -579,7 +579,7 @@ irc_send_cmd_cycle (t_irc_server *server, t_irc_channel *channel,
ptr_channel = irc_channel_search (server, channels[i]);
/* mark channal as cycling */
if (ptr_channel &&
- (ptr_channel->type == CHANNEL_TYPE_CHANNEL))
+ (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL))
ptr_channel->cycle = 1;
}
free_exploded_string (channels);
@@ -587,9 +587,9 @@ irc_send_cmd_cycle (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can not be executed on a server buffer\n"),
WEECHAT_ERROR, "cycle");
@@ -597,19 +597,19 @@ irc_send_cmd_cycle (t_irc_server *server, t_irc_channel *channel,
}
/* does nothing on private buffer (cycle has no sense!) */
- if (BUFFER_IS_PRIVATE(buffer))
+ if (GUI_BUFFER_IS_PRIVATE(buffer))
return 0;
- channel_name = CHANNEL(buffer)->name;
+ channel_name = GUI_CHANNEL(buffer)->name;
pos_args = arguments;
- CHANNEL(buffer)->cycle = 1;
+ GUI_CHANNEL(buffer)->cycle = 1;
}
}
else
{
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can not be executed on a server buffer\n"),
WEECHAT_ERROR, "part");
@@ -617,12 +617,12 @@ irc_send_cmd_cycle (t_irc_server *server, t_irc_channel *channel,
}
/* does nothing on private buffer (cycle has no sense!) */
- if (BUFFER_IS_PRIVATE(buffer))
+ if (GUI_BUFFER_IS_PRIVATE(buffer))
return 0;
- channel_name = CHANNEL(buffer)->name;
+ channel_name = GUI_CHANNEL(buffer)->name;
pos_args = NULL;
- CHANNEL(buffer)->cycle = 1;
+ GUI_CHANNEL(buffer)->cycle = 1;
}
ptr_arg = (pos_args) ? pos_args :
@@ -655,19 +655,19 @@ irc_send_cmd_dehalfop (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s -h %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"-", "h", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "dehalfop");
@@ -687,19 +687,19 @@ irc_send_cmd_deop (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s -o %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"-", "o", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "deop");
@@ -719,19 +719,19 @@ irc_send_cmd_devoice (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s -v %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"-", "v", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "devoice");
@@ -768,19 +768,19 @@ irc_send_cmd_halfop (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s +h %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"+", "h", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "halfop");
@@ -823,16 +823,16 @@ irc_send_cmd_invite (t_irc_server *server, t_irc_channel *channel,
irc_server_sendf (server, "INVITE %s %s", argv[0], argv[1]);
else
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "invite");
return -1;
}
irc_server_sendf (server, "INVITE %s %s",
- argv[0], CHANNEL(buffer)->name);
+ argv[0], GUI_CHANNEL(buffer)->name);
}
return 0;
}
@@ -889,7 +889,7 @@ irc_send_cmd_kick (t_irc_server *server, t_irc_channel *channel,
pos_nick = strchr (arguments, ' ');
if (!pos_nick)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong arguments for \"%s\" command\n"),
WEECHAT_ERROR, "kick");
@@ -902,15 +902,15 @@ irc_send_cmd_kick (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "kick");
return -1;
}
- pos_channel = CHANNEL(buffer)->name;
+ pos_channel = GUI_CHANNEL(buffer)->name;
pos_nick = arguments;
}
@@ -950,7 +950,7 @@ irc_send_cmd_kickban (t_irc_server *server, t_irc_channel *channel,
pos_nick = strchr (arguments, ' ');
if (!pos_nick)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong arguments for \"%s\" command\n"),
WEECHAT_ERROR, "kickban");
@@ -963,15 +963,15 @@ irc_send_cmd_kickban (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "kickban");
return -1;
}
- pos_channel = CHANNEL(buffer)->name;
+ pos_channel = GUI_CHANNEL(buffer)->name;
pos_nick = arguments;
}
@@ -1117,15 +1117,15 @@ irc_send_cmd_me (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can not be executed on a server buffer\n"),
WEECHAT_ERROR, "me");
return -1;
}
- irc_send_me (server, CHANNEL(buffer), arguments);
+ irc_send_me (server, GUI_CHANNEL(buffer), arguments);
return 0;
}
@@ -1229,25 +1229,25 @@ irc_send_cmd_msg (t_irc_server *server, t_irc_channel *channel,
}
if (strcmp (arguments, "*") == 0)
{
- if (!BUFFER_IS_CHANNEL(buffer) &&
- !BUFFER_IS_PRIVATE(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer) &&
+ !GUI_BUFFER_IS_PRIVATE(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
WEECHAT_ERROR, "msg *");
return -1;
}
- ptr_channel = CHANNEL(buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ ptr_channel = GUI_CHANNEL(buffer);
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
ptr_nick = irc_nick_search (ptr_channel, server->nick);
else
ptr_nick = NULL;
irc_display_nick (buffer, ptr_nick,
(ptr_nick) ? NULL : server->nick,
- MSG_TYPE_NICK, 1, -1, 0);
+ GUI_MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1, 0);
- gui_printf_type (buffer, MSG_TYPE_MSG, "%s\n",
+ gui_printf_type (buffer, GUI_MSG_TYPE_MSG, "%s\n",
(string) ? string : "");
if (string)
free (string);
@@ -1265,16 +1265,16 @@ irc_send_cmd_msg (t_irc_server *server, t_irc_channel *channel,
if (ptr_nick)
{
irc_display_nick (ptr_channel->buffer, ptr_nick, NULL,
- MSG_TYPE_NICK, 1, -1, 0);
+ GUI_MSG_TYPE_NICK, 1, -1, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1, 0);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG, "%s\n",
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG, "%s\n",
(string) ? string : "");
if (string)
free (string);
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s nick \"%s\" not found for \"%s\" command\n"),
WEECHAT_ERROR, server->nick, "msg");
@@ -1290,16 +1290,16 @@ irc_send_cmd_msg (t_irc_server *server, t_irc_channel *channel,
msg_pwd_hidden = strdup (pos);
if (cfg_log_hide_nickserv_pwd)
irc_display_hide_password (msg_pwd_hidden, 0);
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
- gui_printf_type (server->buffer, MSG_TYPE_NICK,
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
+ gui_printf_type (server->buffer, GUI_MSG_TYPE_NICK,
"%s-%s%s%s- ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT_DARK));
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK));
string = (char *)gui_color_decode ((unsigned char *)msg_pwd_hidden, 1, 0);
gui_printf (server->buffer, "%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : "");
if (string)
free (string);
@@ -1313,22 +1313,22 @@ irc_send_cmd_msg (t_irc_server *server, t_irc_channel *channel,
if (ptr_channel)
{
irc_display_nick (ptr_channel->buffer, NULL, server->nick,
- MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ GUI_MSG_TYPE_NICK, 1, GUI_COLOR_WIN_NICK_SELF, 0);
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : "");
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
gui_printf (server->buffer, "MSG%s(%s%s%s)%s: ",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT));
- gui_printf_type (server->buffer, MSG_TYPE_MSG,
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT));
+ gui_printf_type (server->buffer, GUI_MSG_TYPE_MSG,
"%s\n",
(string) ? string : pos);
}
@@ -1342,7 +1342,7 @@ irc_send_cmd_msg (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "msg");
@@ -1367,9 +1367,9 @@ irc_send_cmd_names (t_irc_server *server, t_irc_channel *channel,
irc_server_sendf (server, "NAMES %s", arguments);
else
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "names");
@@ -1377,7 +1377,7 @@ irc_send_cmd_names (t_irc_server *server, t_irc_channel *channel,
}
else
irc_server_sendf (server, "NAMES %s",
- CHANNEL(buffer)->name);
+ GUI_CHANNEL(buffer)->name);
}
return 0;
}
@@ -1465,14 +1465,14 @@ irc_send_cmd_notice (t_irc_server *server, t_irc_channel *channel,
pos++;
while (pos[0] == ' ')
pos++;
- irc_display_prefix (server, server->buffer, PREFIX_SERVER);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_SERVER);
string = (char *)gui_color_decode ((unsigned char *)pos, 1, 0);
gui_printf (server->buffer, "notice%s(%s%s%s)%s: %s\n",
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT_NICK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_NICK),
arguments,
- GUI_COLOR(COLOR_WIN_CHAT_DARK),
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT_DARK),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : "");
if (string)
free (string);
@@ -1480,7 +1480,7 @@ irc_send_cmd_notice (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "notice");
@@ -1501,19 +1501,19 @@ irc_send_cmd_op (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s +o %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"+", "o", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "op");
@@ -1567,38 +1567,38 @@ irc_send_cmd_part (t_irc_server *server, t_irc_channel *channel,
}
else
{
- if (!CHANNEL(buffer))
+ if (!GUI_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
WEECHAT_ERROR, "part");
return -1;
}
- channel_name = CHANNEL(buffer)->name;
+ channel_name = GUI_CHANNEL(buffer)->name;
pos_args = arguments;
}
}
else
{
- if (!CHANNEL(buffer))
+ if (!GUI_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel or private buffer\n"),
WEECHAT_ERROR, "part");
return -1;
}
- if (BUFFER_IS_PRIVATE(buffer))
+ if (GUI_BUFFER_IS_PRIVATE(buffer))
{
- ptr_channel = CHANNEL(buffer);
+ ptr_channel = GUI_CHANNEL(buffer);
gui_buffer_free (ptr_channel->buffer, 1);
irc_channel_free (server, ptr_channel);
gui_status_draw (buffer, 1);
gui_input_draw (buffer, 1);
return 0;
}
- channel_name = CHANNEL(buffer)->name;
+ channel_name = GUI_CHANNEL(buffer)->name;
pos_args = NULL;
}
@@ -1681,17 +1681,17 @@ irc_send_cmd_query (t_irc_server *server, t_irc_channel *channel,
ptr_channel = irc_channel_search (server, arguments);
if (!ptr_channel)
{
- ptr_channel = irc_channel_new (server, CHANNEL_TYPE_PRIVATE, arguments);
+ ptr_channel = irc_channel_new (server, IRC_CHANNEL_TYPE_PRIVATE, arguments);
if (!ptr_channel)
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s cannot create new private buffer \"%s\"\n"),
WEECHAT_ERROR, arguments);
return -1;
}
gui_buffer_new (window, server, ptr_channel,
- BUFFER_TYPE_STANDARD, 1);
+ GUI_BUFFER_TYPE_STANDARD, 1);
gui_chat_draw_title (ptr_channel->buffer, 1);
}
else
@@ -1711,11 +1711,11 @@ irc_send_cmd_query (t_irc_server *server, t_irc_channel *channel,
if (pos)
{
irc_display_nick (ptr_channel->buffer, NULL, server->nick,
- MSG_TYPE_NICK, 1, COLOR_WIN_NICK_SELF, 0);
+ GUI_MSG_TYPE_NICK, 1, GUI_COLOR_WIN_NICK_SELF, 0);
string = (char *)gui_color_decode ((unsigned char *)pos, 1, 0);
- gui_printf_type (ptr_channel->buffer, MSG_TYPE_MSG,
+ gui_printf_type (ptr_channel->buffer, GUI_MSG_TYPE_MSG,
"%s%s\n",
- GUI_COLOR(COLOR_WIN_CHAT),
+ GUI_COLOR(GUI_COLOR_WIN_CHAT),
(string) ? string : "");
if (string)
free (string);
@@ -1788,7 +1788,7 @@ irc_send_cmd_quote (t_irc_server *server, t_irc_channel *channel,
if (!server || server->sock < 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf_nolog (NULL,
_("%s command \"%s\" needs a server connection!\n"),
WEECHAT_ERROR, "quote");
@@ -1998,15 +1998,15 @@ irc_send_cmd_topic (t_irc_server *server, t_irc_channel *channel,
/* look for current channel if not specified */
if (!channel_name)
{
- if (BUFFER_IS_SERVER(buffer))
+ if (GUI_BUFFER_IS_SERVER(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can not be executed on a server buffer\n"),
WEECHAT_ERROR, "topic");
return -1;
}
- channel_name = CHANNEL(buffer)->name;
+ channel_name = GUI_CHANNEL(buffer)->name;
}
if (new_topic)
@@ -2080,15 +2080,15 @@ irc_send_cmd_unban (t_irc_server *server, t_irc_channel *channel,
/* channel not given, use default buffer */
if (!pos_channel)
{
- if (!BUFFER_IS_CHANNEL(buffer))
+ if (!GUI_BUFFER_IS_CHANNEL(buffer))
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "unban");
return -1;
}
- pos_channel = CHANNEL(buffer)->name;
+ pos_channel = GUI_CHANNEL(buffer)->name;
}
/* loop on users */
@@ -2108,7 +2108,7 @@ irc_send_cmd_unban (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s wrong argument count for \"%s\" command\n"),
WEECHAT_ERROR, "unban");
@@ -2164,8 +2164,8 @@ irc_send_cmd_version (t_irc_server *server, t_irc_channel *channel,
if (arguments)
{
- if (BUFFER_IS_CHANNEL(buffer) &&
- irc_nick_search (CHANNEL(buffer), arguments))
+ if (GUI_BUFFER_IS_CHANNEL(buffer) &&
+ irc_nick_search (GUI_CHANNEL(buffer), arguments))
irc_server_sendf (server, "PRIVMSG %s :\01VERSION\01",
arguments);
else
@@ -2174,7 +2174,7 @@ irc_send_cmd_version (t_irc_server *server, t_irc_channel *channel,
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer, _("%s, compiled on %s %s\n"),
PACKAGE_STRING,
__DATE__, __TIME__);
@@ -2195,19 +2195,19 @@ irc_send_cmd_voice (t_irc_server *server, t_irc_channel *channel,
gui_buffer_find_context (server, channel, NULL, &buffer);
- if (BUFFER_IS_CHANNEL(buffer))
+ if (GUI_BUFFER_IS_CHANNEL(buffer))
{
if (argc == 0)
irc_server_sendf (server, "MODE %s +v %s",
- CHANNEL(buffer)->name,
+ GUI_CHANNEL(buffer)->name,
server->nick);
else
- irc_send_mode_nicks (server, CHANNEL(buffer)->name,
+ irc_send_mode_nicks (server, GUI_CHANNEL(buffer)->name,
"+", "v", argc, argv);
}
else
{
- irc_display_prefix (NULL, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (NULL, server->buffer, GUI_PREFIX_ERROR);
gui_printf_nolog (server->buffer,
_("%s \"%s\" command can only be executed in a channel buffer\n"),
WEECHAT_ERROR, "voice");
diff --git a/src/irc/irc-server.c b/src/irc/irc-server.c
index c842c6d5b..66fb685b2 100644
--- a/src/irc/irc-server.c
+++ b/src/irc/irc-server.c
@@ -57,9 +57,10 @@
t_irc_server *irc_servers = NULL;
t_irc_server *last_irc_server = NULL;
-t_irc_message *recv_msgq, *msgq_last_msg;
+t_irc_message *irc_recv_msgq = NULL;
+t_irc_message *irc_msgq_last_msg = NULL;
-int check_away = 0;
+int irc_check_away = 0;
#ifdef HAVE_GNUTLS
const int gnutls_cert_type_prio[] = { GNUTLS_CRT_X509, GNUTLS_CRT_OPENPGP, 0 };
@@ -648,7 +649,7 @@ irc_server_outqueue_send (t_irc_server *server)
if (irc_server_send (server, server->outqueue->message_after_mod,
strlen (server->outqueue->message_after_mod)) <= 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer, _("%s error sending data to IRC server\n"),
WEECHAT_ERROR);
}
@@ -729,7 +730,7 @@ irc_server_send_one_msg (t_irc_server *server, char *message)
gui_printf_raw_data (server, 1, 1, ptr_msg);
if (irc_server_send (server, buffer, strlen (buffer)) <= 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer, _("%s error sending data to IRC server\n"),
WEECHAT_ERROR);
rc = 0;
@@ -860,7 +861,7 @@ irc_server_msgq_add_msg (t_irc_server *server, char *msg)
message = (t_irc_message *) malloc (sizeof (t_irc_message));
if (!message)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
@@ -873,7 +874,7 @@ irc_server_msgq_add_msg (t_irc_server *server, char *msg)
strlen (msg) + 1);
if (!message->data)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
@@ -890,15 +891,15 @@ irc_server_msgq_add_msg (t_irc_server *server, char *msg)
message->data = strdup (msg);
message->next_message = NULL;
- if (msgq_last_msg)
+ if (irc_msgq_last_msg)
{
- msgq_last_msg->next_message = message;
- msgq_last_msg = message;
+ irc_msgq_last_msg->next_message = message;
+ irc_msgq_last_msg = message;
}
else
{
- recv_msgq = message;
- msgq_last_msg = message;
+ irc_recv_msgq = message;
+ irc_msgq_last_msg = message;
}
}
@@ -920,7 +921,7 @@ irc_server_msgq_add_unterminated (t_irc_server *server, char *string)
strlen (string) + 1);
if (!server->unterminated_message)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
@@ -933,7 +934,7 @@ irc_server_msgq_add_unterminated (t_irc_server *server, char *string)
server->unterminated_message = strdup (string);
if (!server->unterminated_message)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s not enough memory for received IRC message\n"),
WEECHAT_ERROR);
@@ -990,26 +991,26 @@ irc_server_msgq_flush ()
char *ptr_data, *new_msg, *ptr_msg, *pos;
char *host, *command, *args;
- while (recv_msgq)
+ while (irc_recv_msgq)
{
- if (recv_msgq->data)
+ if (irc_recv_msgq->data)
{
#ifdef DEBUG
- gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", recv_msgq->data);
+ gui_printf (gui_current_window->buffer, "[DEBUG] %s\n", irc_recv_msgq->data);
#endif
- ptr_data = recv_msgq->data;
+ ptr_data = irc_recv_msgq->data;
while (ptr_data[0] == ' ')
ptr_data++;
if (ptr_data[0])
{
- gui_printf_raw_data (recv_msgq->server, 0, 0, ptr_data);
+ gui_printf_raw_data (irc_recv_msgq->server, 0, 0, ptr_data);
#ifdef DEBUG
gui_printf (NULL, "[DEBUG] data received from server: %s\n", ptr_data);
#endif
#ifdef PLUGINS
new_msg = plugin_modifier_exec (PLUGIN_MODIFIER_IRC_IN,
- recv_msgq->server->name,
+ irc_recv_msgq->server->name,
ptr_data);
#else
new_msg = NULL;
@@ -1034,28 +1035,28 @@ irc_server_msgq_flush ()
pos[0] = '\0';
if (new_msg)
- gui_printf_raw_data (recv_msgq->server, 0, 1, ptr_msg);
+ gui_printf_raw_data (irc_recv_msgq->server, 0, 1, ptr_msg);
irc_server_parse_message (ptr_msg, &host, &command, &args);
- switch (irc_recv_command (recv_msgq->server, ptr_msg, host, command, args))
+ switch (irc_recv_command (irc_recv_msgq->server, ptr_msg, host, command, args))
{
case -1:
- irc_display_prefix (recv_msgq->server,
- recv_msgq->server->buffer, PREFIX_ERROR);
- gui_printf (recv_msgq->server->buffer,
+ irc_display_prefix (irc_recv_msgq->server,
+ irc_recv_msgq->server->buffer, GUI_PREFIX_ERROR);
+ gui_printf (irc_recv_msgq->server->buffer,
_("%s Command \"%s\" failed!\n"), WEECHAT_ERROR, command);
break;
case -2:
- irc_display_prefix (recv_msgq->server,
- recv_msgq->server->buffer, PREFIX_ERROR);
- gui_printf (recv_msgq->server->buffer,
+ irc_display_prefix (irc_recv_msgq->server,
+ irc_recv_msgq->server->buffer, GUI_PREFIX_ERROR);
+ gui_printf (irc_recv_msgq->server->buffer,
_("%s No command to execute!\n"), WEECHAT_ERROR);
break;
case -3:
- irc_display_prefix (recv_msgq->server,
- recv_msgq->server->buffer, PREFIX_ERROR);
- gui_printf (recv_msgq->server->buffer,
+ irc_display_prefix (irc_recv_msgq->server,
+ irc_recv_msgq->server->buffer, GUI_PREFIX_ERROR);
+ gui_printf (irc_recv_msgq->server->buffer,
_("%s Unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\"\n"),
WEECHAT_WARNING, command, host, args);
break;
@@ -1077,18 +1078,18 @@ irc_server_msgq_flush ()
}
}
else
- gui_printf_raw_data (recv_msgq->server, 0, 1, _("(message dropped)"));
+ gui_printf_raw_data (irc_recv_msgq->server, 0, 1, _("(message dropped)"));
if (new_msg)
free (new_msg);
}
- free (recv_msgq->data);
+ free (irc_recv_msgq->data);
}
- next = recv_msgq->next_message;
- free (recv_msgq);
- recv_msgq = next;
- if (recv_msgq == NULL)
- msgq_last_msg = NULL;
+ next = irc_recv_msgq->next_message;
+ free (irc_recv_msgq);
+ irc_recv_msgq = next;
+ if (irc_recv_msgq == NULL)
+ irc_msgq_last_msg = NULL;
}
}
@@ -1120,7 +1121,7 @@ irc_server_recv (t_irc_server *server)
}
else
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot read data from socket, disconnecting from server...\n"),
WEECHAT_ERROR);
@@ -1204,7 +1205,7 @@ irc_server_reconnect_schedule (t_irc_server *server)
if (server->autoreconnect)
{
server->reconnect_start = time (NULL);
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer, _("%s: Reconnecting to server in %d seconds\n"),
PACKAGE_NAME, server->autoreconnect_delay);
}
@@ -1237,7 +1238,7 @@ irc_server_child_read (t_irc_server *server)
(gnutls_transport_ptr) ((unsigned long) server->sock));
if (gnutls_handshake (server->gnutls_sess) < 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls handshake failed\n"),
WEECHAT_ERROR);
@@ -1253,7 +1254,7 @@ irc_server_child_read (t_irc_server *server)
break;
/* adress not found */
case '1':
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy address \"%s\" not found\n"),
@@ -1267,7 +1268,7 @@ irc_server_child_read (t_irc_server *server)
break;
/* IP address not found */
case '2':
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy IP address not found\n"), WEECHAT_ERROR);
@@ -1279,7 +1280,7 @@ irc_server_child_read (t_irc_server *server)
break;
/* connection refused */
case '3':
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
if (cfg_proxy_use)
gui_printf (server->buffer,
_("%s proxy connection refused\n"), WEECHAT_ERROR);
@@ -1291,7 +1292,7 @@ irc_server_child_read (t_irc_server *server)
break;
/* proxy fails to connect to server */
case '4':
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s proxy fails to establish connection to "
"server (check username/password if used)\n"),
@@ -1301,7 +1302,7 @@ irc_server_child_read (t_irc_server *server)
break;
/* fails to set local hostname/IP */
case '5':
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s unable to set local hostname/IP\n"),
WEECHAT_ERROR);
@@ -1819,14 +1820,14 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
#ifndef HAVE_GNUTLS
if (server->ssl)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot connect with SSL since WeeChat was not built "
"with GNUtls support\n"), WEECHAT_ERROR);
return 0;
}
#endif
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
if (cfg_proxy_use)
{
gui_printf (server->buffer,
@@ -1866,7 +1867,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
{
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s gnutls init error\n"), WEECHAT_ERROR);
return 0;
@@ -1882,7 +1883,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
/* create pipe for child process */
if (pipe (child_pipe) < 0)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create pipe\n"), WEECHAT_ERROR);
return 0;
@@ -1897,7 +1898,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
server->sock = socket ((server->ipv6) ? AF_INET6 : AF_INET, SOCK_STREAM, 0);
if (server->sock == -1)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot create socket\n"), WEECHAT_ERROR);
return 0;
@@ -1908,7 +1909,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
if (setsockopt (server->sock, SOL_SOCKET, SO_REUSEADDR,
(void *) &set, sizeof (set)) == -1)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot set socket option \"SO_REUSEADDR\"\n"),
WEECHAT_WARNING);
@@ -1919,7 +1920,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
if (setsockopt (server->sock, SOL_SOCKET, SO_KEEPALIVE,
(void *) &set, sizeof (set)) == -1)
{
- irc_display_prefix (server, server->buffer, PREFIX_ERROR);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_ERROR);
gui_printf (server->buffer,
_("%s cannot set socket option \"SO_KEEPALIVE\"\n"),
WEECHAT_WARNING);
@@ -1962,7 +1963,7 @@ irc_server_connect (t_irc_server *server, int disable_autojoin)
void
irc_server_reconnect (t_irc_server *server)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer, _("%s: Reconnecting to server...\n"),
PACKAGE_NAME);
server->reconnect_start = 0;
@@ -1989,7 +1990,7 @@ irc_server_auto_connect (int auto_connect, int temp_server)
|| ((!temp_server) && (auto_connect) && (ptr_server->autoconnect)) )
{
(void) gui_buffer_new (gui_current_window, ptr_server, NULL,
- BUFFER_TYPE_STANDARD, 1);
+ GUI_BUFFER_TYPE_STANDARD, 1);
gui_window_redraw_buffer (gui_current_window->buffer);
if (!irc_server_connect (ptr_server, 0))
irc_server_reconnect_schedule (ptr_server);
@@ -2013,7 +2014,7 @@ irc_server_disconnect (t_irc_server *server, int reconnect)
ptr_channel = ptr_channel->next_channel)
{
irc_nick_free_all (ptr_channel);
- irc_display_prefix (NULL, ptr_channel->buffer, PREFIX_INFO);
+ irc_display_prefix (NULL, ptr_channel->buffer, GUI_PREFIX_INFO);
gui_printf (ptr_channel->buffer, _("Disconnected from server!\n"));
gui_nicklist_draw (ptr_channel->buffer, 1, 1);
gui_status_draw (ptr_channel->buffer, 1);
@@ -2024,7 +2025,7 @@ irc_server_disconnect (t_irc_server *server, int reconnect)
if (server->buffer)
{
- irc_display_prefix (server, server->buffer, PREFIX_INFO);
+ irc_display_prefix (server, server->buffer, GUI_PREFIX_INFO);
gui_printf (server->buffer, _("Disconnected from server!\n"));
}
@@ -2173,7 +2174,7 @@ irc_server_get_channel_count (t_irc_server *server)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
count++;
}
return count;
@@ -2193,7 +2194,7 @@ irc_server_get_pv_count (t_irc_server *server)
for (ptr_channel = server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type != CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type != IRC_CHANNEL_TYPE_CHANNEL)
count++;
}
return count;
@@ -2215,7 +2216,7 @@ irc_server_remove_away ()
{
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
irc_channel_remove_away (ptr_channel);
}
}
@@ -2238,7 +2239,7 @@ irc_server_check_away ()
{
for (ptr_channel = ptr_server->channels; ptr_channel; ptr_channel = ptr_channel->next_channel)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
irc_channel_check_away (ptr_server, ptr_channel, 0);
}
}
@@ -2258,7 +2259,7 @@ irc_server_set_away (t_irc_server *server, char *nick, int is_away)
{
if (server->is_connected)
{
- if (ptr_channel->type == CHANNEL_TYPE_CHANNEL)
+ if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
irc_channel_set_away (ptr_channel, nick, is_away);
}
}
@@ -2274,7 +2275,7 @@ irc_server_get_default_notify_level (t_irc_server *server)
int notify, value;
char *pos;
- notify = NOTIFY_LEVEL_DEFAULT;
+ notify = GUI_NOTIFY_LEVEL_DEFAULT;
if (!server || !server->notify_levels)
return notify;
@@ -2286,7 +2287,8 @@ irc_server_get_default_notify_level (t_irc_server *server)
if (pos[0])
{
value = (int)(pos[0] - '0');
- if ((value >= NOTIFY_LEVEL_MIN) && (value <= NOTIFY_LEVEL_MAX))
+ if ((value >= GUI_NOTIFY_LEVEL_MIN)
+ && (value <= GUI_NOTIFY_LEVEL_MAX))
notify = value;
}
}
diff --git a/src/irc/irc.h b/src/irc/irc.h
index 570a254ca..3f2bee85b 100644
--- a/src/irc/irc.h
+++ b/src/irc/irc.h
@@ -39,33 +39,20 @@
#define NI_MAXHOST 256
#endif
-/* prefixes for chat window */
-
-#define PREFIX_SERVER "-@-"
-#define PREFIX_INFO "-=-"
-#define PREFIX_ACTION_ME "-*-"
-#define PREFIX_JOIN "-->"
-#define PREFIX_PART "<--"
-#define PREFIX_QUIT "<--"
-#define PREFIX_ERROR "=!="
-#define PREFIX_PLUGIN "-P-"
-#define PREFIX_RECV_MOD "==>"
-#define PREFIX_SEND_MOD "<=="
-
#define IRC_DEFAULT_PORT 6667
#define IRC_DEFAULT_PREFIXES_LIST "@%+~&!-"
/* nick types */
-#define NICK_CHANOWNER 1
-#define NICK_CHANADMIN 2
-#define NICK_OP 4
-#define NICK_HALFOP 8
-#define NICK_VOICE 16
-#define NICK_AWAY 32
-#define NICK_CHANADMIN2 64
-#define NICK_CHANUSER 128
-#define NICK_SET_FLAG(nick, set, flag) \
+#define IRC_NICK_CHANOWNER 1
+#define IRC_NICK_CHANADMIN 2
+#define IRC_NICK_OP 4
+#define IRC_NICK_HALFOP 8
+#define IRC_NICK_VOICE 16
+#define IRC_NICK_AWAY 32
+#define IRC_NICK_CHANADMIN2 64
+#define IRC_NICK_CHANUSER 128
+#define IRC_NICK_SET_FLAG(nick, set, flag) \
if (set) \
nick->flags |= flag; \
else \
@@ -92,15 +79,15 @@ struct t_irc_nick
t_irc_nick *next_nick; /* link to next nick on the channel */
};
-#define CHANNEL_PREFIX "#&+!"
+#define IRC_CHANNEL_PREFIX "#&+!"
/* channel types */
-#define CHANNEL_TYPE_UNKNOWN -1
-#define CHANNEL_TYPE_CHANNEL 0
-#define CHANNEL_TYPE_PRIVATE 1
-#define CHANNEL_TYPE_DCC_CHAT 2
+#define IRC_CHANNEL_TYPE_UNKNOWN -1
+#define IRC_CHANNEL_TYPE_CHANNEL 0
+#define IRC_CHANNEL_TYPE_PRIVATE 1
+#define IRC_CHANNEL_TYPE_DCC_CHAT 2
-#define CHANNEL_NICKS_SPEAKING_LIMIT 32
+#define IRC_CHANNEL_NICKS_SPEAKING_LIMIT 32
typedef struct t_irc_channel t_irc_channel;
@@ -244,46 +231,51 @@ struct t_irc_message
/* DCC types */
-#define DCC_CHAT_RECV 0 /* receiving DCC chat */
-#define DCC_CHAT_SEND 1 /* sending DCC chat */
-#define DCC_FILE_RECV 2 /* incoming DCC file */
-#define DCC_FILE_SEND 3 /* sending DCC file */
+#define IRC_DCC_CHAT_RECV 0 /* receiving DCC chat */
+#define IRC_DCC_CHAT_SEND 1 /* sending DCC chat */
+#define IRC_DCC_FILE_RECV 2 /* incoming DCC file */
+#define IRC_DCC_FILE_SEND 3 /* sending DCC file */
/* DCC status */
-#define DCC_WAITING 0 /* waiting for host answer */
-#define DCC_CONNECTING 1 /* connecting to host */
-#define DCC_ACTIVE 2 /* sending/receiving data */
-#define DCC_DONE 3 /* transfer done */
-#define DCC_FAILED 4 /* DCC failed */
-#define DCC_ABORTED 5 /* DCC aborted by user */
+#define IRC_DCC_WAITING 0 /* waiting for host answer */
+#define IRC_DCC_CONNECTING 1 /* connecting to host */
+#define IRC_DCC_ACTIVE 2 /* sending/receiving data */
+#define IRC_DCC_DONE 3 /* transfer done */
+#define IRC_DCC_FAILED 4 /* DCC failed */
+#define IRC_DCC_ABORTED 5 /* DCC aborted by user */
/* DCC blocksize (for file) */
-#define DCC_MIN_BLOCKSIZE 1024 /* min DCC block size when sending file */
-#define DCC_MAX_BLOCKSIZE 102400 /* max DCC block size when sending file */
+#define IRC_DCC_MIN_BLOCKSIZE 1024 /* min DCC block size when sending file */
+#define IRC_DCC_MAX_BLOCKSIZE 102400 /* max DCC block size when sending file */
/* DCC errors (for file) */
-#define DCC_NO_ERROR 0 /* used when no error to report, all ok! */
-#define DCC_ERROR_READ_LOCAL 1 /* unable to read local file */
-#define DCC_ERROR_SEND_BLOCK 2 /* unable to send block to receiver */
-#define DCC_ERROR_READ_ACK 3 /* unable to read ACK from receiver */
-#define DCC_ERROR_CONNECT_SENDER 4 /* unable to connect to sender */
-#define DCC_ERROR_RECV_BLOCK 5 /* unable to receive block from sender */
-#define DCC_ERROR_WRITE_LOCAL 6 /* unable to write to local file */
+#define IRC_DCC_NO_ERROR 0 /* no error to report, all ok! */
+#define IRC_DCC_ERROR_READ_LOCAL 1 /* unable to read local file */
+#define IRC_DCC_ERROR_SEND_BLOCK 2 /* unable to send block to receiver */
+#define IRC_DCC_ERROR_READ_ACK 3 /* unable to read ACK from receiver */
+#define IRC_DCC_ERROR_CONNECT_SENDER 4 /* unable to connect to sender */
+#define IRC_DCC_ERROR_RECV_BLOCK 5 /* unable to recv block from sender */
+#define IRC_DCC_ERROR_WRITE_LOCAL 6 /* unable to write to local file */
/* DCC macros for type */
-#define DCC_IS_CHAT(type) ((type == DCC_CHAT_RECV) || (type == DCC_CHAT_SEND))
-#define DCC_IS_FILE(type) ((type == DCC_FILE_RECV) || (type == DCC_FILE_SEND))
-#define DCC_IS_RECV(type) ((type == DCC_CHAT_RECV) || (type == DCC_FILE_RECV))
-#define DCC_IS_SEND(type) ((type == DCC_CHAT_SEND) || (type == DCC_FILE_SEND))
+#define IRC_DCC_IS_CHAT(type) ((type == IRC_DCC_CHAT_RECV) || \
+ (type == IRC_DCC_CHAT_SEND))
+#define IRC_DCC_IS_FILE(type) ((type == IRC_DCC_FILE_RECV) || \
+ (type == IRC_DCC_FILE_SEND))
+#define IRC_DCC_IS_RECV(type) ((type == IRC_DCC_CHAT_RECV) || \
+ (type == IRC_DCC_FILE_RECV))
+#define IRC_DCC_IS_SEND(type) ((type == IRC_DCC_CHAT_SEND) || \
+ (type == IRC_DCC_FILE_SEND))
/* DCC macro for status */
-#define DCC_ENDED(status) ((status == DCC_DONE) || (status == DCC_FAILED) || \
- (status == DCC_ABORTED))
+#define IRC_DCC_ENDED(status) ((status == IRC_DCC_DONE) || \
+ (status == IRC_DCC_FAILED) || \
+ (status == IRC_DCC_ABORTED))
typedef struct t_irc_dcc t_irc_dcc;
@@ -327,10 +319,10 @@ struct t_irc_dcc
/* pre-defined ignore types, all other types are made with IRC commands */
/* for example: part join quit notice invite ... */
-#define IGNORE_ACTION "action"
-#define IGNORE_CTCP "ctcp"
-#define IGNORE_DCC "dcc"
-#define IGNORE_PRIVATE "pv"
+#define IRC_IGNORE_ACTION "action"
+#define IRC_IGNORE_CTCP "ctcp"
+#define IRC_IGNORE_DCC "dcc"
+#define IRC_IGNORE_PRIVATE "pv"
typedef struct t_irc_ignore t_irc_ignore;
@@ -352,14 +344,11 @@ extern t_irc_server *irc_servers;
extern const int gnutls_cert_type_prio[];
extern const int gnutls_prot_prio[];
#endif
-extern t_irc_message *recv_msgq, *msgq_last_msg;
-extern int check_away;
-extern t_irc_dcc *dcc_list;
-extern t_irc_dcc *last_dcc;
-extern char *dcc_status_string[6];
-extern char *channel_modes;
-extern char *nick_modes;
-extern char *ignore_types[];
+extern t_irc_message *irc_recv_msgq, *irc_msgq_last_msg;
+extern int irc_check_away;
+extern t_irc_dcc *irc_dcc_list;
+extern t_irc_dcc *irc_last_dcc;
+extern char *irc_dcc_status_string[6];
extern t_irc_ignore *irc_ignore;
extern t_irc_ignore *irc_last_ignore;
diff --git a/src/plugins/plugins-config.c b/src/plugins/plugins-config.c
index fe97b9de1..ba9416117 100644
--- a/src/plugins/plugins-config.c
+++ b/src/plugins/plugins-config.c
@@ -269,7 +269,7 @@ plugin_config_read ()
pos = strchr (line, '=');
if (pos == NULL)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s %s, line %d: invalid syntax, missing \"=\"\n"),
WEECHAT_WARNING, filename, line_number);
@@ -358,7 +358,7 @@ plugin_config_write ()
if ((file = fopen (filename, "w")) == NULL)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s cannot create file \"%s\"\n"),
WEECHAT_ERROR, filename);
free (filename);
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index 1f35e5d4d..255d74155 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -176,7 +176,7 @@ weechat_plugin_print (t_weechat_plugin *plugin,
va_end (argptr);
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
- irc_display_prefix (NULL, ptr_buffer, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, ptr_buffer, GUI_PREFIX_PLUGIN);
gui_printf_keep_colors (ptr_buffer, "%s\n", (buf2) ? buf2 : buf);
if (buf2)
free (buf2);
@@ -201,7 +201,7 @@ weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
va_end (argptr);
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf_keep_colors (NULL, "%s\n", (buf2) ? buf2 : buf);
if (buf2)
free (buf2);
@@ -226,7 +226,7 @@ weechat_plugin_print_infobar (t_weechat_plugin *plugin, int time_displayed, char
va_end (argptr);
buf2 = weechat_iconv_to_internal (plugin->charset, buf);
- gui_infobar_printf (time_displayed, COLOR_WIN_INFOBAR, "%s",
+ gui_infobar_printf (time_displayed, GUI_COLOR_WIN_INFOBAR, "%s",
(buf2) ? buf2 : buf);
if (buf2)
free (buf2);
@@ -451,7 +451,7 @@ weechat_plugin_exec_command (t_weechat_plugin *plugin,
if (plugin_find_server_channel (server, channel, &ptr_server, &ptr_channel) < 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s server/channel (%s/%s) not found for plugin "
"exec command\n"),
@@ -577,9 +577,9 @@ weechat_plugin_get_info (t_weechat_plugin *plugin, char *info, char *server)
}
else if (ascii_strcasecmp (info, "channel") == 0)
{
- if (BUFFER_IS_CHANNEL(gui_current_window->buffer)
- || BUFFER_IS_PRIVATE(gui_current_window->buffer))
- return strdup (CHANNEL(gui_current_window->buffer)->name);
+ if (GUI_BUFFER_IS_CHANNEL(gui_current_window->buffer)
+ || GUI_BUFFER_IS_PRIVATE(gui_current_window->buffer))
+ return strdup (GUI_CHANNEL(gui_current_window->buffer)->name);
}
else if (ascii_strcasecmp (info, "server") == 0)
{
@@ -622,11 +622,11 @@ weechat_plugin_get_dcc_info (t_weechat_plugin *plugin)
if (!plugin)
return NULL;
- if (dcc_list)
+ if (irc_dcc_list)
{
dcc_info = NULL;
last_dcc_info = NULL;
- for (ptr_dcc = dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
+ for (ptr_dcc = irc_dcc_list; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
new_dcc_info = (t_plugin_dcc_info *)malloc (sizeof (t_plugin_dcc_info));
if (new_dcc_info)
@@ -1331,8 +1331,8 @@ weechat_plugin_get_buffer_info (t_weechat_plugin *plugin)
new_buffer_info->type = ptr_buffer->type;
new_buffer_info->number = ptr_buffer->number;
new_buffer_info->num_displayed = ptr_buffer->num_displayed;
- new_buffer_info->server_name = (SERVER(ptr_buffer)) ? strdup (SERVER(ptr_buffer)->name) : NULL;
- new_buffer_info->channel_name = (CHANNEL(ptr_buffer)) ? strdup (CHANNEL(ptr_buffer)->name) : NULL;
+ new_buffer_info->server_name = (GUI_SERVER(ptr_buffer)) ? strdup (GUI_SERVER(ptr_buffer)->name) : NULL;
+ new_buffer_info->channel_name = (GUI_CHANNEL(ptr_buffer)) ? strdup (GUI_CHANNEL(ptr_buffer)->name) : NULL;
new_buffer_info->notify_level = ptr_buffer->notify_level;
new_buffer_info->log_filename = (ptr_buffer->log_filename) ? strdup (ptr_buffer->log_filename) : NULL;
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index 6e011a08b..e0bfe734c 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -81,10 +81,10 @@ plugin_find_server_channel (char *server, char *channel,
/* nothing given => return current server/channel */
if ((!server || !server[0]) && (!channel || !channel[0]))
{
- (*ptr_server) = SERVER(gui_current_window->buffer);
- (*ptr_channel) = (BUFFER_IS_CHANNEL(gui_current_window->buffer) ||
- BUFFER_IS_PRIVATE(gui_current_window->buffer)) ?
- CHANNEL(gui_current_window->buffer) : NULL;
+ (*ptr_server) = GUI_SERVER(gui_current_window->buffer);
+ (*ptr_channel) = (GUI_BUFFER_IS_CHANNEL(gui_current_window->buffer) ||
+ GUI_BUFFER_IS_PRIVATE(gui_current_window->buffer)) ?
+ GUI_CHANNEL(gui_current_window->buffer) : NULL;
}
else
{
@@ -96,9 +96,9 @@ plugin_find_server_channel (char *server, char *channel,
}
else
{
- (*ptr_server) = SERVER(gui_current_window->buffer);
+ (*ptr_server) = GUI_SERVER(gui_current_window->buffer);
if (!(*ptr_server))
- (*ptr_server) = SERVER(gui_buffers);
+ (*ptr_server) = GUI_SERVER(gui_buffers);
}
if (channel && channel[0])
@@ -238,7 +238,7 @@ plugin_msg_handler_add (t_weechat_plugin *plugin, char *irc_command,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add handler for IRC command \"%s\" (not enough memory)\n"),
WEECHAT_ERROR, plugin->name, irc_command);
@@ -275,7 +275,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
if (plugin_cmd_handler_search (command))
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add handler for \"%s\" command "
"(already exists)\n"),
@@ -285,7 +285,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
if (ascii_strcasecmp (command, "builtin") == 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add handler for \"%s\" command "
"(forbidden)\n"),
@@ -327,7 +327,7 @@ plugin_cmd_handler_add (t_weechat_plugin *plugin, char *command,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add handler for \"%s\" command (not enough memory)\n"),
WEECHAT_ERROR, plugin->name, command);
@@ -384,7 +384,7 @@ plugin_timer_handler_add (t_weechat_plugin *plugin, int interval,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add timer handler (not enough memory)\n"),
WEECHAT_ERROR, plugin->name);
@@ -440,7 +440,7 @@ plugin_keyboard_handler_add (t_weechat_plugin *plugin,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add keyboard handler (not enough memory)\n"),
WEECHAT_ERROR, plugin->name);
@@ -497,7 +497,7 @@ plugin_event_handler_add (t_weechat_plugin *plugin, char *event,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add event handler (not enough memory)\n"),
WEECHAT_ERROR, plugin->name);
@@ -839,7 +839,7 @@ plugin_modifier_add (t_weechat_plugin *plugin, char *type, char *command,
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin %s: unable to add modifier (not enough memory)\n"),
WEECHAT_ERROR, plugin->name);
@@ -1072,7 +1072,7 @@ plugin_load (char *filename)
handle = dlopen (full_name, RTLD_GLOBAL | RTLD_NOW);
if (!handle)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s unable to load plugin \"%s\": %s\n"),
WEECHAT_ERROR, full_name, dlerror());
free (full_name);
@@ -1083,7 +1083,7 @@ plugin_load (char *filename)
if (!name)
{
dlclose (handle);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s symbol \"plugin_name\" not found in plugin \"%s\", failed to load\n"),
WEECHAT_ERROR, full_name);
free (full_name);
@@ -1093,7 +1093,7 @@ plugin_load (char *filename)
if (plugin_search (name))
{
dlclose (handle);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to load plugin \"%s\": a plugin with "
"same name already exists\n"),
@@ -1106,7 +1106,7 @@ plugin_load (char *filename)
if (!description)
{
dlclose (handle);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s symbol \"plugin_description\" not found in plugin \"%s\", failed to load\n"),
WEECHAT_ERROR, full_name);
free (full_name);
@@ -1117,7 +1117,7 @@ plugin_load (char *filename)
if (!version)
{
dlclose (handle);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s symbol \"plugin_version\" not found in plugin \"%s\", failed to load\n"),
WEECHAT_ERROR, full_name);
free (full_name);
@@ -1130,7 +1130,7 @@ plugin_load (char *filename)
if (!init_func)
{
dlclose (handle);
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL, _("%s function \"weechat_plugin_init\" not found in plugin \"%s\", failed to load\n"),
WEECHAT_ERROR, full_name);
free (full_name);
@@ -1213,7 +1213,7 @@ plugin_load (char *filename)
weechat_plugins = new_plugin;
last_weechat_plugin = new_plugin;
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL,
_("Initializing plugin \"%s\" %s\n"),
new_plugin->name, new_plugin->version);
@@ -1221,7 +1221,7 @@ plugin_load (char *filename)
/* init plugin */
if (((t_weechat_init_func *)init_func) (new_plugin) < 0)
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to initialize plugin \"%s\"\n"),
WEECHAT_ERROR, full_name);
@@ -1232,7 +1232,7 @@ plugin_load (char *filename)
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s unable to load plugin \"%s\" (not enough memory)\n"),
WEECHAT_ERROR, full_name);
@@ -1240,7 +1240,7 @@ plugin_load (char *filename)
return NULL;
}
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL,
_("Plugin \"%s\" (%s) loaded.\n"),
name, full_name);
@@ -1415,12 +1415,12 @@ plugin_unload_name (char *name)
if (ptr_plugin)
{
plugin_unload (ptr_plugin);
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name);
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin \"%s\" not found\n"),
WEECHAT_ERROR, name);
@@ -1455,7 +1455,7 @@ plugin_reload_name (char *name)
if (filename)
{
plugin_unload (ptr_plugin);
- irc_display_prefix (NULL, NULL, PREFIX_PLUGIN);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_PLUGIN);
gui_printf (NULL, _("Plugin \"%s\" unloaded.\n"), name);
plugin_load (filename);
free (filename);
@@ -1463,7 +1463,7 @@ plugin_reload_name (char *name)
}
else
{
- irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ irc_display_prefix (NULL, NULL, GUI_PREFIX_ERROR);
gui_printf (NULL,
_("%s plugin \"%s\" not found\n"),
WEECHAT_ERROR, name);