diff --git a/TODO.md b/TODO.md index 37352ace..023364ec 100644 --- a/TODO.md +++ b/TODO.md @@ -1,6 +1,5 @@ # TODO -- presence keybinds - retry if media not found - fix members not synced bug - fix local unread counters order diff --git a/src/backend/user_files.py b/src/backend/user_files.py index d770969a..65f405b2 100644 --- a/src/backend/user_files.py +++ b/src/backend/user_files.py @@ -299,7 +299,11 @@ class UISettings(JSONDataFile): "toggleFocusMainPane": ["Alt+F"], "clearRoomFilter": ["Alt+Shift+F"], "toggleCollapseAccount": ["Alt+O"], - "openPresenceMenu": ["Alt+P"], + + "openPresenceMenu": ["Alt+P"], + "togglePresenceUnavailable": ["Alt+Ctrl+U", "Alt+Ctrl+A"], + "togglePresenceInvisible": ["Alt+Ctrl+I"], + "togglePresenceOffline": ["Alt+Ctrl+O"], "goToLastPage": ["Ctrl+Tab"], "goToPreviousAccount": ["Alt+Shift+N"], diff --git a/src/gui/MainPane/AccountDelegate.qml b/src/gui/MainPane/AccountDelegate.qml index 9dcb610c..6f55fb39 100644 --- a/src/gui/MainPane/AccountDelegate.qml +++ b/src/gui/MainPane/AccountDelegate.qml @@ -199,6 +199,11 @@ HTile { setCollapse(! collapsed) } + function togglePresence(presence) { + if (model.presence === presence) presence = "online" + py.callClientCoro(model.id, "set_presence", [presence]) + } + HShortcut { enabled: enableKeybinds @@ -217,4 +222,22 @@ HTile { sequences: window.settings.keys.openPresenceMenu onActivated: account.doRightClick(false) } + + HShortcut { + enabled: enableKeybinds + sequences: window.settings.keys.togglePresenceUnavailable + onActivated: account.togglePresence("unavailable") + } + + HShortcut { + enabled: enableKeybinds + sequences: window.settings.keys.togglePresenceInvisible + onActivated: account.togglePresence("invisible") + } + + HShortcut { + enabled: enableKeybinds + sequences: window.settings.keys.togglePresenceOffline + onActivated: account.togglePresence("offline") + } }