summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2023-08-07 12:17:26 +0200
committerFlorian Bruhin <me@the-compiler.org>2023-08-07 12:19:59 +0200
commitb5f71d2b503f015102d31b19b4e7535c95900168 (patch)
tree9aa408f16f8fa2d7bd31fd9ffa0df48b428058f0
parent94c768498d60210fd1c5647e887e8f1129cf43db (diff)
downloadqutebrowser-b5f71d2b503f015102d31b19b4e7535c95900168.tar.gz
qutebrowser-b5f71d2b503f015102d31b19b4e7535c95900168.zip
notifications: Don't complain on upgraded server spec version
If a server gets fixed and now advertises spec 1.2, there is no reason we should complain about things. See https://github.com/phuhl/linux_notification_center/commit/5427acd551ce6dc4c74bdf8090904c6d254b74f1
-rw-r--r--doc/changelog.asciidoc1
-rw-r--r--qutebrowser/browser/webengine/notification.py11
2 files changed, 8 insertions, 4 deletions
diff --git a/doc/changelog.asciidoc b/doc/changelog.asciidoc
index 2006b4ab4..d48e51e0d 100644
--- a/doc/changelog.asciidoc
+++ b/doc/changelog.asciidoc
@@ -202,6 +202,7 @@ Fixed
- Crash when using QtWebKit with PAC and the file has an invalid encoding.
- Crash with the "tiramisu" notification server.
- Crash when the "herbe" notification presenter doesn't start correctly.
+- Warning with recent versions of the "deadd" (aka "linux notification center") notification server.
- Crash when using `:print --pdf` with a directory where its parent directory
did not exist.
- The `PyQt{5,6}.sip` version is now shown correctly in the :version|--version
diff --git a/qutebrowser/browser/webengine/notification.py b/qutebrowser/browser/webengine/notification.py
index 2edb2d538..6cc9cc074 100644
--- a/qutebrowser/browser/webengine/notification.py
+++ b/qutebrowser/browser/webengine/notification.py
@@ -856,12 +856,15 @@ class DBusNotificationAdapter(AbstractNotificationAdapter):
log.misc.debug(f"Enabling quirks {quirks}")
self._quirks = quirks
- expected_spec_version = self._quirks.spec_version or self.SPEC_VERSION
- if spec_version != expected_spec_version:
+ expected_spec_versions = [self.SPEC_VERSION]
+ if self._quirks.spec_version is not None:
+ expected_spec_versions.append(self._quirks.spec_version)
+
+ if spec_version not in expected_spec_versions:
log.misc.warning(
f"Notification server ({name} {ver} by {vendor}) implements "
- f"spec {spec_version}, but {expected_spec_version} was expected. "
- f"If {name} is up to date, please report a qutebrowser bug.")
+ f"spec {spec_version}, but {'/'.join(expected_spec_versions)} was "
+ f"expected. If {name} is up to date, please report a qutebrowser bug.")
# https://specifications.freedesktop.org/notification-spec/latest/ar01s08.html
icon_key_overrides = {