mirror of
https://github.com/weechat/weechat.git
synced 2026-07-10 07:05:42 +02:00
core: remove unneeded whitespace
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -37,19 +37,19 @@ alias_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_alias *ptr_alias;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (!infolist_name || !infolist_name[0])
|
||||
return NULL;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (infolist_name, ALIAS_PLUGIN_NAME) == 0)
|
||||
{
|
||||
if (pointer && !alias_valid (pointer))
|
||||
return NULL;
|
||||
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (ptr_infolist)
|
||||
{
|
||||
@@ -83,7 +83,7 @@ alias_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+79
-79
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ struct t_aspell_speller
|
||||
{
|
||||
AspellSpeller *speller; /* aspell speller */
|
||||
char *lang; /* language */
|
||||
|
||||
|
||||
struct t_aspell_speller *prev_speller; /* pointer to next speller */
|
||||
struct t_aspell_speller *next_speller; /* pointer to previous speller */
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+24
-24
File diff suppressed because it is too large
Load Diff
@@ -38,12 +38,12 @@ fifo_info_get_info_cb (void *data, const char *info_name,
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (info_name, "fifo_filename") == 0)
|
||||
{
|
||||
return fifo_filename;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
+39
-39
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -49,15 +49,15 @@ irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer,
|
||||
{
|
||||
struct t_irc_server *ptr_server;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
|
||||
if (server)
|
||||
*server = NULL;
|
||||
if (channel)
|
||||
*channel = NULL;
|
||||
|
||||
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
|
||||
/* look for a server or channel using this buffer */
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
@@ -68,7 +68,7 @@ irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer,
|
||||
*server = ptr_server;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (ptr_channel = ptr_server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ irc_buffer_get_server_and_channel (struct t_gui_buffer *buffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* no server or channel found */
|
||||
}
|
||||
|
||||
@@ -94,18 +94,18 @@ char *
|
||||
irc_buffer_build_name (const char *server, const char *channel)
|
||||
{
|
||||
static char buffer[128];
|
||||
|
||||
|
||||
buffer[0] = '\0';
|
||||
|
||||
|
||||
if (!server && !channel)
|
||||
return buffer;
|
||||
|
||||
|
||||
if (server && channel)
|
||||
snprintf (buffer, sizeof (buffer), "%s.%s", server, channel);
|
||||
else
|
||||
snprintf (buffer, sizeof (buffer), "%s",
|
||||
(server) ? server : channel);
|
||||
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
@@ -117,12 +117,12 @@ int
|
||||
irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_irc_channel *next_channel;
|
||||
|
||||
|
||||
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
|
||||
if (buffer == irc_raw_buffer)
|
||||
{
|
||||
irc_raw_buffer = NULL;
|
||||
@@ -156,7 +156,7 @@ irc_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -172,10 +172,10 @@ irc_buffer_search_first_for_all_servers ()
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
struct t_irc_server *ptr_server;
|
||||
int number, number_found;
|
||||
|
||||
|
||||
ptr_buffer = NULL;
|
||||
number_found = INT_MAX;
|
||||
|
||||
|
||||
for (ptr_server = irc_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+17
-17
File diff suppressed because it is too large
Load Diff
+370
-370
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+118
-118
File diff suppressed because it is too large
Load Diff
+78
-78
File diff suppressed because it is too large
Load Diff
@@ -44,23 +44,23 @@ irc_debug_signal_debug_dump_cb (void *data, const char *signal,
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
|
||||
if (!signal_data
|
||||
|| (weechat_strcasecmp ((char *)signal_data, IRC_PLUGIN_NAME) == 0))
|
||||
{
|
||||
weechat_log_printf ("");
|
||||
weechat_log_printf ("***** \"%s\" plugin dump *****",
|
||||
weechat_plugin->name);
|
||||
|
||||
|
||||
irc_server_print_log ();
|
||||
irc_ignore_print_log ();
|
||||
irc_redirect_pattern_print_log ();
|
||||
|
||||
|
||||
weechat_log_printf ("");
|
||||
weechat_log_printf ("***** End of \"%s\" plugin dump *****",
|
||||
weechat_plugin->name);
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
|
||||
{
|
||||
char *pos_nickserv, *pos, *pos_pwd, *pos_space;
|
||||
int char_size;
|
||||
|
||||
|
||||
pos = string;
|
||||
while (pos)
|
||||
{
|
||||
@@ -110,7 +110,7 @@ irc_display_hide_password (char *string, int look_for_nickserv)
|
||||
{
|
||||
pos_pwd++;
|
||||
}
|
||||
|
||||
|
||||
while (pos_pwd && pos_pwd[0] && (pos_pwd[0] != ' '))
|
||||
{
|
||||
char_size = weechat_utf8_char_size (pos_pwd);
|
||||
@@ -132,7 +132,7 @@ irc_display_away (struct t_irc_server *server, const char *string1,
|
||||
const char *string2)
|
||||
{
|
||||
struct t_irc_channel *ptr_channel;
|
||||
|
||||
|
||||
for (ptr_channel = server->channels; ptr_channel;
|
||||
ptr_channel = ptr_channel->next_channel)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,5 +56,5 @@ extern struct t_hdata *irc_ignore_hdata_ignore_cb (void *data,
|
||||
extern int irc_ignore_add_to_infolist (struct t_infolist *infolist,
|
||||
struct t_irc_ignore *ignore);
|
||||
extern void irc_ignore_print_log ();
|
||||
|
||||
|
||||
#endif /* __WEECHAT_IRC_IGNORE_H */
|
||||
|
||||
+24
-24
File diff suppressed because it is too large
Load Diff
+26
-26
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -46,12 +46,12 @@ irc_mode_channel_set (struct t_irc_server *server,
|
||||
char *pos_args, *str_modes, set_flag, **argv, *pos, *ptr_arg;
|
||||
int modes_count, channel_modes_updated, argc, current_arg;
|
||||
struct t_irc_nick *ptr_nick;
|
||||
|
||||
|
||||
if (!server || !channel || !modes)
|
||||
return 0;
|
||||
|
||||
|
||||
channel_modes_updated = 0;
|
||||
|
||||
|
||||
argc = 0;
|
||||
argv = NULL;
|
||||
pos_args = strchr (modes, ' ');
|
||||
@@ -85,7 +85,7 @@ irc_mode_channel_set (struct t_irc_server *server,
|
||||
pos++;
|
||||
}
|
||||
current_arg = argc - modes_count;
|
||||
|
||||
|
||||
if (str_modes && str_modes[0])
|
||||
{
|
||||
set_flag = '+';
|
||||
@@ -158,14 +158,14 @@ irc_mode_channel_set (struct t_irc_server *server,
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (str_modes)
|
||||
free (str_modes);
|
||||
if (argv)
|
||||
weechat_string_free_split (argv);
|
||||
|
||||
|
||||
weechat_bar_item_update ("buffer_name");
|
||||
|
||||
|
||||
return channel_modes_updated;
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ irc_mode_user_add (struct t_irc_server *server, char mode)
|
||||
|
||||
str_mode[0] = mode;
|
||||
str_mode[1] = '\0';
|
||||
|
||||
|
||||
if (server->nick_modes)
|
||||
{
|
||||
if (!strchr (server->nick_modes, mode))
|
||||
@@ -218,7 +218,7 @@ irc_mode_user_remove (struct t_irc_server *server, char mode)
|
||||
{
|
||||
char *pos, *nick_modes2;
|
||||
int new_size;
|
||||
|
||||
|
||||
if (server->nick_modes)
|
||||
{
|
||||
pos = strchr (server->nick_modes, mode);
|
||||
|
||||
@@ -50,7 +50,7 @@ irc_msgbuffer_get_option (struct t_irc_server *server, const char *message)
|
||||
{
|
||||
snprintf (option_name, sizeof (option_name),
|
||||
"%s.%s", server->name, message);
|
||||
|
||||
|
||||
/* search for msgbuffer in config file, for server */
|
||||
ptr_option = weechat_config_search_option (irc_config_file,
|
||||
irc_config_section_msgbuffer,
|
||||
@@ -58,14 +58,14 @@ irc_msgbuffer_get_option (struct t_irc_server *server, const char *message)
|
||||
if (ptr_option)
|
||||
return ptr_option;
|
||||
}
|
||||
|
||||
|
||||
/* search for msgbuffer in config file */
|
||||
ptr_option = weechat_config_search_option (irc_config_file,
|
||||
irc_config_section_msgbuffer,
|
||||
message);
|
||||
if (ptr_option)
|
||||
return ptr_option;
|
||||
|
||||
|
||||
/* no msgbuffer found in config */
|
||||
return NULL;
|
||||
}
|
||||
@@ -92,18 +92,18 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
struct t_irc_channel *ptr_channel;
|
||||
struct t_weechat_plugin *buffer_plugin;
|
||||
|
||||
|
||||
ptr_option = irc_msgbuffer_get_option (server, message);
|
||||
if (!ptr_option && alias && alias[0])
|
||||
ptr_option = irc_msgbuffer_get_option (server, alias);
|
||||
|
||||
|
||||
if (!ptr_option)
|
||||
{
|
||||
if (default_buffer)
|
||||
return default_buffer;
|
||||
return (server) ? server->buffer : NULL;
|
||||
}
|
||||
|
||||
|
||||
target = weechat_config_integer (ptr_option);
|
||||
switch (target)
|
||||
{
|
||||
@@ -129,11 +129,11 @@ irc_msgbuffer_get_target_buffer (struct t_irc_server *server, const char *nick,
|
||||
return (server) ? server->buffer : NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
ptr_buffer = weechat_current_buffer ();
|
||||
buffer_plugin = weechat_buffer_get_pointer (ptr_buffer, "plugin");
|
||||
if (buffer_plugin == weechat_irc_plugin)
|
||||
return ptr_buffer;
|
||||
|
||||
|
||||
return (server) ? server->buffer : NULL;
|
||||
}
|
||||
|
||||
+92
-92
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -64,5 +64,5 @@ extern void irc_notify_hook_timer_ison ();
|
||||
extern void irc_notify_hook_timer_whois ();
|
||||
extern void irc_notify_init ();
|
||||
extern void irc_notify_end ();
|
||||
|
||||
|
||||
#endif /* __WEECHAT_IRC_NOTIFY_H */
|
||||
|
||||
+384
-384
File diff suppressed because it is too large
Load Diff
+30
-30
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+19
-19
File diff suppressed because it is too large
Load Diff
+280
-280
File diff suppressed because it is too large
Load Diff
@@ -121,7 +121,7 @@ struct t_irc_server
|
||||
/* user choices */
|
||||
char *name; /* internal name of server */
|
||||
struct t_config_option *options[IRC_SERVER_NUM_OPTIONS];
|
||||
|
||||
|
||||
/* internal vars */
|
||||
int temp_server; /* temporary server (not saved) */
|
||||
int reloading_from_config; /* 1 if reloading from config file */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+32
-32
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -39,19 +39,19 @@ logger_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_logger_buffer *ptr_logger_buffer;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (!infolist_name || !infolist_name[0])
|
||||
return NULL;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (infolist_name, "logger_buffer") == 0)
|
||||
{
|
||||
if (pointer && !logger_buffer_valid (pointer))
|
||||
return NULL;
|
||||
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (ptr_infolist)
|
||||
{
|
||||
@@ -82,7 +82,7 @@ logger_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ logger_tail_last_eol (const char *string_start, const char *string_ptr)
|
||||
return (char *)string_ptr;
|
||||
string_ptr--;
|
||||
}
|
||||
|
||||
|
||||
/* no end-of-line found in string */
|
||||
return NULL;
|
||||
}
|
||||
@@ -71,12 +71,12 @@ logger_tail_file (const char *filename, int n_lines)
|
||||
char buf[LOGGER_TAIL_BUFSIZE + 1];
|
||||
char *ptr_buf, *pos_eol, *part_of_line, *new_part_of_line;
|
||||
struct t_logger_line *ptr_line, *new_line;
|
||||
|
||||
|
||||
/* open file */
|
||||
fd = open (filename, O_RDONLY);
|
||||
if (fd == -1)
|
||||
return NULL;
|
||||
|
||||
|
||||
/* seek to the end of file */
|
||||
file_length = lseek (fd, (off_t)0, SEEK_END);
|
||||
if (file_length <= 0)
|
||||
@@ -91,7 +91,7 @@ logger_tail_file (const char *filename, int n_lines)
|
||||
else
|
||||
to_read = LOGGER_TAIL_BUFSIZE;
|
||||
lseek (fd, file_pos, SEEK_SET);
|
||||
|
||||
|
||||
/* loop until we have "n_lines" lines in list */
|
||||
part_of_line = NULL;
|
||||
ptr_line = NULL;
|
||||
@@ -200,12 +200,12 @@ logger_tail_file (const char *filename, int n_lines)
|
||||
else
|
||||
to_read = LOGGER_TAIL_BUFSIZE;
|
||||
}
|
||||
|
||||
|
||||
if (part_of_line)
|
||||
free (part_of_line);
|
||||
|
||||
|
||||
close (fd);
|
||||
|
||||
|
||||
return ptr_line;
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ void
|
||||
logger_tail_free (struct t_logger_line *lines)
|
||||
{
|
||||
struct t_logger_line *ptr_line, *next_line;
|
||||
|
||||
|
||||
if (!lines)
|
||||
return;
|
||||
|
||||
@@ -225,11 +225,11 @@ logger_tail_free (struct t_logger_line *lines)
|
||||
while (ptr_line)
|
||||
{
|
||||
next_line = ptr_line->next_line;
|
||||
|
||||
|
||||
if (ptr_line->data)
|
||||
free (ptr_line->data);
|
||||
free (ptr_line);
|
||||
|
||||
|
||||
ptr_line = next_line;
|
||||
}
|
||||
}
|
||||
|
||||
+115
-115
File diff suppressed because it is too large
Load Diff
+46
-46
File diff suppressed because it is too large
Load Diff
+24
-24
File diff suppressed because it is too large
Load Diff
+106
-106
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -45,7 +45,7 @@ relay_command_client_list (int full)
|
||||
int i;
|
||||
char date_start[128], date_activity[128];
|
||||
struct tm *date_tmp;
|
||||
|
||||
|
||||
if (relay_clients)
|
||||
{
|
||||
weechat_printf (NULL, "");
|
||||
@@ -57,11 +57,11 @@ relay_command_client_list (int full)
|
||||
date_tmp = localtime (&(ptr_client->start_time));
|
||||
strftime (date_start, sizeof (date_start),
|
||||
"%a, %d %b %Y %H:%M:%S", date_tmp);
|
||||
|
||||
|
||||
date_tmp = localtime (&(ptr_client->last_activity));
|
||||
strftime (date_activity, sizeof (date_activity),
|
||||
"%a, %d %b %Y %H:%M:%S", date_tmp);
|
||||
|
||||
|
||||
if (full)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
@@ -112,7 +112,7 @@ relay_command_server_list ()
|
||||
int i;
|
||||
char date_start[128];
|
||||
struct tm *date_tmp;
|
||||
|
||||
|
||||
if (relay_servers)
|
||||
{
|
||||
weechat_printf (NULL, "");
|
||||
@@ -124,7 +124,7 @@ relay_command_server_list ()
|
||||
date_tmp = localtime (&(ptr_server->start_time));
|
||||
strftime (date_start, sizeof (date_start),
|
||||
"%a, %d %b %Y %H:%M:%S", date_tmp);
|
||||
|
||||
|
||||
weechat_printf (NULL,
|
||||
_(" port %s%d%s, relay: %s%s.%s%s, started on: %s"),
|
||||
RELAY_COLOR_CHAT_BUFFER,
|
||||
@@ -153,11 +153,11 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
struct t_relay_server *ptr_server;
|
||||
struct t_config_option *ptr_option;
|
||||
int port;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (weechat_strcasecmp (argv[1], "list") == 0)
|
||||
@@ -165,13 +165,13 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
relay_command_client_list (0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "listfull") == 0)
|
||||
{
|
||||
relay_command_client_list (1);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "listrelay") == 0)
|
||||
{
|
||||
relay_command_server_list ();
|
||||
@@ -247,14 +247,14 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!relay_buffer)
|
||||
relay_buffer_open ();
|
||||
|
||||
|
||||
if (relay_buffer)
|
||||
{
|
||||
weechat_buffer_set (relay_buffer, "display", "1");
|
||||
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (strcmp (argv[1], "up") == 0)
|
||||
@@ -269,9 +269,9 @@ relay_command_relay (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
relay_buffer_refresh (NULL);
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@ relay_completion_protocol_name_cb (void *data, const char *completion_item,
|
||||
{
|
||||
struct t_infolist *infolist;
|
||||
char protocol_name[256];
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
(void) completion_item;
|
||||
|
||||
|
||||
infolist = weechat_infolist_get("irc_server", NULL, NULL);
|
||||
if (infolist)
|
||||
{
|
||||
@@ -60,10 +60,10 @@ relay_completion_protocol_name_cb (void *data, const char *completion_item,
|
||||
}
|
||||
weechat_infolist_free (infolist);
|
||||
}
|
||||
|
||||
|
||||
weechat_hook_completion_list_add (completion, "weechat",
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -79,12 +79,12 @@ relay_completion_relays_cb (void *data, const char *completion_item,
|
||||
{
|
||||
struct t_relay_server *ptr_server;
|
||||
char protocol_name[256];
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
(void) completion_item;
|
||||
|
||||
|
||||
for (ptr_server = relay_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ relay_completion_relays_cb (void *data, const char *completion_item,
|
||||
weechat_hook_completion_list_add (completion, protocol_name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -110,12 +110,12 @@ relay_completion_free_port_cb (void *data, const char *completion_item,
|
||||
struct t_relay_server *ptr_server;
|
||||
char str_port[16];
|
||||
int port_max;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
(void) completion_item;
|
||||
|
||||
|
||||
port_max = -1;
|
||||
for (ptr_server = relay_servers; ptr_server;
|
||||
ptr_server = ptr_server->next_server)
|
||||
@@ -125,11 +125,11 @@ relay_completion_free_port_cb (void *data, const char *completion_item,
|
||||
}
|
||||
if (port_max < 0)
|
||||
port_max = 8000 - 1;
|
||||
|
||||
|
||||
snprintf (str_port, sizeof (str_port), "%d", port_max + 1);
|
||||
weechat_hook_completion_list_add (completion, str_port,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,19 +39,19 @@ relay_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_relay_client *ptr_client;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (!infolist_name || !infolist_name[0])
|
||||
return NULL;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (infolist_name, "relay") == 0)
|
||||
{
|
||||
if (pointer && !relay_client_valid (pointer))
|
||||
return NULL;
|
||||
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (ptr_infolist)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ relay_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+27
-27
File diff suppressed because it is too large
Load Diff
@@ -62,7 +62,7 @@ void
|
||||
rmodifier_command_list (const char *message)
|
||||
{
|
||||
struct t_rmodifier *ptr_rmodifier;
|
||||
|
||||
|
||||
if (rmodifier_list)
|
||||
{
|
||||
weechat_printf (NULL, "");
|
||||
@@ -91,11 +91,11 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
struct t_rmodifier *ptr_rmodifier;
|
||||
struct t_config_option *ptr_option;
|
||||
int i, count;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
|
||||
|
||||
if ((argc == 1)
|
||||
|| ((argc == 2) && (weechat_strcasecmp (argv[1], "list") == 0)))
|
||||
{
|
||||
@@ -118,7 +118,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "add") == 0)
|
||||
{
|
||||
/* add a rmodifier */
|
||||
@@ -149,13 +149,13 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
ptr_rmodifier->modifiers,
|
||||
ptr_rmodifier->str_regex,
|
||||
ptr_rmodifier->groups);
|
||||
|
||||
|
||||
/* display message */
|
||||
weechat_printf (NULL, _("Rmodifier \"%s\" created"),
|
||||
ptr_rmodifier->name);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (weechat_strcasecmp (argv[1], "del") == 0)
|
||||
{
|
||||
/* add a rmodifier */
|
||||
@@ -200,7 +200,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
/* restore default rmodifiers (only with "-yes", for security reason) */
|
||||
if (weechat_strcasecmp (argv[1], "default") == 0)
|
||||
{
|
||||
@@ -221,7 +221,7 @@ rmodifier_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,19 +38,19 @@ rmodifier_completion_cb (void *data, const char *completion_item,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
struct t_rmodifier *ptr_rmodifier;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
(void) buffer;
|
||||
|
||||
|
||||
for (ptr_rmodifier = rmodifier_list; ptr_rmodifier;
|
||||
ptr_rmodifier = ptr_rmodifier->next_rmodifier)
|
||||
{
|
||||
weechat_hook_completion_list_add (completion, ptr_rmodifier->name,
|
||||
0, WEECHAT_LIST_POS_SORT);
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -41,21 +41,21 @@ rmodifier_debug_signal_debug_dump_cb (void *data, const char *signal,
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
|
||||
if (!signal_data
|
||||
|| (weechat_strcasecmp ((char *)signal_data, RMODIFIER_PLUGIN_NAME) == 0))
|
||||
{
|
||||
weechat_log_printf ("");
|
||||
weechat_log_printf ("***** \"%s\" plugin dump *****",
|
||||
weechat_plugin->name);
|
||||
|
||||
|
||||
rmodifier_print_log ();
|
||||
|
||||
|
||||
weechat_log_printf ("");
|
||||
weechat_log_printf ("***** End of \"%s\" plugin dump *****",
|
||||
weechat_plugin->name);
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,19 +39,19 @@ rmodifier_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_rmodifier *ptr_rmodifier;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (!infolist_name || !infolist_name[0])
|
||||
return NULL;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (infolist_name, RMODIFIER_PLUGIN_NAME) == 0)
|
||||
{
|
||||
if (pointer && !rmodifier_valid (pointer))
|
||||
return NULL;
|
||||
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (ptr_infolist)
|
||||
{
|
||||
@@ -85,7 +85,7 @@ rmodifier_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+1039
-1039
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+190
-190
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ struct t_script_callback *
|
||||
script_callback_alloc ()
|
||||
{
|
||||
struct t_script_callback *new_script_callback;
|
||||
|
||||
|
||||
new_script_callback = malloc (sizeof (*new_script_callback));
|
||||
if (new_script_callback)
|
||||
{
|
||||
@@ -54,7 +54,7 @@ script_callback_alloc ()
|
||||
new_script_callback->upgrade_file = NULL;
|
||||
return new_script_callback;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -121,9 +121,9 @@ script_callback_remove (struct t_plugin_script *script,
|
||||
script_callback->prev_callback;
|
||||
if (script->callbacks == script_callback)
|
||||
script->callbacks = script_callback->next_callback;
|
||||
|
||||
|
||||
script_callback_free_data (script_callback);
|
||||
|
||||
|
||||
free (script_callback);
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -61,9 +61,9 @@ struct t_plugin_script
|
||||
char *description; /* plugin description */
|
||||
char *shutdown_func; /* function when script is unloaded*/
|
||||
char *charset; /* script charset */
|
||||
|
||||
|
||||
struct t_script_callback *callbacks; /* callbacks for script */
|
||||
|
||||
|
||||
struct t_plugin_script *prev_script; /* link to previous script */
|
||||
struct t_plugin_script *next_script; /* link to next script */
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -41,12 +41,12 @@ xfer_command_me (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
char **argv, char **argv_eol)
|
||||
{
|
||||
struct t_xfer *ptr_xfer;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) argc;
|
||||
(void) argv;
|
||||
|
||||
|
||||
ptr_xfer = xfer_search_by_buffer (buffer);
|
||||
|
||||
if (!ptr_xfer)
|
||||
@@ -57,7 +57,7 @@ xfer_command_me (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
weechat_buffer_get_string (buffer, "name"));
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (!XFER_HAS_ENDED(ptr_xfer->status))
|
||||
{
|
||||
xfer_chat_sendf (ptr_xfer, "\01ACTION %s\01\n",
|
||||
@@ -71,7 +71,7 @@ xfer_command_me (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
weechat_color ("chat"),
|
||||
(argv_eol[1]) ? argv_eol[1] : "");
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ xfer_command_xfer_list (int full)
|
||||
char date[128];
|
||||
unsigned long long pct_complete;
|
||||
struct tm *date_tmp;
|
||||
|
||||
|
||||
if (xfer_list)
|
||||
{
|
||||
weechat_printf (NULL, "");
|
||||
@@ -107,7 +107,7 @@ xfer_command_xfer_list (int full)
|
||||
}
|
||||
else
|
||||
pct_complete = (unsigned long long)(((float)(ptr_xfer->pos)/(float)(ptr_xfer->size)) * 100);
|
||||
|
||||
|
||||
weechat_printf (NULL,
|
||||
_("%3d. %s (%s), file: \"%s\" (local: "
|
||||
"\"%s\"), %s %s, status: %s%s%s "
|
||||
@@ -146,7 +146,7 @@ xfer_command_xfer_list (int full)
|
||||
xfer_config_color_status[ptr_xfer->status])),
|
||||
_(xfer_status_string[ptr_xfer->status]));
|
||||
}
|
||||
|
||||
|
||||
if (full)
|
||||
{
|
||||
/* second line of xfer info */
|
||||
@@ -202,20 +202,20 @@ xfer_command_xfer (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
xfer_command_xfer_list (0);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if ((argc > 1) && (weechat_strcasecmp (argv[1], "listfull") == 0))
|
||||
{
|
||||
xfer_command_xfer_list (1);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
if (!xfer_buffer)
|
||||
xfer_buffer_open ();
|
||||
|
||||
|
||||
if (xfer_buffer)
|
||||
{
|
||||
weechat_buffer_set (xfer_buffer, "display", "1");
|
||||
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (strcmp (argv[1], "up") == 0)
|
||||
@@ -230,9 +230,9 @@ xfer_command_xfer (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
xfer_buffer_refresh (NULL);
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,11 @@ xfer_completion_nick_cb (void *data, const char *completion_item,
|
||||
struct t_gui_completion *completion)
|
||||
{
|
||||
struct t_xfer *ptr_xfer;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) completion_item;
|
||||
|
||||
|
||||
ptr_xfer = xfer_search_by_buffer (buffer);
|
||||
if (ptr_xfer)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ xfer_completion_nick_cb (void *data, const char *completion_item,
|
||||
1,
|
||||
WEECHAT_LIST_POS_END);
|
||||
}
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ xfer_config_refresh_cb (void *data, struct t_config_option *option)
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) option;
|
||||
|
||||
|
||||
if (xfer_buffer)
|
||||
xfer_buffer_refresh (NULL);
|
||||
}
|
||||
@@ -91,7 +91,7 @@ xfer_config_reload (void *data, struct t_config_file *config_file)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
|
||||
return weechat_config_reload (config_file);
|
||||
}
|
||||
|
||||
@@ -104,12 +104,12 @@ int
|
||||
xfer_config_init ()
|
||||
{
|
||||
struct t_config_section *ptr_section;
|
||||
|
||||
|
||||
xfer_config_file = weechat_config_new (XFER_CONFIG_NAME,
|
||||
&xfer_config_reload, NULL);
|
||||
if (!xfer_config_file)
|
||||
return 0;
|
||||
|
||||
|
||||
ptr_section = weechat_config_new_section (xfer_config_file, "look",
|
||||
0, 0,
|
||||
NULL, NULL, NULL, NULL,
|
||||
@@ -120,7 +120,7 @@ xfer_config_init ()
|
||||
weechat_config_free (xfer_config_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
xfer_config_look_auto_open_buffer = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"auto_open_buffer", "boolean",
|
||||
@@ -133,7 +133,7 @@ xfer_config_init ()
|
||||
N_("size of progress bar, in chars (if 0, progress bar is disabled)"),
|
||||
NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, 0,
|
||||
NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
|
||||
|
||||
|
||||
ptr_section = weechat_config_new_section (xfer_config_file, "color",
|
||||
0, 0,
|
||||
NULL, NULL, NULL, NULL,
|
||||
@@ -144,7 +144,7 @@ xfer_config_init ()
|
||||
weechat_config_free (xfer_config_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
xfer_config_color_text = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"text", "color",
|
||||
@@ -199,7 +199,7 @@ xfer_config_init ()
|
||||
N_("text color for \"aborted\" status"),
|
||||
NULL, 0, 0, "lightred", NULL, 0,
|
||||
NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL);
|
||||
|
||||
|
||||
ptr_section = weechat_config_new_section (xfer_config_file, "network",
|
||||
0, 0,
|
||||
NULL, NULL, NULL, NULL,
|
||||
@@ -210,7 +210,7 @@ xfer_config_init ()
|
||||
weechat_config_free (xfer_config_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
xfer_config_network_timeout = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"timeout", "integer",
|
||||
@@ -248,7 +248,7 @@ xfer_config_init ()
|
||||
N_("speed limit for sending files, in kilo-bytes by second (0 means "
|
||||
"no limit)"),
|
||||
NULL, 0, INT_MAX, "0", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
ptr_section = weechat_config_new_section (xfer_config_file, "file",
|
||||
0, 0,
|
||||
NULL, NULL, NULL, NULL,
|
||||
@@ -259,7 +259,7 @@ xfer_config_init ()
|
||||
weechat_config_free (xfer_config_file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
xfer_config_file_download_path = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"download_path", "string",
|
||||
@@ -304,7 +304,7 @@ xfer_config_init ()
|
||||
"auto_accept_chats", "boolean",
|
||||
N_("automatically accept chat requests (use carefully!)"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -38,19 +38,19 @@ xfer_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
{
|
||||
struct t_infolist *ptr_infolist;
|
||||
struct t_xfer *ptr_xfer;
|
||||
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) arguments;
|
||||
|
||||
|
||||
if (!infolist_name || !infolist_name[0])
|
||||
return NULL;
|
||||
|
||||
|
||||
if (weechat_strcasecmp (infolist_name, "xfer") == 0)
|
||||
{
|
||||
if (pointer && !xfer_valid (pointer))
|
||||
return NULL;
|
||||
|
||||
|
||||
ptr_infolist = weechat_infolist_new ();
|
||||
if (ptr_infolist)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ xfer_info_get_infolist_cb (void *data, const char *infolist_name,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,15 +52,15 @@ xfer_upgrade_save ()
|
||||
{
|
||||
int rc;
|
||||
struct t_upgrade_file *upgrade_file;
|
||||
|
||||
|
||||
upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME, 1);
|
||||
if (!upgrade_file)
|
||||
return 0;
|
||||
|
||||
|
||||
rc = xfer_upgrade_save_xfers (upgrade_file);
|
||||
|
||||
|
||||
weechat_upgrade_close (upgrade_file);
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ xfer_upgrade_set_buffer_callbacks ()
|
||||
{
|
||||
struct t_infolist *infolist;
|
||||
struct t_gui_buffer *ptr_buffer;
|
||||
|
||||
|
||||
infolist = weechat_infolist_get ("buffer", NULL, NULL);
|
||||
if (infolist)
|
||||
{
|
||||
@@ -111,7 +111,7 @@ xfer_upgrade_read_cb (void *data,
|
||||
(void) upgrade_file;
|
||||
(void) object_id;
|
||||
(void) infolist;
|
||||
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -125,11 +125,11 @@ xfer_upgrade_load ()
|
||||
{
|
||||
int rc;
|
||||
struct t_upgrade_file *upgrade_file;
|
||||
|
||||
|
||||
xfer_upgrade_set_buffer_callbacks ();
|
||||
|
||||
|
||||
upgrade_file = weechat_upgrade_new (XFER_UPGRADE_FILENAME, 0);
|
||||
rc = weechat_upgrade_read (upgrade_file, &xfer_upgrade_read_cb, NULL);
|
||||
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
+122
-122
File diff suppressed because it is too large
Load Diff
@@ -60,7 +60,7 @@ enum t_xfer_status
|
||||
/* number of xfer status */
|
||||
XFER_NUM_STATUS,
|
||||
};
|
||||
|
||||
|
||||
/* xfer errors */
|
||||
|
||||
enum t_xfer_error
|
||||
@@ -121,7 +121,7 @@ struct t_xfer
|
||||
char *proxy; /* proxy to use (optional) */
|
||||
unsigned long address; /* local or remote IP address */
|
||||
int port; /* remote port */
|
||||
|
||||
|
||||
/* internal data */
|
||||
enum t_xfer_status status; /* xfer status (waiting, sending,..) */
|
||||
struct t_gui_buffer *buffer; /* buffer (for chat only) */
|
||||
|
||||
Reference in New Issue
Block a user