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

update friend activity on groupchat events

fixes #2848
This commit is contained in:
sudden6 2016-03-21 21:56:52 +01:00
parent b6ae3d02d6
commit 69424c63be
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -1418,6 +1418,8 @@ void Widget::copyFriendIdToClipboard(int friendId)
void Widget::onGroupInviteReceived(int32_t friendId, uint8_t type, QByteArray invite)
{
updateFriendActivity(FriendList::findFriend(friendId));
if (type == TOX_GROUPCHAT_TYPE_TEXT || type == TOX_GROUPCHAT_TYPE_AV)
{
if (GUI::askQuestion(tr("Group invite", "popup title"), tr("%1 has invited you to a groupchat. Would you like to join?", "popup text").arg(Nexus::getCore()->getFriendUsername(friendId).toHtmlEscaped()), true, false))
@ -1444,6 +1446,7 @@ void Widget::onGroupMessageReceived(int groupnumber, int peernumber, const QStri
return;
ToxId author = Core::getInstance()->getGroupPeerToxId(groupnumber, peernumber);
bool targeted = !author.isSelf() && (message.contains(nameMention) || message.contains(sanitizedNameMention));
if (targeted && !isAction)
g->getChatForm()->addAlertMessage(author, message, QDateTime::currentDateTime());