mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Added hotlist option for buffer in plugins API, improved buffer refreshs
This commit is contained in:
@@ -707,7 +707,7 @@ alias_completion_cb (void *data, char *completion, struct t_gui_buffer *buffer,
|
||||
for (ptr_alias = alias_list; ptr_alias;
|
||||
ptr_alias = ptr_alias->next_alias)
|
||||
{
|
||||
weechat_list_add (list, ptr_alias->name, "sort");
|
||||
weechat_list_add (list, ptr_alias->name, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -469,7 +469,7 @@ irc_channel_add_nick_speaking (struct t_irc_channel *channel, char *nick)
|
||||
if (!channel->nicks_speaking)
|
||||
channel->nicks_speaking = weechat_list_new ();
|
||||
|
||||
weechat_list_add (channel->nicks_speaking, nick, "end");
|
||||
weechat_list_add (channel->nicks_speaking, nick, WEECHAT_LIST_POS_END);
|
||||
|
||||
size = weechat_list_size (channel->nicks_speaking);
|
||||
if (size > IRC_CHANNEL_NICKS_SPEAKING_LIMIT)
|
||||
|
||||
@@ -156,7 +156,7 @@ irc_command_ame (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -171,7 +171,7 @@ irc_command_ame (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
}
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
}
|
||||
else
|
||||
return WEECHAT_RC_ERROR;
|
||||
@@ -387,7 +387,7 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
(void) data;
|
||||
(void) argv;
|
||||
|
||||
//gui_add_hotlist = 0;
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
if ((argc > 2) && (weechat_strcasecmp (argv[1], "-all") == 0))
|
||||
{
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
@@ -400,8 +400,8 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
else
|
||||
irc_command_away_server (ptr_server, argv_eol[1]);
|
||||
|
||||
//gui_status_draw (window->buffer, 1);
|
||||
//gui_add_hotlist = 1;
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ irc_completion_server_cb (void *data, char *completion,
|
||||
(void) completion;
|
||||
|
||||
if (ptr_server)
|
||||
weechat_list_add (list, ptr_server->name, "sort");
|
||||
weechat_list_add (list, ptr_server->name, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -90,7 +90,8 @@ irc_completion_server_nicks_cb (void *data, char *completion,
|
||||
for (ptr_nick = ptr_channel2->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_list_add (list, ptr_nick->name, "sort");
|
||||
weechat_list_add (list, ptr_nick->name,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,12 +103,13 @@ irc_completion_server_nicks_cb (void *data, char *completion,
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_list_add (list, ptr_nick->name, "beginning");
|
||||
weechat_list_add (list, ptr_nick->name,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
}
|
||||
|
||||
/* add self nick at the end */
|
||||
weechat_list_add (list, ptr_server->nick, "end");
|
||||
weechat_list_add (list, ptr_server->nick, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -131,7 +133,7 @@ irc_completion_servers_cb (void *data, char *completion,
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
weechat_list_add (list, ptr_server->name, "sort");
|
||||
weechat_list_add (list, ptr_server->name, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -152,7 +154,7 @@ irc_completion_channel_cb (void *data, char *completion,
|
||||
(void) completion;
|
||||
|
||||
if (ptr_channel)
|
||||
weechat_list_add (list, ptr_channel->name, "sort");
|
||||
weechat_list_add (list, ptr_channel->name, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -184,7 +186,8 @@ irc_completion_channel_nicks_cb (void *data, char *completion,
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_list_add (list, ptr_nick->name, "sort");
|
||||
weechat_list_add (list, ptr_nick->name,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
/* add nicks speaking recently on this channel */
|
||||
@@ -196,18 +199,19 @@ irc_completion_channel_nicks_cb (void *data, char *completion,
|
||||
nick = weechat_list_string (weechat_list_get (ptr_channel->nicks_speaking, i));
|
||||
if (nick && irc_nick_search (ptr_channel, nick))
|
||||
{
|
||||
weechat_list_add (list, nick, "beginning");
|
||||
weechat_list_add (list, nick,
|
||||
WEECHAT_LIST_POS_BEGINNING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* add self nick at the end */
|
||||
weechat_list_add (list, ptr_server->nick, "end");
|
||||
weechat_list_add (list, ptr_server->nick, WEECHAT_LIST_POS_END);
|
||||
}
|
||||
if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
|| (ptr_channel->type == IRC_CHANNEL_TYPE_DCC_CHAT))
|
||||
{
|
||||
weechat_list_add (list, ptr_channel->name, "sort");
|
||||
weechat_list_add (list, ptr_channel->name, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,7 +245,7 @@ irc_completion_channel_nicks_hosts_cb (void *data, char *completion,
|
||||
for (ptr_nick = ptr_channel->nicks; ptr_nick;
|
||||
ptr_nick = ptr_nick->next_nick)
|
||||
{
|
||||
weechat_list_add (list, ptr_nick->name, "sort");
|
||||
weechat_list_add (list, ptr_nick->name, WEECHAT_LIST_POS_SORT);
|
||||
if (ptr_nick->host)
|
||||
{
|
||||
length = strlen (ptr_nick->name) + 1 +
|
||||
@@ -251,7 +255,7 @@ irc_completion_channel_nicks_hosts_cb (void *data, char *completion,
|
||||
{
|
||||
snprintf (buf, length, "%s!%s",
|
||||
ptr_nick->name, ptr_nick->host);
|
||||
weechat_list_add (list, buf, "sort");
|
||||
weechat_list_add (list, buf, WEECHAT_LIST_POS_SORT);
|
||||
free (buf);
|
||||
}
|
||||
}
|
||||
@@ -260,7 +264,8 @@ irc_completion_channel_nicks_hosts_cb (void *data, char *completion,
|
||||
if ((ptr_channel->type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
|| (ptr_channel->type == IRC_CHANNEL_TYPE_DCC_CHAT))
|
||||
{
|
||||
weechat_list_add (list, ptr_channel->name, "sort");
|
||||
weechat_list_add (list, ptr_channel->name,
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -285,7 +290,7 @@ irc_completion_channel_topic_cb (void *data, char *completion,
|
||||
|
||||
if (ptr_channel && ptr_channel->topic && ptr_channel->topic[0])
|
||||
{
|
||||
weechat_list_add (list, ptr_channel->topic, "sort");
|
||||
weechat_list_add (list, ptr_channel->topic, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -313,7 +318,7 @@ irc_completion_channels_cb (void *data, char *completion,
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
weechat_list_add (list, ptr_channel->name, "sort");
|
||||
weechat_list_add (list, ptr_channel->name, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -338,7 +343,7 @@ irc_completion_msg_part_cb (void *data, char *completion,
|
||||
{
|
||||
weechat_list_add (list,
|
||||
weechat_config_string (irc_config_irc_default_msg_part),
|
||||
"sort");
|
||||
WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
+36
-42
@@ -57,19 +57,13 @@ char *irc_dcc_status_string[] = /* strings for DCC status */
|
||||
*/
|
||||
|
||||
void
|
||||
irc_dcc_redraw (int highlight)
|
||||
irc_dcc_redraw (char *hotlist)
|
||||
{
|
||||
(void) highlight;
|
||||
/*struct t_gui_buffer *ptr_buffer;
|
||||
|
||||
ptr_buffer = gui_buffer_get_dcc (gui_current_window);
|
||||
gui_window_redraw_buffer (ptr_buffer);
|
||||
if (highlight && gui_add_hotlist && (ptr_buffer->num_displayed == 0))
|
||||
{
|
||||
gui_hotlist_add (highlight, NULL, ptr_buffer, 0);
|
||||
gui_status_draw (gui_current_window->buffer, 0);
|
||||
}
|
||||
*/
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
|
||||
ptr_buffer = weechat_buffer_search ("irc", "<dcc>");
|
||||
if (ptr_buffer && hotlist)
|
||||
weechat_buffer_set (ptr_buffer, "hotlist", hotlist);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -208,7 +202,7 @@ irc_dcc_find_filename (struct t_irc_dcc *ptr_dcc)
|
||||
if (!irc_cfg_dcc_auto_rename)
|
||||
{
|
||||
irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,7 +210,7 @@ irc_dcc_find_filename (struct t_irc_dcc *ptr_dcc)
|
||||
if (!filename2)
|
||||
{
|
||||
irc_dcc_close (ptr_dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return;
|
||||
}
|
||||
ptr_dcc->filename_suffix = 0;
|
||||
@@ -562,7 +556,7 @@ irc_dcc_channel_for_chat (struct t_irc_dcc *dcc)
|
||||
"DCC CHAT?)\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -611,7 +605,7 @@ irc_dcc_recv_connect_init (struct t_irc_dcc *dcc)
|
||||
if (!irc_dcc_connect (dcc))
|
||||
{
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -628,7 +622,7 @@ irc_dcc_recv_connect_init (struct t_irc_dcc *dcc)
|
||||
irc_dcc_channel_for_chat (dcc);
|
||||
}
|
||||
}
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -647,7 +641,7 @@ irc_dcc_accept (struct t_irc_dcc *dcc)
|
||||
"PRIVMSG %s :\01DCC RESUME %s %d %u\01",
|
||||
dcc->nick, dcc->filename,
|
||||
dcc->port, dcc->start_resume);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
else
|
||||
irc_dcc_recv_connect_init (dcc);
|
||||
@@ -684,7 +678,7 @@ irc_dcc_accept_resume (struct t_irc_server *server, char *filename, int port,
|
||||
ptr_dcc->filename,
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
ptr_dcc->start_resume);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
else
|
||||
gui_chat_printf (server->buffer,
|
||||
@@ -854,7 +848,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
GUI_COLOR(GUI_COLOR_CHAT_CHANNEL),
|
||||
size,
|
||||
GUI_COLOR(GUI_COLOR_CHAT));
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
if (type == IRC_DCC_FILE_SEND)
|
||||
{
|
||||
@@ -873,7 +867,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
GUI_COLOR(GUI_COLOR_CHAT_CHANNEL),
|
||||
size,
|
||||
GUI_COLOR(GUI_COLOR_CHAT));
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
if (type == IRC_DCC_CHAT_RECV)
|
||||
{
|
||||
@@ -889,7 +883,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
(addr >> 8) & 0xff,
|
||||
addr & 0xff,
|
||||
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS));
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
if (type == IRC_DCC_CHAT_SEND)
|
||||
{
|
||||
@@ -897,13 +891,13 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
_("Sending DCC chat request to %s%s\n"),
|
||||
GUI_COLOR(GUI_COLOR_CHAT_NICK),
|
||||
nick);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
|
||||
if (IRC_DCC_IS_FILE(type) && (!new_dcc->local_filename))
|
||||
{
|
||||
irc_dcc_close (new_dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -919,7 +913,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
new_dcc->local_filename,
|
||||
GUI_COLOR(GUI_COLOR_CHAT),
|
||||
new_dcc->start_resume);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
|
||||
/* connect if needed and redraw DCC buffer */
|
||||
@@ -928,7 +922,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
if (!irc_dcc_connect (new_dcc))
|
||||
{
|
||||
irc_dcc_close (new_dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -937,7 +931,7 @@ irc_dcc_add (struct t_irc_server *server, int type, unsigned long addr, int port
|
||||
|| ( (type == IRC_DCC_FILE_RECV) && (irc_cfg_dcc_auto_accept_files) ) )
|
||||
irc_dcc_accept (new_dcc);
|
||||
else
|
||||
irc_dcc_redraw (GUI_HOTLIST_PRIVATE);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_PRIVATE);
|
||||
gui_status_draw (gui_current_window->buffer, 0);
|
||||
|
||||
return new_dcc;
|
||||
@@ -1350,7 +1344,7 @@ irc_dcc_chat_recv (struct t_irc_dcc *dcc)
|
||||
else
|
||||
{
|
||||
irc_dcc_close (dcc, IRC_DCC_ABORTED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1370,7 +1364,7 @@ irc_dcc_file_create_pipe (struct t_irc_dcc *dcc)
|
||||
_("%s DCC: unable to create pipe\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1640,18 +1634,18 @@ irc_dcc_file_child_read (struct t_irc_dcc *dcc)
|
||||
dcc->status = IRC_DCC_ACTIVE;
|
||||
dcc->start_transfer = time (NULL);
|
||||
dcc->last_check_time = time (NULL);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
else
|
||||
irc_dcc_redraw (GUI_HOTLIST_LOW);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_LOW);
|
||||
break;
|
||||
case IRC_DCC_DONE:
|
||||
irc_dcc_close (dcc, IRC_DCC_DONE);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
break;
|
||||
case IRC_DCC_FAILED:
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1679,7 +1673,7 @@ irc_dcc_file_send_fork (struct t_irc_dcc *dcc)
|
||||
_("%s DCC: unable to fork\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return;
|
||||
/* child process */
|
||||
case 0:
|
||||
@@ -1720,7 +1714,7 @@ irc_dcc_file_recv_fork (struct t_irc_dcc *dcc)
|
||||
_("%s DCC: unable to fork\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
return;
|
||||
/* child process */
|
||||
case 0:
|
||||
@@ -1759,7 +1753,7 @@ irc_dcc_handle ()
|
||||
_("%s DCC: timeout\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1792,7 +1786,7 @@ irc_dcc_handle ()
|
||||
"sending file\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
continue;
|
||||
}
|
||||
dcc->sock = sock;
|
||||
@@ -1804,13 +1798,13 @@ irc_dcc_handle ()
|
||||
"socket\n"),
|
||||
WEECHAT_ERROR);
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
continue;
|
||||
}
|
||||
dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
dcc->status = IRC_DCC_ACTIVE;
|
||||
dcc->start_transfer = time (NULL);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
irc_dcc_file_send_fork (dcc);
|
||||
}
|
||||
}
|
||||
@@ -1843,19 +1837,19 @@ irc_dcc_handle ()
|
||||
if (sock < 0)
|
||||
{
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
continue;
|
||||
}
|
||||
dcc->sock = sock;
|
||||
if (fcntl (dcc->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
{
|
||||
irc_dcc_close (dcc, IRC_DCC_FAILED);
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
continue;
|
||||
}
|
||||
dcc->addr = ntohl (addr.sin_addr.s_addr);
|
||||
dcc->status = IRC_DCC_ACTIVE;
|
||||
irc_dcc_redraw (GUI_HOTLIST_MSG);
|
||||
irc_dcc_redraw (WEECHAT_HOTLIST_MESSAGE);
|
||||
irc_dcc_channel_for_chat (dcc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -659,16 +659,8 @@ irc_protocol_cmd_invite (struct t_irc_server *server, int argc, char **argv,
|
||||
IRC_COLOR_CHAT,
|
||||
IRC_COLOR_CHAT_NICK,
|
||||
irc_protocol_get_nick_from_host (argv[0]));
|
||||
/*
|
||||
if (gui_add_hotlist
|
||||
&& ((server->buffer->num_displayed == 0)
|
||||
|| (gui_buffer_is_scrolled (server->buffer))))
|
||||
{
|
||||
gui_hotlist_add (GUI_HOTLIST_HIGHLIGHT, NULL,
|
||||
server->buffer, 0);
|
||||
gui_status_draw (gui_current_window->buffer, 1);
|
||||
}
|
||||
*/
|
||||
weechat_buffer_set (server->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_HIGHLIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -747,7 +739,7 @@ irc_protocol_cmd_join (struct t_irc_server *server, int argc, char **argv,
|
||||
{
|
||||
free (ptr_channel->topic);
|
||||
ptr_channel->topic = NULL;
|
||||
//gui_chat_draw_title (ptr_channel->buffer, 1);
|
||||
weechat_buffer_set (ptr_channel->buffer, "title", NULL);
|
||||
}
|
||||
ptr_channel->display_creation_date = 1;
|
||||
}
|
||||
@@ -758,10 +750,6 @@ irc_protocol_cmd_join (struct t_irc_server *server, int argc, char **argv,
|
||||
0, 0, 0, 0, 0, 0, 0);
|
||||
if (ptr_nick)
|
||||
ptr_nick->host = strdup (irc_protocol_get_address_from_host (argv[0]));
|
||||
|
||||
/* redraw nicklist and status bar */
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_status_draw (ptr_channel->buffer, 1);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -862,8 +850,6 @@ irc_protocol_cmd_kick (struct t_irc_server *server, char *irc_message, char *hos
|
||||
/* my nick was kicked => free all nicks, channel is not active any
|
||||
more */
|
||||
irc_nick_free_all (ptr_channel);
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_status_draw (ptr_channel->buffer, 1);
|
||||
if (server->autorejoin)
|
||||
irc_command_join_server (server, ptr_channel->name);
|
||||
}
|
||||
@@ -873,11 +859,7 @@ irc_protocol_cmd_kick (struct t_irc_server *server, char *irc_message, char *hos
|
||||
nick */
|
||||
ptr_nick = irc_nick_search (ptr_channel, pos_nick);
|
||||
if (ptr_nick)
|
||||
{
|
||||
irc_nick_free (ptr_channel, ptr_nick);
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_status_draw (ptr_channel->buffer, 1);
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -1125,8 +1107,11 @@ irc_protocol_cmd_nick (struct t_irc_server *server, char *irc_message, char *hos
|
||||
if (ptr_nick)
|
||||
{
|
||||
nick_is_me = (strcmp (ptr_nick->name, server->nick) == 0) ? 1 : 0;
|
||||
//if (nick_is_me)
|
||||
// gui_add_hotlist = 0;
|
||||
|
||||
/* temporary disable hotlist */
|
||||
weechat_buffer_set (NULL, "hotlist", "-");
|
||||
|
||||
/* change nick and display message on all channels */
|
||||
irc_nick_change (server, ptr_channel, ptr_nick, arguments);
|
||||
if (!ignore)
|
||||
{
|
||||
@@ -1146,8 +1131,9 @@ irc_protocol_cmd_nick (struct t_irc_server *server, char *irc_message, char *hos
|
||||
IRC_COLOR_CHAT_NICK,
|
||||
arguments);
|
||||
}
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_add_hotlist = 1;
|
||||
|
||||
/* enable hotlist */
|
||||
weechat_buffer_set (NULL, "hotlist", "+");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1157,21 +1143,13 @@ irc_protocol_cmd_nick (struct t_irc_server *server, char *irc_message, char *hos
|
||||
{
|
||||
free (server->nick);
|
||||
server->nick = strdup (arguments);
|
||||
/*
|
||||
gui_status_draw (gui_current_window->buffer, 1);
|
||||
for (ptr_window = gui_windows; ptr_window;
|
||||
ptr_window = ptr_window->next_window)
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
if ((ptr_window->buffer->protocol == irc_protocol)
|
||||
&& (IRC_BUFFER_SERVER(ptr_window->buffer) == server))
|
||||
gui_input_draw (ptr_window->buffer, 1);
|
||||
weechat_buffer_set (ptr_channel->buffer, "nick",
|
||||
server->nick);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
//gui_status_draw (gui_current_window->buffer, 1);
|
||||
//gui_input_draw (gui_current_window->buffer, 1);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -1368,20 +1346,14 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *irc_message, char *h
|
||||
weechat_printf (server->buffer, "%s%s",
|
||||
IRC_COLOR_CHAT,
|
||||
pos);
|
||||
|
||||
|
||||
if ((nick)
|
||||
&& (weechat_strcasecmp (nick, "nickserv") != 0)
|
||||
&& (weechat_strcasecmp (nick, "chanserv") != 0)
|
||||
&& (weechat_strcasecmp (nick, "memoserv") != 0))
|
||||
{
|
||||
//if (gui_add_hotlist
|
||||
// && ((server->buffer->num_displayed == 0)
|
||||
// || (gui_buffer_is_scrolled (server->buffer))))
|
||||
//{
|
||||
// gui_hotlist_add (GUI_HOTLIST_PRIVATE, NULL,
|
||||
// server->buffer, 0);
|
||||
// gui_status_draw (gui_current_window->buffer, 1);
|
||||
//}
|
||||
weechat_buffer_set (server->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_PRIVATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1516,13 +1488,6 @@ irc_protocol_cmd_part (struct t_irc_server *server, char *irc_message, char *hos
|
||||
}
|
||||
else
|
||||
irc_nick_free (ptr_channel, ptr_nick);
|
||||
|
||||
if (ptr_channel)
|
||||
{
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_status_draw (ptr_channel->buffer, 1);
|
||||
}
|
||||
//gui_input_draw (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1893,6 +1858,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
|
||||
ptr_channel->name,
|
||||
nick,
|
||||
pos);
|
||||
weechat_buffer_set (ptr_channel->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_HIGHLIGHT);
|
||||
//(void) plugin_msg_handler_exec (server->name,
|
||||
// "weechat_highlight",
|
||||
// irc_message);
|
||||
@@ -1905,6 +1872,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
|
||||
(ptr_nick) ? NULL : nick,
|
||||
NULL),
|
||||
pos);
|
||||
weechat_buffer_set (ptr_channel->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
irc_channel_add_nick_speaking (ptr_channel, nick);
|
||||
}
|
||||
@@ -2306,6 +2275,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
|
||||
//(void) plugin_msg_handler_exec (server->name,
|
||||
// "weechat_highlight",
|
||||
// irc_message);
|
||||
weechat_buffer_set (ptr_channel->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_HIGHLIGHT);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2319,6 +2290,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
|
||||
//(void) plugin_msg_handler_exec (server->name,
|
||||
// "weechat_pv",
|
||||
// irc_message);
|
||||
weechat_buffer_set (ptr_channel->buffer, "hotlist",
|
||||
WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2394,7 +2367,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
|
||||
if (!ptr_channel->topic)
|
||||
{
|
||||
ptr_channel->topic = strdup (host2);
|
||||
//gui_chat_draw_title (ptr_channel->buffer, 1);
|
||||
weechat_buffer_set (ptr_channel->buffer, "title",
|
||||
ptr_channel->topic);
|
||||
}
|
||||
|
||||
if (highlight || irc_protocol_is_highlight (pos, server->nick))
|
||||
@@ -2505,8 +2479,6 @@ irc_protocol_cmd_quit (struct t_irc_server *server, char *irc_message, char *hos
|
||||
arguments,
|
||||
IRC_COLOR_CHAT_DELIMITERS);
|
||||
}
|
||||
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
|
||||
//gui_status_draw (ptr_channel->buffer, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2678,7 +2650,7 @@ irc_protocol_cmd_topic (struct t_irc_server *server, char *irc_message, char *ho
|
||||
ptr_channel->topic = strdup (pos);
|
||||
else
|
||||
ptr_channel->topic = strdup ("");
|
||||
//gui_chat_draw_title (ptr_channel->buffer, 1);
|
||||
weechat_buffer_set (ptr_channel->buffer, "title", ptr_channel->topic);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
@@ -2778,9 +2750,6 @@ irc_protocol_cmd_001 (struct t_irc_server *server, char *irc_message, char *host
|
||||
else
|
||||
irc_server_autojoin_channels (server);
|
||||
|
||||
//gui_status_draw (server->buffer, 1);
|
||||
//gui_input_draw (server->buffer, 1);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -4328,7 +4297,6 @@ irc_protocol_cmd_341 (struct t_irc_server *server, char *irc_message, char *host
|
||||
IRC_COLOR_CHAT,
|
||||
IRC_COLOR_CHAT_CHANNEL,
|
||||
pos_channel);
|
||||
//gui_status_draw (gui_current_window->buffer, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -52,9 +52,16 @@ struct t_weelist;
|
||||
#define WEECHAT_RC_WITH_HIGHLIGHT 4 /* ok and ask for highlight */
|
||||
/* (for message handler only) */
|
||||
|
||||
#define WEELIST_POS_SORT "sort"
|
||||
#define WEELIST_POS_BEGINNING "beginning"
|
||||
#define WEELIST_POS_END "end"
|
||||
/* list management (order of elements) */
|
||||
#define WEECHAT_LIST_POS_SORT "sort"
|
||||
#define WEECHAT_LIST_POS_BEGINNING "beginning"
|
||||
#define WEECHAT_LIST_POS_END "end"
|
||||
|
||||
/* buffer hotlist */
|
||||
#define WEECHAT_HOTLIST_LOW "0"
|
||||
#define WEECHAT_HOTLIST_MESSAGE "1"
|
||||
#define WEECHAT_HOTLIST_PRIVATE "2"
|
||||
#define WEECHAT_HOTLIST_HIGHLIGHT "3"
|
||||
|
||||
struct t_weechat_plugin
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user