2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Unified code for notification activation events in Windows version.

This commit is contained in:
John Preston
2016-10-02 19:32:46 +03:00
parent c2aa8d3c77
commit 7f950d2de2
11 changed files with 660 additions and 705 deletions

View File

@@ -374,20 +374,15 @@ void Widget::startHiding() {
void Widget::mousePressEvent(QMouseEvent *e) {
if (!_history) return;
auto peerId = _history->peer->id;
auto msgId = (!_history->peer->isUser() && _item && _item->mentionsMe() && _item->id > 0) ? _item->id : ShowAtUnreadMsgId;
if (e->button() == Qt::RightButton) {
unlinkHistoryAndNotify();
} else {
App::wnd()->showFromTray();
if (App::passcoded()) {
App::wnd()->setInnerFocus();
App::wnd()->notifyClear();
} else {
Ui::showPeerHistory(peerId, msgId);
}
e->ignore();
if (auto manager = ManagerInstance.data()) {
auto peerId = _history->peer->id;
auto msgId = _item ? _item->id : ShowAtUnreadMsgId;
manager->notificationActivated(peerId, msgId);
}
}
}