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

fix(core): fix formatting

This commit is contained in:
Monsterovich 2018-12-23 02:21:45 +02:00
parent 8c239c8ef6
commit c136a17ff0

View File

@ -318,8 +318,7 @@ void GroupChatForm::sendJoinLeaveMessages()
} }
// generate user list from the current group if it's empty // generate user list from the current group if it's empty
if (groupLast.isEmpty()) if (groupLast.isEmpty()) {
{
groupLast = group->getPeerList(); groupLast = group->getPeerList();
return; return;
} }
@ -329,13 +328,11 @@ void GroupChatForm::sendJoinLeaveMessages()
const QString name = peers.value(peerPk); const QString name = peers.value(peerPk);
// ignore weird issue: when user joins the group, the name is empty, then it's renamed to normal nickname (why?) // ignore weird issue: when user joins the group, the name is empty, then it's renamed to normal nickname (why?)
// so, just ignore the first insertion // so, just ignore the first insertion
if (!firstTime.value(peerPk, false)) if (!firstTime.value(peerPk, false)) {
{
firstTime[peerPk] = true; firstTime[peerPk] = true;
continue; continue;
} }
if (!groupLast.contains(peerPk)) if (!groupLast.contains(peerPk)) {
{
groupLast.insert(peerPk, name); groupLast.insert(peerPk, name);
addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); addSystemInfoMessage(tr("%1 has joined the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime());
} }
@ -343,8 +340,7 @@ void GroupChatForm::sendJoinLeaveMessages()
// user leaves // user leaves
for (const auto& peerPk : groupLast.keys()) { for (const auto& peerPk : groupLast.keys()) {
const QString name = groupLast.value(peerPk); const QString name = groupLast.value(peerPk);
if (!peers.contains(peerPk)) if (!peers.contains(peerPk)) {
{
groupLast.remove(peerPk); groupLast.remove(peerPk);
firstTime.remove(peerPk); firstTime.remove(peerPk);
addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime()); addSystemInfoMessage(tr("%1 has left the group").arg(name), ChatMessage::INFO, QDateTime::currentDateTime());