1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix(core): Ignore online connection status

Fix #4010.

qTox use status system, where offline is one of the status, but toxcore
use two different meaning: 'connection' and 'user status'. To correct
qTox status handling we should ignore online connection status.
This commit is contained in:
Diadlo 2017-02-26 02:34:03 +03:00
parent 9c482455a8
commit ea50eaaef7
No known key found for this signature in database
GPG Key ID: 5AF9F2E29107C727

View File

@ -475,11 +475,13 @@ void Core::onUserStatusChanged(Tox* /* tox*/, uint32_t friendId, TOX_USER_STATUS
void Core::onConnectionStatusChanged(Tox* /* tox*/, uint32_t friendId, TOX_CONNECTION status, void* core)
{
Status friendStatus = status != TOX_CONNECTION_NONE ? Status::Online : Status::Offline;
emit static_cast<Core*>(core)->friendStatusChanged(friendId, friendStatus);
if (friendStatus == Status::Offline)
// Ignore Online because it will be emited from onUserStatusChanged
if (friendStatus == Status::Offline) {
emit static_cast<Core*>(core)->friendStatusChanged(friendId, friendStatus);
static_cast<Core*>(core)->checkLastOnline(friendId);
CoreFile::onConnectionStatusChanged(static_cast<Core*>(core), friendId,
friendStatus != Status::Offline);
CoreFile::onConnectionStatusChanged(static_cast<Core*>(core), friendId,
friendStatus != Status::Offline);
}
}
void Core::onGroupInvite(Tox*, uint32_t friendId, TOX_CONFERENCE_TYPE type, const uint8_t* data,