1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 20:26:46 +02:00

Mostly finished with new API port

- File transfers currently don't support pausing/resuming
- Avatars are not yet done
This commit is contained in:
Jfreegman
2015-03-28 02:56:54 -04:00
parent ae87b2eb2d
commit 2d3c5c9450
24 changed files with 907 additions and 652 deletions

View File

@ -32,7 +32,7 @@
#include "windows.h"
#include "misc_tools.h"
#include "settings.h"
#include "file_senders.h"
#include "file_transfers.h"
extern ToxWindow *prompt;
extern struct user_settings *user_settings;
@ -265,13 +265,13 @@ void str_to_lower(char *str)
Returns nick len */
size_t get_nick_truncate(Tox *m, char *buf, uint32_t friendnum)
{
size_t len = tox_self_get_name_size(m);
size_t len = tox_friend_get_name_size(m, friendnum, NULL);
if (len == 0) {
strcpy(buf, UNKNOWN_NAME);
len = strlen(UNKNOWN_NAME);
} else {
tox_self_get_name(m, (uint8_t *) buf);
tox_friend_get_name(m, friendnum, (uint8_t *) buf, NULL);
}
len = MIN(len, TOXIC_MAX_NAME_LENGTH - 1);
@ -363,13 +363,13 @@ bool file_exists(const char *path)
return stat(path, &s) == 0;
}
/* returns file size or -1 on error */
/* returns file size or 0 on error */
off_t file_size(const char *path)
{
struct stat st;
if (stat(path, &st) == -1)
return -1;
return 0;
return st.st_size;
}