Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix: Remove old ChatForm code from Widget
Browse files Browse the repository at this point in the history
Remove double status messages
  • Loading branch information
Diadlo committed Jan 9, 2017
1 parent 3b56a6e commit 5264257
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/widget/widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,44 +1084,6 @@ void Widget::onFriendStatusChanged(int friendId, Status status)
}

ContentDialog::updateFriendStatus(friendId);

if (Settings::getInstance().getStatusChangeNotificationEnabled())
{
QString fStatus = "";
switch (f->getStatus())
{
case Status::Away:
fStatus = tr("away", "contact status");
break;
case Status::Busy:
fStatus = tr("busy", "contact status");
break;
case Status::Offline:
fStatus = tr("offline", "contact status");
// Hide the "is typing" message when a friend goes offline
f->getChatForm()->setFriendTyping(false);
break;
case Status::Online:
fStatus = tr("online", "contact status");
break;
}

if (isActualChange)
{
QString message = tr("%1 is now %2", "e.g. \"Dubslow is now online\"")
.arg(f->getDisplayedName()).arg(fStatus);

f->getChatForm()->addSystemInfoMessage(message, ChatMessage::INFO,
QDateTime::currentDateTime());
}
}

if (isActualChange && status != Status::Offline)
{
// wait a little
OfflineMsgEngine* ome = f->getChatForm()->getOfflineMsgEngine();
QTimer::singleShot(250, ome, SLOT(deliverOfflineMsgs()));
}
}

void Widget::onFriendStatusMessageChanged(int friendId, const QString& message)
Expand Down

0 comments on commit 5264257

Please sign in to comment.