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:
parent
9c482455a8
commit
ea50eaaef7
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user