summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/Tox/src/tox_account.cpp1
-rw-r--r--protocols/Tox/src/tox_messages.cpp5
-rw-r--r--protocols/Tox/src/tox_proto.cpp2
3 files changed, 8 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_account.cpp b/protocols/Tox/src/tox_account.cpp
index 9e74f07a17..bc9a984288 100644
--- a/protocols/Tox/src/tox_account.cpp
+++ b/protocols/Tox/src/tox_account.cpp
@@ -168,6 +168,7 @@ void CToxProto::PollingThread(void*)
debugLogA("CToxProto::PollingThread: changing status from %i to %i", ID_STATUS_CONNECTING, m_iDesiredStatus);
m_iStatus = m_iDesiredStatus;
+ tox_set_user_status(tox, MirandaToToxStatus(m_iStatus));
ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)ID_STATUS_CONNECTING, m_iStatus);
}
else
diff --git a/protocols/Tox/src/tox_messages.cpp b/protocols/Tox/src/tox_messages.cpp
index d22fbc9f2d..39d37a47dc 100644
--- a/protocols/Tox/src/tox_messages.cpp
+++ b/protocols/Tox/src/tox_messages.cpp
@@ -44,6 +44,8 @@ int __cdecl CToxProto::SendMsg(MCONTACT hContact, int flags, const char* msg)
return 0;
}
+ WaitForSingleObject(hToxEvent, INFINITE);
+
int result = 0;
if (strncmp(msg, "/me ", 4) != 0)
{
@@ -53,6 +55,7 @@ int __cdecl CToxProto::SendMsg(MCONTACT hContact, int flags, const char* msg)
{
result = tox_send_action(tox, number, (uint8_t*)&msg[4], (uint16_t)strlen(msg) - 4);
}
+
if (result == 0)
{
debugLogA("CToxProto::SendMsg: could not to send message");
@@ -119,6 +122,8 @@ int __cdecl CToxProto::UserIsTyping(MCONTACT hContact, int type)
uint32_t number = tox_get_friend_number(tox, clientId.data());
if (number >= 0)
{
+ WaitForSingleObject(hToxEvent, INFINITE);
+
tox_set_user_is_typing(tox, number, type);
return 0;
}
diff --git a/protocols/Tox/src/tox_proto.cpp b/protocols/Tox/src/tox_proto.cpp
index 2f4e749412..89be71ab18 100644
--- a/protocols/Tox/src/tox_proto.cpp
+++ b/protocols/Tox/src/tox_proto.cpp
@@ -255,6 +255,8 @@ int __cdecl CToxProto::SetAwayMsg(int iStatus, const PROTOCHAR *msg)
{
if (IsOnline())
{
+ WaitForSingleObject(hToxEvent, INFINITE);
+
ptrA statusMessage(msg == NULL ? mir_strdup("") : mir_utf8encodeT(msg));
if (tox_set_status_message(tox, (uint8_t*)(char*)statusMessage, min(TOX_MAX_STATUSMESSAGE_LENGTH, strlen(statusMessage))) == TOX_ERROR)
{