diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2015-09-10 11:58:58 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2015-09-10 11:58:58 +0000 |
commit | 510f938a5c6f0ee95ac0b36e56aced065228298e (patch) | |
tree | 19f907a09498b6f76a4b7aae6ee90a16bf693aa2 /protocols/Tox/src/tox_chatrooms.cpp | |
parent | 86c868a76a5ba3d638b3b7302cd5401df06591d8 (diff) |
Tox: tox pointers should store in PollingThread to avoid cross thread using
git-svn-id: http://svn.miranda-ng.org/main/trunk@15316 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_chatrooms.cpp')
-rw-r--r-- | protocols/Tox/src/tox_chatrooms.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/protocols/Tox/src/tox_chatrooms.cpp b/protocols/Tox/src/tox_chatrooms.cpp index 3f999a0d4f..cff9447d84 100644 --- a/protocols/Tox/src/tox_chatrooms.cpp +++ b/protocols/Tox/src/tox_chatrooms.cpp @@ -46,18 +46,18 @@ MCONTACT CToxProto::AddChatRoom(int groupNumber) void CToxProto::LoadChatRoomList(void*)
{
- uint32_t count = tox_count_chatlist(tox);
+ uint32_t count = tox_count_chatlist(toxThread->tox);
if (count == 0)
{
debugLogA("CToxProto::LoadGroupChatList: your group chat list is empty");
return;
}
int32_t *groupChats = (int32_t*)mir_alloc(count * sizeof(int32_t));
- tox_get_chatlist(tox, groupChats, count);
+ tox_get_chatlist(toxThread->tox, groupChats, count);
for (uint32_t i = 0; i < count; i++)
{
int32_t groupNumber = groupChats[i];
- int type = tox_group_get_type(tox, groupNumber);
+ int type = tox_group_get_type(toxThread->tox, groupNumber);
if (type == TOX_GROUPCHAT_TYPE_AV)
{
continue;
@@ -66,7 +66,7 @@ void CToxProto::LoadChatRoomList(void*) if (hContact)
{
uint8_t title[TOX_MAX_NAME_LENGTH] = { 0 };
- tox_group_get_title(tox, groupNumber, title, TOX_MAX_NAME_LENGTH);
+ tox_group_get_title(toxThread->tox, groupNumber, title, TOX_MAX_NAME_LENGTH);
setWString(hContact, "Nick", ptrT(mir_utf8decodeT((char*)title)));
}
}
@@ -124,7 +124,7 @@ INT_PTR CToxProto::OnCreateChatRoom(WPARAM, LPARAM) CToxProto::ChatRoomInviteProc,
(LPARAM)¶m) == IDOK && !param.invitedContacts.empty())
{
- int groupNumber = tox_add_groupchat(tox);
+ int groupNumber = tox_add_groupchat(toxThread->tox);
if (groupNumber == TOX_ERROR)
{
return 1;
@@ -132,7 +132,7 @@ INT_PTR CToxProto::OnCreateChatRoom(WPARAM, LPARAM) for (std::vector<MCONTACT>::iterator it = param.invitedContacts.begin(); it != param.invitedContacts.end(); ++it)
{
int32_t friendNumber = GetToxFriendNumber(*it);
- if (friendNumber == TOX_ERROR || tox_invite_friend(tox, friendNumber, groupNumber) == TOX_ERROR)
+ if (friendNumber == TOX_ERROR || tox_invite_friend(toxThread->tox, friendNumber, groupNumber) == TOX_ERROR)
{
return 1;
}
|