Use a single [userId, roomId] property for the chat page.
This gets read of the intermediate state where the userId property has
been updated but the roomId one not yet, which led to the page unloading
and reloading itself until both were properly set.
Side-effect: when starting Mirage after this commit for the first time,
the last saved page will not load and user must click a room or
other page manually.
It seems like some servers return a M_UNRECOGNIZED code instead of
M_FORBIDDEN or "offline" when trying to fetch the presence for a user
and it's not available.
Fixes https://github.com/mirukana/mirage/issues/116
Previously, changes in power level events where a key is set back to the
default and absent from the "current levels" dict (e.g. a muted user -1
is unmuted and becomes 0, the room default, thus is only present in the
"previous levels" dict) were taken into account when generating the
event text.
Make use of lock files in configuration directory
for preventing multiple instances of Mirage from
being running at the same time, at least for a
single configuration.
Running multiple instances of Mirage is known to
cause encryption errors in one or more instances.
That's what was supposed to happen for non-media message events
since redactions were implemented, but seems like nio doesn't
properly keep the original event type.
Issue introduced in 758edd8a6a (0.6.1)
The filter for the first sync was passed as the filter for later
syncs and vice-versa, which caused problems like redaction events never
arriving.
The chat page is complex and slow to create, which creates a visible lag
when user switches room.
Instead of throwing the pre-switch one away and
making a new one from scratch, keep the same page and update its user &
room ID for a big improvement in responsiveness. The rest is automatic
thanks to QML property bindings.
When using the focus(Previous/Next)Message keybinds, no message is
focused and the view has been scrolled up, focus the message in the
center of the view instead of returning to the list's bottom to focus
the most recent one.
In the composer, when the text cursor was inside a word starting
with a @ but not matching any username (thus the completion UI being
invisible), pressing up/down arrow would not do anything instead of
going to the prev/next line.
The zoom keybinds now modify this setting directly.
The `uiScale` property in themes now default to using this zoom setting,
since just removing it would need of annoying changes through theme
files and QML code, and is best left to until the future theming
overhaul update.
Make it possible to see the change without restarting Mirage if an
image used for the theme's background was edited, or if used did the
mistake of typing "/path/to/img" then corrects it to
"file:///path/to/img".
When there's a one line (emote or non-message) event with its avatar
shown and combinable events follow it, that first event delegate's height
is supposed to be one line with the avatar overflowing into
the following event's blank space.
This behavior hasn't been working for a long time. This commit restores
it, along with improving the related code's quality.
- Remove pointless confusing aliases for avatar properties
(smallAvatar, collapseAvatar, etc)
- Make some EventDelegate properties readonly as they should be
- Use Layout.preferredWidth/Height for avatarWrapper instead of both
minimum and maximum W/H
Missing `}` in `chat.message.styleSheet` caused some CSS properties to
not work (sender name bottom margin, quotes color, no underline for
mentions, etc).
- Make the code cleaner and more declarative
- Start loading past events when the join state of the room changes,
e.g. when accepting an invite, load history right then
- Properly cancel the loading task when leaving the room chat page
Send a pseudo-reply consisting of two messages: a `m.text` which is just
a reply with an empty body, then the file event itself.
This is a workaround to the restriction imposed by the Matrix API,
which prevents us from simply attaching a reply to a media event:
https://matrix.org/docs/spec/client_server/latest#rich-replies
These cause problems with the composer alias parsing code.
If an alias from the config file has whitespace, only the first word
will be taken into account (ignoring any leading or trailing whitespace).
Simplify the code, make it more declarative, and improve the reliability
of sending typing notifications (notably when changing the used alias in
the middle of a message).
If the chat was opened under e.g. "@user1:example.org", but the
composer text is "o abc" where "o" is a composer alias for
"@other_account:example.org", save the composer text to state.json as
"@user1:example.org" and not the alias user.
thumbnail() and download() were remaining.
Use a direct and carefully chosen MatrixClient's methods instead to
avoid problems mentioned in the previous commit 7502c1.
Causes problem if one of the candidate client is on a server that
doesn't federate (e.g. a local one). Move the `get_profile()` function
from Backend to MatrixClient.
Having a HoverHandler covering the root ApplicationWindow causes
problems for some Qt Quick Controls with pen/touch, e.g. it's impossible
to focus a TextArea/TextField.
The HoverHandler is moved to HToolTip (since it's used for those),
targets the ApplicationWindow but is now only enabled while a tooltip is
visible.
Fix the AutoCompletedMembers filter model to ensure that it doesn't
pick all the items from the corresponding room member model on startup,
wait until the user actually uses the completion feature to fill it.
If the display name of a user is blank (e.g. just a space character),
autocomplete it as a user ID.
If the display name starts or ends with whitespace, trim it.
`preeditText` is partial input from IME and touchscreen
autocompleting keyboards, consider it together with `text` for the
`getWordAt()` function.
This should allow user autocompletion to work properly in these
specific conditions.
Bug introduced in 6b907, made the cursor stay as a normal arrow when
hovering text fields/areas inside a HFlickable due to the
HKineticScrollingDisabler's width/height being incorrectly set.