mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 06:16:40 +02:00
New option "xfer.file.use_nick_in_filename" for Xfer files (task #7140)
This commit is contained in:
@@ -54,6 +54,7 @@ struct t_config_option *xfer_config_network_own_ip;
|
||||
|
||||
struct t_config_option *xfer_config_file_download_path;
|
||||
struct t_config_option *xfer_config_file_upload_path;
|
||||
struct t_config_option *xfer_config_file_use_nick_in_filename;
|
||||
struct t_config_option *xfer_config_file_convert_spaces;
|
||||
struct t_config_option *xfer_config_file_auto_rename;
|
||||
struct t_config_option *xfer_config_file_auto_resume;
|
||||
@@ -255,6 +256,11 @@ xfer_config_init ()
|
||||
N_("path for reading files when sending (when no path is "
|
||||
"specified by user)"),
|
||||
NULL, 0, 0, "~", NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
xfer_config_file_use_nick_in_filename = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"use_nick_in_filename", "boolean",
|
||||
N_("use remote nick as prefix in local filename when receiving a file"),
|
||||
NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
xfer_config_file_convert_spaces = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"convert_spaces", "boolean",
|
||||
|
||||
@@ -42,6 +42,7 @@ extern struct t_config_option *xfer_config_network_own_ip;
|
||||
|
||||
extern struct t_config_option *xfer_config_file_download_path;
|
||||
extern struct t_config_option *xfer_config_file_upload_path;
|
||||
extern struct t_config_option *xfer_config_file_use_nick_in_filename;
|
||||
extern struct t_config_option *xfer_config_file_convert_spaces;
|
||||
extern struct t_config_option *xfer_config_file_auto_rename;
|
||||
extern struct t_config_option *xfer_config_file_auto_resume;
|
||||
|
||||
@@ -111,8 +111,11 @@ xfer_file_find_filename (struct t_xfer *xfer)
|
||||
if (dir_separator
|
||||
&& (xfer->local_filename[strlen (xfer->local_filename) - 1] != dir_separator[0]))
|
||||
strcat (xfer->local_filename, dir_separator);
|
||||
strcat (xfer->local_filename, xfer->remote_nick);
|
||||
strcat (xfer->local_filename, ".");
|
||||
if (weechat_config_boolean (xfer_config_file_use_nick_in_filename))
|
||||
{
|
||||
strcat (xfer->local_filename, xfer->remote_nick);
|
||||
strcat (xfer->local_filename, ".");
|
||||
}
|
||||
strcat (xfer->local_filename, xfer->filename);
|
||||
|
||||
if (dir1)
|
||||
|
||||
Reference in New Issue
Block a user