mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 09:02:13 +02:00
/DCC SEND didn't actually use /SET dcc_upload_path
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3279 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
e5148aca0e
commit
169086ab51
1 changed files with 21 additions and 19 deletions
|
|
@ -71,6 +71,24 @@ static void dcc_queue_send_next(int queue)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *dcc_send_get_file(const char *fname)
|
||||||
|
{
|
||||||
|
char *str, *path;
|
||||||
|
|
||||||
|
str = convert_home(fname);
|
||||||
|
if (!g_path_is_absolute(str)) {
|
||||||
|
/* full path not given to file, use dcc_upload_path */
|
||||||
|
g_free(str);
|
||||||
|
|
||||||
|
path = convert_home(settings_get_str("dcc_upload_path"));
|
||||||
|
str = *path == '\0' ? g_strdup(fname) :
|
||||||
|
g_strconcat(path, G_DIR_SEPARATOR_S, fname, NULL);
|
||||||
|
g_free(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
|
static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
|
||||||
const char *nick, char *fileargs, int add_mode,
|
const char *nick, char *fileargs, int add_mode,
|
||||||
int passive)
|
int passive)
|
||||||
|
|
@ -101,7 +119,7 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
|
||||||
|
|
||||||
/* add all globbed files to a proper queue */
|
/* add all globbed files to a proper queue */
|
||||||
for (i = 0; i < globbuf.gl_pathc; i++) {
|
for (i = 0; i < globbuf.gl_pathc; i++) {
|
||||||
const char *fname = globbuf.gl_pathv[i];
|
char *fname = dcc_send_get_file(globbuf.gl_pathv[i]);
|
||||||
|
|
||||||
ret = stat(fname, &st);
|
ret = stat(fname, &st);
|
||||||
if (ret == 0 && S_ISDIR(st.st_mode)) {
|
if (ret == 0 && S_ISDIR(st.st_mode)) {
|
||||||
|
|
@ -113,6 +131,7 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
signal_emit("dcc error file open", 3,
|
signal_emit("dcc error file open", 3,
|
||||||
nick, fname, errno);
|
nick, fname, errno);
|
||||||
|
g_free(fname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -137,6 +156,7 @@ static void dcc_send_add(const char *servertag, CHAT_DCC_REC *chat,
|
||||||
dcc_queue_add_passive(queue, add_mode, nick,
|
dcc_queue_add_passive(queue, add_mode, nick,
|
||||||
fname, servertag, chat);
|
fname, servertag, chat);
|
||||||
files++;
|
files++;
|
||||||
|
g_free(fname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (files > 0 && start_new_transfer)
|
if (files > 0 && start_new_transfer)
|
||||||
|
|
@ -341,24 +361,6 @@ static void dcc_send_connect(SEND_DCC_REC *dcc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *dcc_send_get_file(const char *fname)
|
|
||||||
{
|
|
||||||
char *str, *path;
|
|
||||||
|
|
||||||
str = convert_home(fname);
|
|
||||||
if (!g_path_is_absolute(str)) {
|
|
||||||
/* full path not given to file, use dcc_upload_path */
|
|
||||||
g_free(str);
|
|
||||||
|
|
||||||
path = convert_home(settings_get_str("dcc_upload_path"));
|
|
||||||
str = *path == '\0' ? g_strdup(fname) :
|
|
||||||
g_strconcat(path, G_DIR_SEPARATOR_S, fname, NULL);
|
|
||||||
g_free(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
return str;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int dcc_send_one_file(int queue, const char *target, const char *fname,
|
static int dcc_send_one_file(int queue, const char *target, const char *fname,
|
||||||
IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
|
IRC_SERVER_REC *server, CHAT_DCC_REC *chat,
|
||||||
int passive)
|
int passive)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue