Merge pull request #205 from felixrieseberg/fix-win-not
[Windows] Notify only when enabled
This commit is contained in:
commit
39595c7a05
1 changed files with 10 additions and 1 deletions
|
@ -90,6 +90,15 @@ void WindowsToastNotification::Show(
|
||||||
auto presenter_win = static_cast<NotificationPresenterWin*>(presenter());
|
auto presenter_win = static_cast<NotificationPresenterWin*>(presenter());
|
||||||
std::wstring icon_path = presenter_win->SaveIconToFilesystem(icon, icon_url);
|
std::wstring icon_path = presenter_win->SaveIconToFilesystem(icon, icon_url);
|
||||||
|
|
||||||
|
// Ask Windows for the current notification settings
|
||||||
|
// If not allowed, we return here (0 = enabled)
|
||||||
|
ABI::Windows::UI::Notifications::NotificationSetting setting;
|
||||||
|
toast_notifier_->get_Setting(&setting);
|
||||||
|
if (setting != 0) {
|
||||||
|
NotificationFailed();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ComPtr<IXmlDocument> toast_xml;
|
ComPtr<IXmlDocument> toast_xml;
|
||||||
if(FAILED(GetToastXml(toast_manager_.Get(), title, msg, icon_path, silent, &toast_xml))) {
|
if(FAILED(GetToastXml(toast_manager_.Get(), title, msg, icon_path, silent, &toast_xml))) {
|
||||||
NotificationFailed();
|
NotificationFailed();
|
||||||
|
|
Loading…
Reference in a new issue