mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 02:03:13 +02:00
xfer: use same infolist for hook and signals (patch #7974)
This commit is contained in:
committed by
Sebastien Helleu
parent
b5b9dc342e
commit
d216786846
@@ -96,6 +96,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* lua: fix crash on calls to callbacks during load of script
|
||||
* python: fix load of scripts with python >= 3.3
|
||||
* ruby: fix ruby init with ruby >= 2.0 (bug #41115)
|
||||
* xfer: use same infolist for hook and signals (patch #7974)
|
||||
* xfer: add option xfer.file.auto_check_crc32 (patch #7963)
|
||||
|
||||
== Version 0.4.2 (2013-10-06)
|
||||
|
||||
@@ -1417,8 +1417,8 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", ptr_server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "file_send");
|
||||
weechat_infolist_new_var_string (item, "protocol", "dcc");
|
||||
weechat_infolist_new_var_string (item, "type_string", "file_send");
|
||||
weechat_infolist_new_var_string (item, "protocol_string", "dcc");
|
||||
weechat_infolist_new_var_string (item, "remote_nick", argv[2]);
|
||||
weechat_infolist_new_var_string (item, "local_nick", ptr_server->nick);
|
||||
weechat_infolist_new_var_string (item, "filename", argv_eol[3]);
|
||||
@@ -1448,7 +1448,7 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", ptr_server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "chat_send");
|
||||
weechat_infolist_new_var_string (item, "type_string", "chat_send");
|
||||
weechat_infolist_new_var_string (item, "remote_nick", argv[2]);
|
||||
weechat_infolist_new_var_string (item, "local_nick", ptr_server->nick);
|
||||
snprintf (charset_modifier, sizeof (charset_modifier),
|
||||
|
||||
@@ -618,8 +618,8 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "protocol", "dcc");
|
||||
weechat_infolist_new_var_string (item, "type_string", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "protocol_string", "dcc");
|
||||
weechat_infolist_new_var_string (item, "remote_nick", nick);
|
||||
weechat_infolist_new_var_string (item, "local_nick", server->nick);
|
||||
weechat_infolist_new_var_string (item, "filename",
|
||||
@@ -721,7 +721,7 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "type_string", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "filename",
|
||||
(filename) ? filename : pos_file);
|
||||
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
|
||||
@@ -818,7 +818,7 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "type_string", "file_recv");
|
||||
weechat_infolist_new_var_string (item, "filename",
|
||||
(filename) ? filename : pos_file);
|
||||
weechat_infolist_new_var_integer (item, "port", atoi (pos_port));
|
||||
@@ -925,7 +925,7 @@ irc_ctcp_recv_dcc (struct t_irc_server *server, const char *nick,
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", weechat_plugin->name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", server->name);
|
||||
weechat_infolist_new_var_string (item, "type", "chat_recv");
|
||||
weechat_infolist_new_var_string (item, "type_string", "chat_recv");
|
||||
weechat_infolist_new_var_string (item, "remote_nick", nick);
|
||||
weechat_infolist_new_var_string (item, "local_nick", server->nick);
|
||||
snprintf (charset_modifier, sizeof (charset_modifier),
|
||||
|
||||
@@ -4421,7 +4421,7 @@ irc_server_xfer_send_ready_cb (void *data, const char *signal,
|
||||
ptr_server = irc_server_search (plugin_id);
|
||||
if (ptr_server)
|
||||
{
|
||||
type = weechat_infolist_string (infolist, "type");
|
||||
type = weechat_infolist_string (infolist, "type_string");
|
||||
if (type)
|
||||
{
|
||||
if (strcmp (type, "file_send") == 0)
|
||||
|
||||
+3
-24
@@ -423,33 +423,12 @@ void
|
||||
xfer_send_signal (struct t_xfer *xfer, const char *signal)
|
||||
{
|
||||
struct t_infolist *infolist;
|
||||
struct t_infolist_item *item;
|
||||
char str_long[128];
|
||||
|
||||
infolist = weechat_infolist_new ();
|
||||
if (infolist)
|
||||
{
|
||||
item = weechat_infolist_new_item (infolist);
|
||||
if (item)
|
||||
if (xfer_add_to_infolist (infolist, xfer))
|
||||
{
|
||||
weechat_infolist_new_var_string (item, "plugin_name", xfer->plugin_name);
|
||||
weechat_infolist_new_var_string (item, "plugin_id", xfer->plugin_id);
|
||||
weechat_infolist_new_var_string (item, "type", xfer_type_string[xfer->type]);
|
||||
weechat_infolist_new_var_string (item, "protocol", xfer_protocol_string[xfer->protocol]);
|
||||
weechat_infolist_new_var_string (item, "remote_nick", xfer->remote_nick);
|
||||
weechat_infolist_new_var_string (item, "local_nick", xfer->local_nick);
|
||||
weechat_infolist_new_var_string (item, "charset_modifier", xfer->charset_modifier);
|
||||
weechat_infolist_new_var_string (item, "filename", xfer->filename);
|
||||
snprintf (str_long, sizeof (str_long), "%llu", xfer->size);
|
||||
weechat_infolist_new_var_string (item, "size", str_long);
|
||||
snprintf (str_long, sizeof (str_long), "%llu", xfer->start_resume);
|
||||
weechat_infolist_new_var_string (item, "start_resume", str_long);
|
||||
snprintf (str_long, sizeof (str_long), "%lu", xfer->local_address);
|
||||
weechat_infolist_new_var_string (item, "local_address", str_long);
|
||||
snprintf (str_long, sizeof (str_long), "%lu", xfer->remote_address);
|
||||
weechat_infolist_new_var_string (item, "remote_address", str_long);
|
||||
weechat_infolist_new_var_integer (item, "port", xfer->port);
|
||||
|
||||
weechat_hook_signal_send (signal, WEECHAT_HOOK_SIGNAL_POINTER,
|
||||
infolist);
|
||||
}
|
||||
@@ -948,8 +927,8 @@ xfer_add_cb (void *data, const char *signal, const char *type_data,
|
||||
|
||||
plugin_name = weechat_infolist_string (infolist, "plugin_name");
|
||||
plugin_id = weechat_infolist_string (infolist, "plugin_id");
|
||||
str_type = weechat_infolist_string (infolist, "type");
|
||||
str_protocol = weechat_infolist_string (infolist, "protocol");
|
||||
str_type = weechat_infolist_string (infolist, "type_string");
|
||||
str_protocol = weechat_infolist_string (infolist, "protocol_string");
|
||||
remote_nick = weechat_infolist_string (infolist, "remote_nick");
|
||||
local_nick = weechat_infolist_string (infolist, "local_nick");
|
||||
charset_modifier = weechat_infolist_string (infolist, "charset_modifier");
|
||||
|
||||
Reference in New Issue
Block a user