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

Don't notify the same status change twice

Fixes #676
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-11-09 02:01:02 +01:00
parent eccf50286e
commit c30c1c6022
No known key found for this signature in database
GPG Key ID: 7E086DD661263264

View File

@ -657,6 +657,8 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
contactListWidget->moveWidget(f->getFriendWidget(), status);
bool isActualChange = f->getStatus() != status;
f->setStatus(status);
f->getFriendWidget()->updateStatusLight();
@ -675,7 +677,8 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
default:
fStatus = tr("online", "contact status"); break;
}
f->getChatForm()->addSystemInfoMessage(tr("%1 is now %2", "e.g. \"Dubslow is now online\"").arg(f->getDisplayedName()).arg(fStatus),
if (isActualChange)
f->getChatForm()->addSystemInfoMessage(tr("%1 is now %2", "e.g. \"Dubslow is now online\"").arg(f->getDisplayedName()).arg(fStatus),
"white", QDateTime::currentDateTime());
}
}