diff --git a/src/backend/html_markdown.py b/src/backend/html_markdown.py
index 9fe1d313..bcb6cbaf 100644
--- a/src/backend/html_markdown.py
+++ b/src/backend/html_markdown.py
@@ -132,7 +132,7 @@ class HTMLProcessor:
r"(?:/[/\-_.,a-z\d#%&?;=~]*)?(?:\([/\-_.,a-z\d#%&?;=~]*\))?)"),
# mailto: and tel:
- r"mailto:(?P
[a-z0-9._-]+@(?P[a-z0-9_.-]+[a-z](?:\:\d+)?))",
+ r"mailto:(?P[a-z0-9._-]+@(?P[a-z0-9.-:]*[a-z\d]))",
r"tel:(?P[0-9+-]+)(?P)",
# magnet:
@@ -298,7 +298,7 @@ class HTMLProcessor:
"span": {"data-mx-color"},
}}
- username_link_regexes = [re.compile(r, re.IGNORECASE) for r in [
+ username_link_regexes = [re.compile(r) for r in [
rf"(?{re.escape(username)})(?!\w)(?P)"
for username in self.rooms_user_id_names[room_id].values()
]]
diff --git a/src/backend/nio_callbacks.py b/src/backend/nio_callbacks.py
index f3565c1c..be3ca300 100644
--- a/src/backend/nio_callbacks.py
+++ b/src/backend/nio_callbacks.py
@@ -269,13 +269,13 @@ class NioCallbacks:
# Profile changes
changed = []
- if prev and now["avatar_url"] != prev["avatar_url"]:
+ if prev and now.get("avatar_url") != prev.get("avatar_url"):
changed.append("profile picture") # TODO: s
- if prev and now["displayname"] != prev["displayname"]:
+ if prev and now.get("displayname") != prev.get("displayname"):
changed.append('display name from "{}" to "{}"'.format(
- prev["displayname"] or ev.state_key,
- now["displayname"] or ev.state_key,
+ prev.get("displayname") or ev.state_key,
+ now.get("displayname") or ev.state_key,
))
if changed:
@@ -285,8 +285,8 @@ class NioCallbacks:
if account.profile_updated < ev_date:
account.profile_updated = ev_date
- account.display_name = now["displayname"] or ""
- account.avatar_url = now["avatar_url"] or ""
+ account.display_name = now.get("displayname") or ""
+ account.avatar_url = now.get("avatar_url") or ""
if self.client.backend.ui_settings["hideProfileChangeEvents"]:
self.client.skipped_events[room.room_id] += 1
diff --git a/src/gui/PythonBridge/Privates/EventHandlers.qml b/src/gui/PythonBridge/Privates/EventHandlers.qml
index c5f9c62d..b98ebc14 100644
--- a/src/gui/PythonBridge/Privates/EventHandlers.qml
+++ b/src/gui/PythonBridge/Privates/EventHandlers.qml
@@ -11,8 +11,10 @@ QtObject {
function onAlertRequested() {
- if (Qt.application.state !== Qt.ApplicationActive) {
- window.alert(window.settings.alertOnMessageForMsec)
+ const msec = window.settings.alertOnMessageForMsec
+
+ if (Qt.application.state !== Qt.ApplicationActive && msec !== 0) {
+ window.alert(msec === -1 ? 0 : msec) // -1 → 0 = no time out
}
}