Add configuration option to send desktop notification on buddy presence (#3886)

This commit is contained in:
Phillip Wheatley 2020-03-17 01:49:11 +00:00 committed by GitHub
parent 63b4f9b2f0
commit 91dc8b3b08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 83 additions and 15 deletions

View file

@ -158,11 +158,16 @@ void TabRoom::focusTab()
}
void TabRoom::actShowMentionPopup(QString &sender)
{
this->actShowPopup(sender + tr(" mentioned you."));
}
void TabRoom::actShowPopup(const QString &message)
{
if (trayIcon && (tabSupervisor->currentIndex() != tabSupervisor->indexOf(this) ||
QApplication::activeWindow() == 0 || QApplication::focusWidget() == 0)) {
disconnect(trayIcon, SIGNAL(messageClicked()), 0, 0);
trayIcon->showMessage(sender + tr(" mentioned you."), tr("Click to view"));
QApplication::activeWindow() == nullptr || QApplication::focusWidget() == nullptr)) {
disconnect(trayIcon, SIGNAL(messageClicked()), nullptr, nullptr);
trayIcon->showMessage(message, tr("Click to view"));
connect(trayIcon, SIGNAL(messageClicked()), chatView, SLOT(actMessageClicked()));
}
}