mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 10:43:13 +02:00
irc: fix redirection of message when message is queued for sending on server
This commit is contained in:
@@ -13,6 +13,7 @@ Version 0.3.8 (under dev!)
|
||||
(task #11316)
|
||||
* core: fix display of wide chars on last column of chat area (patch #7733)
|
||||
* api: add list "gui_buffer_last_displayed" in hdata "buffer"
|
||||
* irc: fix redirection of message when message is queued for sending on server
|
||||
* irc: add signals and tags in messages for irc notify (task #11887)
|
||||
* irc: check notify immediately when adding a nick to notify list, improve
|
||||
first notify message for a nick (bug #35731)
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
'string' (string) +
|
||||
'timeout' (integer) +
|
||||
'command' (string) +
|
||||
'assigned_to_command' (integer) +
|
||||
'start_time' (time) +
|
||||
'cmd_start' (hashtable) +
|
||||
'cmd_stop' (hashtable) +
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
'string' (string) +
|
||||
'timeout' (integer) +
|
||||
'command' (string) +
|
||||
'assigned_to_command' (integer) +
|
||||
'start_time' (time) +
|
||||
'cmd_start' (hashtable) +
|
||||
'cmd_stop' (hashtable) +
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
'string' (string) +
|
||||
'timeout' (integer) +
|
||||
'command' (string) +
|
||||
'assigned_to_command' (integer) +
|
||||
'start_time' (time) +
|
||||
'cmd_start' (hashtable) +
|
||||
'cmd_stop' (hashtable) +
|
||||
|
||||
@@ -78,6 +78,7 @@
|
||||
'string' (string) +
|
||||
'timeout' (integer) +
|
||||
'command' (string) +
|
||||
'assigned_to_command' (integer) +
|
||||
'start_time' (time) +
|
||||
'cmd_start' (hashtable) +
|
||||
'cmd_stop' (hashtable) +
|
||||
|
||||
@@ -458,6 +458,7 @@ irc_redirect_new_with_commands (struct t_irc_server *server,
|
||||
new_redirect->string = (string) ? strdup (string) : NULL;
|
||||
new_redirect->timeout = timeout;
|
||||
new_redirect->command = NULL;
|
||||
new_redirect->assigned_to_command = 0;
|
||||
new_redirect->start_time = 0;
|
||||
new_redirect->cmd_start = hash_cmd[0];
|
||||
new_redirect->cmd_stop = hash_cmd[1];
|
||||
@@ -557,7 +558,7 @@ irc_redirect_search_available (struct t_irc_server *server)
|
||||
for (ptr_redirect = server->redirects; ptr_redirect;
|
||||
ptr_redirect = ptr_redirect->next_redirect)
|
||||
{
|
||||
if (ptr_redirect->start_time == 0)
|
||||
if (!ptr_redirect->assigned_to_command)
|
||||
return ptr_redirect;
|
||||
}
|
||||
|
||||
@@ -592,6 +593,7 @@ irc_redirect_init_command (struct t_irc_redirect *redirect,
|
||||
else
|
||||
redirect->command = NULL;
|
||||
|
||||
redirect->assigned_to_command = 1;
|
||||
redirect->start_time = time (NULL);
|
||||
|
||||
if (weechat_irc_plugin->debug >= 2)
|
||||
@@ -1013,6 +1015,7 @@ irc_redirect_hdata_redirect_cb (void *data, const char *hdata_name)
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, string, STRING, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, timeout, INTEGER, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, command, STRING, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, assigned_to_command, INTEGER, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, start_time, TIME, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_start, HASHTABLE, NULL);
|
||||
WEECHAT_HDATA_VAR(struct t_irc_redirect, cmd_stop, HASHTABLE, NULL);
|
||||
@@ -1098,6 +1101,8 @@ irc_redirect_add_to_infolist (struct t_infolist *infolist,
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_string (ptr_item, "command", redirect->command))
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_integer (ptr_item, "assigned_to_command", redirect->assigned_to_command))
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_time (ptr_item, "start_time", redirect->start_time))
|
||||
return 0;
|
||||
if (!weechat_infolist_new_var_string (ptr_item, "cmd_start", weechat_hashtable_get_string (redirect->cmd_start, "keys_values")))
|
||||
@@ -1169,6 +1174,7 @@ irc_redirect_print_log (struct t_irc_server *server)
|
||||
weechat_log_printf (" string. . . . . . . : '%s'", ptr_redirect->string);
|
||||
weechat_log_printf (" timeout . . . . . . : %d", ptr_redirect->timeout);
|
||||
weechat_log_printf (" command . . . . . . : '%s'", ptr_redirect->command);
|
||||
weechat_log_printf (" assigned_to_command : %d", ptr_redirect->assigned_to_command);
|
||||
weechat_log_printf (" start_time. . . . . : %ld", ptr_redirect->start_time);
|
||||
weechat_log_printf (" cmd_start . . . . . : 0x%lx (hashtable: '%s')",
|
||||
ptr_redirect->cmd_start,
|
||||
|
||||
@@ -54,6 +54,7 @@ struct t_irc_redirect
|
||||
int timeout; /* timeout (in seconds) */
|
||||
char *command; /* command sent to server, which is */
|
||||
/* redirected */
|
||||
int assigned_to_command; /* 1 if assigned to a command */
|
||||
time_t start_time; /* time when command is sent to server */
|
||||
/* (this is begining of this redirect) */
|
||||
struct t_hashtable *cmd_start; /* command(s) starting redirection */
|
||||
|
||||
@@ -1769,6 +1769,9 @@ irc_server_send_one_msg (struct t_irc_server *server, int flags,
|
||||
(new_msg) ? 1 : 0,
|
||||
tags_to_send,
|
||||
ptr_redirect);
|
||||
/* mark redirect as "used" */
|
||||
if (ptr_redirect)
|
||||
ptr_redirect->assigned_to_command = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -568,6 +568,7 @@ irc_upgrade_read_cb (void *data,
|
||||
str = weechat_infolist_string (infolist, "command");
|
||||
if (str)
|
||||
ptr_redirect->command = strdup (str);
|
||||
ptr_redirect->assigned_to_command = weechat_infolist_integer (infolist, "assigned_to_command");
|
||||
ptr_redirect->start_time = weechat_infolist_time (infolist, "start_time");
|
||||
ptr_redirect->cmd_start_received = weechat_infolist_integer (infolist, "cmd_start_received");
|
||||
ptr_redirect->cmd_stop_received = weechat_infolist_integer (infolist, "cmd_stop_received");
|
||||
|
||||
Reference in New Issue
Block a user