Added stream titles to windows toast notifications (#2044)
Co-authored-by: 23rd <23rd@vivaldi.net> Co-authored-by: David Myers <dave-myers@outlook.com> Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -66,11 +66,12 @@ QString Toasts::findStringFromReaction(
|
||||
return Toasts::findStringFromReaction(static_cast<ToastReaction>(i));
|
||||
}
|
||||
|
||||
void Toasts::sendChannelNotification(const QString &channelName, Platform p)
|
||||
void Toasts::sendChannelNotification(const QString &channelName,
|
||||
const QString &channelTitle, Platform p)
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
auto sendChannelNotification = [this, channelName, p] {
|
||||
this->sendWindowsNotification(channelName, p);
|
||||
auto sendChannelNotification = [this, channelName, channelTitle, p] {
|
||||
this->sendWindowsNotification(channelName, channelTitle, p);
|
||||
};
|
||||
#else
|
||||
auto sendChannelNotification = [] {
|
||||
@@ -164,7 +165,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void Toasts::sendWindowsNotification(const QString &channelName, Platform p)
|
||||
void Toasts::sendWindowsNotification(const QString &channelName,
|
||||
const QString &channelTitle, Platform p)
|
||||
{
|
||||
WinToastLib::WinToastTemplate templ = WinToastLib::WinToastTemplate(
|
||||
WinToastLib::WinToastTemplate::ImageAndText03);
|
||||
@@ -180,7 +182,10 @@ void Toasts::sendWindowsNotification(const QString &channelName, Platform p)
|
||||
Toasts::findStringFromReaction(getSettings()->openFromToast);
|
||||
mode = mode.toLower();
|
||||
|
||||
templ.setTextField(L"Click here to " + mode.toStdWString(),
|
||||
templ.setTextField(QString("%1 \nClick to %2")
|
||||
.arg(channelTitle)
|
||||
.arg(mode)
|
||||
.toStdWString(),
|
||||
WinToastLib::WinToastTemplate::SecondLine);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user