1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-12-06 19:56:35 +01:00

send name instead of full path with file send request

This commit is contained in:
Jfreegman
2014-02-11 18:52:04 -05:00
parent 1f06606c5b
commit 16b8f85d95
5 changed files with 30 additions and 21 deletions

View File

@@ -164,7 +164,8 @@ void cmd_sendfile(WINDOW *window, ToxWindow *self, Tox *m, int argc, char (*argv
uint64_t filesize = ftell(file_to_send);
fseek(file_to_send, 0, SEEK_SET);
int filenum = tox_new_file_sender(m, self->num, filesize, path, path_len + 1);
uint8_t *filename = get_file_name(path);
int filenum = tox_new_file_sender(m, self->num, filesize, filename, strlen(filename) + 1);
if (filenum == -1) {
wprintw(window, "Error sending file.\n");