Don't use the default config if there's an error in a JSON config file,
a single typo could lead to an entire user settings file getting
overwritten by default data.
- Cleaner design for the backend user_files classes and simplified
interaction with QML
- Config and theme files will now automatically reload when changed on
disk
- Removed manual reload keybind and button
When switching rooms, first load only the delegates in the user's view
and wait a second before expanding the cacheBuffer and loading more
delegates outside the view. This reduces the amount of delegates to load
all at once by 3x.
When a chat page is recycled, set the eventList model to
null, wait for any animations to finish, then explicitely reassign it.
This prevents from model from randomly mixing up old and news delegates.
CppUtils.idleMilliseconds(): If the WAYLAND_DISPLAY environment
variable is set, assume we're running under a Wayland environment
and return early before trying to connect to an X11 display.
If XScreenSaver is available but not supported
(e.g. when running in XWayland), return -1 for
Utils.idleMilliseconds(), instead of letting the code fail and print an
error every time this function gets called to check for the machine's
idle time.
Make sure to not load tooltip images unless the user is
currently trying to see one by hovering on an avatar.
This also seems to reduce idle CPU usage.
If a model has tuple keys, these already get turned into JSON strings
for the ModelItemSet pyotherside event (for QML and JS reasons).
Do the same for ModelItemDeleted's ids field, else the QML event handler
will be unable to find the items by IDs.
For rich text (rendered HTML) fields and areas, the selectedText
property for some reason contains "\u2028" or "\u2029"
characters that look like newlines in Qt programs but are just
invisible anywhere else. Translate them to normal "\n".
Since 87fcb0a773f4855cdae7212fa9448a05de57be56, it was possible to call
a Python coroutine, but cancel it (due to parent component destruction)
before Python even has time to start it.
The registred QML callbacks for this coro would then be called,
potentially causing a segfault if that callback tried to access the
parent component or its properties.
The goTo{Previous,Next}{Unread,Mentioned}Room keybinds only took into
accounts rooms that had a server-sent unread/highlight count, and not
those that only had a client-side unread "!" badge (e.g. for rooms that
get new messages but that have push rules disabling notifications).
When we received server errors with no matrix M_CODE, the MatrixError
class would fall back to its first subclass that had a matching HTTP
status code. This notably caused any 401 error to be interpreted as
MatrixInvalidAccessToken, and disconnect the user.
Introduce a bookmark system for rooms:
a room bookmarked will always appear on top of every other
(for a given account).
Bookmarking can be done through context menu on targeted room
(as well as un-bookmarking) or through settings.json
(key roomBookmarkIDs) for permanent bookmark.
roomBookmarkIds is a {account_user_id: [room_id]} dict.
Require double click to open homepage (#140)
* Update TopBar.qml
To raise Mirage's window in a stacking wm, clicking on an area
without text, especially in the topbar, is probably what most users do.
In the case of the 2nd button in the topbar this currently accidentally
opens a browser window and thus becomes a privacy issue.
So for now require a double click to open mirage's homepage.
Alternatively the size of this button should at least be closely
restricted to the text "Mirage ${version number}".
In the long term it might be preferable to put this link into
some kind of "about" section instead of the "title" section.
* Make tooltip indicate that double click is required
Co-authored-by: miruka <miruka@disroot.org>