summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Tox/src/tox_core.cpp')
-rw-r--r--protocols/Tox/src/tox_core.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/protocols/Tox/src/tox_core.cpp b/protocols/Tox/src/tox_core.cpp
index 7d97b875f0..0cd6e045c3 100644
--- a/protocols/Tox/src/tox_core.cpp
+++ b/protocols/Tox/src/tox_core.cpp
@@ -58,13 +58,19 @@ bool CToxProto::InitToxCore()
uint8_t data[TOX_FRIEND_ADDRESS_SIZE];
tox_get_address(tox, data);
ToxHexAddress address(data, TOX_FRIEND_ADDRESS_SIZE);
- setString(NULL, TOX_SETTINGS_ID, address);
+ setString(TOX_SETTINGS_ID, address);
int size = tox_get_self_name_size(tox);
std::string nick(size, 0);
tox_get_self_name(tox, (uint8_t*)nick.data());
setWString("Nick", ptrW(Utf8DecodeW(nick.c_str())));
+ //temporary
+ size = tox_get_self_status_message_size(tox);
+ std::string statusmes(size, 0);
+ tox_get_self_status_message(tox, (uint8_t*)statusmes.data(), size);
+ setWString("StatusMsg", ptrW(Utf8DecodeW(statusmes.c_str())));
+
std::tstring avatarPath = GetAvatarFilePath();
if (IsFileExists(avatarPath))
{
@@ -98,6 +104,10 @@ void CToxProto::UninitToxCore()
ptrA nickname(mir_utf8encodeW(ptrT(getTStringA("Nick"))));
tox_set_name(tox, (uint8_t*)(char*)nickname, mir_strlen(nickname));
+ //temporary
+ ptrA statusmes(mir_utf8encodeW(ptrT(getTStringA("StatusMsg"))));
+ tox_set_status_message(tox, (uint8_t*)(char*)statusmes, mir_strlen(statusmes));
+
SaveToxProfile();
if (password != NULL)
{