summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-05-07 14:34:10 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-05-07 14:34:10 +0200
commitf71c190a975ea6836fa79e90124fb3dd14a6b05b (patch)
treeaa9a42c11964f759f3e9e16f514e6e10c747416d /src
parentb0e88590b9910c08b14820618cce86249bea91b4 (diff)
downloadweechat-f71c190a975ea6836fa79e90124fb3dd14a6b05b.zip
New option "xfer.file.use_nick_in_filename" for Xfer files (task #7140)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/xfer/xfer-config.c6
-rw-r--r--src/plugins/xfer/xfer-config.h1
-rw-r--r--src/plugins/xfer/xfer-file.c7
3 files changed, 12 insertions, 2 deletions
diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c
index 915903070..93057eda8 100644
--- a/src/plugins/xfer/xfer-config.c
+++ b/src/plugins/xfer/xfer-config.c
@@ -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",
diff --git a/src/plugins/xfer/xfer-config.h b/src/plugins/xfer/xfer-config.h
index 298529737..963d964ea 100644
--- a/src/plugins/xfer/xfer-config.h
+++ b/src/plugins/xfer/xfer-config.h
@@ -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;
diff --git a/src/plugins/xfer/xfer-file.c b/src/plugins/xfer/xfer-file.c
index fd72a8840..5e4841c54 100644
--- a/src/plugins/xfer/xfer-file.c
+++ b/src/plugins/xfer/xfer-file.c
@@ -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)