Commit Graph

2026 Commits

Author SHA1 Message Date
miruka
1feda8667f Cancel reply when pressing keybind on same event 2021-03-03 17:12:08 -04:00
miruka
12cfbd2a96 CppUtils.hsluv(): prevent out of bounds sat/luv 2021-03-03 17:12:08 -04:00
miruka
0e3821a592 Prefix event transaction_id keys with reverse DNS
Respect the Matrix spec by using
"io.github.mirukana.mirage.transaction_id" instead of
"mirage.transaction_id".
2021-03-03 17:12:08 -04:00
miruka
2313673993 Reduce themes fontSize.big from 22 to 20 2021-03-03 17:12:08 -04:00
miruka
6a36943dae Account settings: fix incorrect "User ID:" color 2021-03-03 17:12:08 -04:00
miruka
aa5d522902 Swap default shift & nomod image viewer keybinds
zoomOut/zoomIn, rotateRight/rotateLeft, previousSpeed/nextSpeed:
Make them shift+Z/Z, shift+R/R, shift+S/S by default
instead of Z/Shift+Z, R/shift+R, S/shift+S
2021-03-03 17:12:08 -04:00
miruka
8acc7299e9 Add workaround for delegate stuck transition bug
Sometimes and randomly, a HListView/HGridView delegate's
add/populate transition will stop before completion.

This especially happens on startup when loading a large room list,
one room might get stuck and left tiny or invisible, despite its
normal space still being taken.
2021-03-03 17:12:08 -04:00
miruka
35fa1fa16b Fix account page not being highlighted on startup
If the page loaded on app startup is account settings or add new chat,
ensure the room list properly highlights the corresponding account
delegate.
2021-03-03 17:12:08 -04:00
miruka
2664bf1e93 HTile: prevent opening multiple context menus
If a context menu is already opened for that HTile when right clicking
or using a keybind like Alt+P (openPresenceMenu), close it instead of
just creating a duplicate one.
2021-03-03 17:12:08 -04:00
miruka
e6499d8fba Fix read counter display on EventImage
- Fix extra spacing on the right of the date when there's no read
  counter to show

- Fix read counter not being colored
2021-03-03 17:12:08 -04:00
miruka
ee1091b4dc Don't pass Python Future objects to QML
Returning a Future doesn't work on Windows for some reason
(https://github.com/thp/pyotherside/issues/116).

Instead of using these objects from QML to cancel running coroutines,
call a Python QMLBridge function that takes a coroutine UUID and will
take care of the cancelling.
2021-03-03 17:12:08 -04:00
miruka
53d2ab17af Fix display of right-to-left text in timeline
Set an explicit default left alignment for label components, to prevent
other people's right-to-left names or text from messing up the UI
in a left-to-right environment.
2021-03-03 17:12:08 -04:00
miruka
dbd78587fe DebugConsole: improve field placeholder & .help 2021-03-03 17:12:08 -04:00
miruka
e3fcb39556 DebugConsole: improve text & border coloring 2021-03-03 17:12:08 -04:00
miruka
d6062a8320 DebugConsole: add border "prompt" to delegates 2021-03-03 17:12:08 -04:00
miruka
192112ab4e DebugConsole output: add text selection & copying 2021-03-03 17:12:08 -04:00
miruka
4cc4229728 DebugConsole: restore non-history text on down key
When user starts typing something in the console, then navigates the
history with up but comes back to normal input by pressing down, restore
the text that was initially typed before navigating.
2021-03-03 17:12:08 -04:00
miruka
68d1ddfa61 Fix DebugConsole cursor at position 0 invisible 2021-03-03 17:12:08 -04:00
miruka
7d27acfcc8 Allow multi-line input in DebugConsole
Use ctrl/shift/alt+return to insert a newline, tab to insert 4 spaces
2021-03-03 17:12:08 -04:00
miruka
d9118ef24e Clear HList/GridView checked on model change
Clear the checked items and prevent potential segfaults
2021-03-03 17:12:08 -04:00
miruka
58613446f0 Fix event context menu targeting wrong message
If user right clicked on the most recent event in the timeline
(index 0), a new message was posted in the room (the new index 0),
and the user right clicked on it, the EventContextMenu's `event`
property relying on the index would not detect any change and
thus would still target the previous event.

This affected options depending on this property like "Reply".

The problem was reproducible with any same index repetition, not just 0.
2021-03-03 17:12:08 -04:00
miruka
c861c29b73 Add nonKineticScrollingSpeed multiplicator setting 2021-03-03 17:12:08 -04:00
miruka
1df7cb8014 Add copyright header to source code files
Copyright notice as per
https://reuse.software/spec/#format-of-copyright-notices

Fixes #134
2021-03-03 17:12:08 -04:00
miruka
90829125bd Strip non-free ICC profile out from midnight.jpg
Fixes #129
2021-03-03 17:12:08 -04:00
miruka
54234399f5 Fix "Mentions & keywords" notification level
Make it work in cases where multiple accounts are present in the room
and one of them is highlighted.
2021-03-03 17:12:08 -04:00
miruka
e8d8f7fe0b Add global notification control icon in top bar
The "Mentions & keywords only" option doesn't work yet in multi-account
cases: when notifications arrive for a room that multiple accounts are
part of, the first notification to arrive is let through, and the
duplicate later ones are ignored. The first notification to arrive may
not be from the account that gets highlighted, thus it is ignored under
the "Mentions & keywords" setting.
2021-03-03 17:12:08 -04:00
miruka
03e4f9b85e Make settings icon open a more complete menu 2021-03-03 17:12:08 -04:00
miruka
22e7dc7e8d Notifications: format replies properly 2021-03-03 17:12:08 -04:00
miruka
4cd562e02f Notifications: process non-message events text 2021-03-03 17:12:08 -04:00
miruka
94a623f677 Print coro infos on get_client not found error 2021-03-03 17:12:08 -04:00
miruka
7ae2ae6cd7 Notifications: turn newline symbols into real <br> 2021-03-03 17:12:08 -04:00
miruka
4a6e2ea46a Prevent duplicate notifications for the same event 2021-03-03 17:12:08 -04:00
miruka
8691a8c85b Add sender avatar to desktop notifications 2021-03-03 17:12:08 -04:00
miruka
21ccf90d23 Notifications: properly italicize emote messages 2021-03-03 17:12:08 -04:00
miruka
dcc3473ecf Don't show notification if window is focused 2021-03-03 17:12:08 -04:00
miruka
a8a25d09ee Ensure room has 2 members to hide notif. sender 2021-03-03 17:12:08 -04:00
miruka
04daae8328 Fix account unreads not updated from old events 2021-03-03 17:12:08 -04:00
miruka
4dacc3a12d Make alerts and notification push rules-aware 2021-03-03 17:12:08 -04:00
miruka
69e414b31c Add basic desktop notifications support 2021-03-03 17:12:08 -04:00
miruka
60a57db33e Fix QML Connections-using code for Qt 5.12 2020-09-16 08:29:07 -04:00
miruka
8d71e5eb87 Bump version to 0.6.4 2020-09-16 07:52:04 -04:00
miruka
e65202cfbe Fix checkbox update when default state changes
Make sure to update checkboxes when their default value changes
and the user hasn't already changed the value themselves.

This fixes a dangerous issue with new room switching and
room settings checkboxes keeping their value from the previous room.
2020-09-16 07:46:27 -04:00
miruka
9ac4cd0a97 Separate localEcho & readCounter theme properties
Allows making the hourglass gray by default again, while the read
counter uses the accent color.
2020-09-16 06:40:21 -04:00
miruka
0db80d312b Bump to version 0.6.3 2020-09-15 15:03:47 -04:00
miruka
5ce30d6019 Add message echo/read counter color theme property 2020-09-15 14:55:03 -04:00
miruka
d7d111705f Don't center the room list on clicks by default
Previously, clicking to select a room would make the list jump around
to become centered again. This behavior is now reserved to keyboard
navigation.

A "centerRoomListOnClick" setting has been added to allow going back
to the previous behavior.
2020-09-14 12:02:28 -04:00
miruka
2712896456 Show read marker counts on messages
Tells how many people have the message as their last seen one in the
room.
2020-09-14 11:58:37 -04:00
miruka
0d7a33d3a9 Unify Sessions (shift+)tab and up/down navigation 2020-09-13 19:28:50 -04:00
miruka
fb846226f8 Focus filter field on member profile exit 2020-09-13 19:16:46 -04:00
miruka
9b1608b696 Delay members loading for faster room switching 2020-09-13 16:05:23 -04:00
miruka
6df9647b59 Faster switching of rooms from different accounts
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.
2020-09-13 16:05:15 -04:00
miruka
32679aa7f8 Abandon fetching offline presence on 400 error
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
2020-09-13 10:34:01 -04:00
miruka
a9c316fcf5 Store read receipts in event model items 2020-09-11 14:50:27 -04:00
miruka
d51d266642 Add ModelItem.notify_change() for list/dicts 2020-09-11 14:50:27 -04:00
miruka
7580ecfd64 Fix missing typing.Tuple import in model.py 2020-09-11 14:50:27 -04:00
miruka
59748c7cc8 EventDelegate: better separationSpacing formatting 2020-09-11 14:50:27 -04:00
miruka
0ccf3d03c9
Merge pull request #125 from vSLG/system-tray
Add a system tray icon
2020-09-11 13:52:20 -04:00
vslg
b10234768b Do not use qFatal on component error loop
Using qFatal will terminate the program when it
prints the first error, so use qCritical to print
all errors and then terminate the program.
2020-09-08 08:48:38 -03:00
vslg
67012d6334 Move tray code to a reasonable place
- Move required properties to top
- Do not use concatenation on qsTr, use .arg()
2020-09-08 08:47:00 -03:00
vslg
ae9f88cae5 Fix show up watcher 2020-09-08 08:47:00 -03:00
vslg
4382edc8b0 Rename drawAttention to restoreFromTray 2020-09-08 08:47:00 -03:00
vslg
438b368be6 Fix typos and improve code
- Do not end log messages with '.'
- Rephrase some messages
- Do not use braces on case statement unless there
  is an assignment
2020-09-08 08:47:00 -03:00
vslg
6f9d983e03 Use settingsFolder instead of configDir 2020-09-08 08:47:00 -03:00
vslg
c41ed5d77d Improve system tray icon click behavior
- Middle click now closes Mirage
- A normal click now toggle window visibility
2020-09-08 08:47:00 -03:00
vslg
a543c79c02 Use Qt.quit() when closing the window
Qt.quit() is used because KDE Plasma will minimize
to tray by default when clicking on X button
2020-09-08 08:47:00 -03:00
vslg
8a04f80602 Use application name instead of hardcoding Mirage 2020-09-08 08:47:00 -03:00
vslg
bde7af8a5a Move system tray icon code to its file 2020-09-08 08:46:40 -03:00
miruka
b12e38f41b Fix emote events (/me) display name display 2020-09-05 09:14:40 -04:00
miruka
5dca7d0a35 Remove leftover debug prints in PageLoader 2020-09-04 20:01:54 -04:00
miruka
d48f96f219 Describe power levels <0 as "muted" in event text 2020-09-04 19:56:31 -04:00
miruka
d5212b0f84 Fix power level reset back to default not seen
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.
2020-09-04 19:51:27 -04:00
vslg
9ee4b14aa2 Add watcher for .show file in config directory
Draw attention when the .show file is created.
It is created when attempting to open another
instance of Mirage with the same configuration.
2020-09-04 17:43:02 -03:00
vslg
56ad0b9975 Add config option closeMinimizesToTray
Options of the system tray icon:
- Hide/show Mirage
- Quit Mirage

Draw attention to Mirage when clicking on the icon
2020-09-04 17:30:12 -03:00
vslg
6061b2f061 Add simple lock file per configuration
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.
2020-09-04 17:30:12 -03:00
vslg
bbcdcde53f Add simple system tray 2020-09-04 17:30:12 -03:00
miruka
acb1367f11 Fix warnings when uploading to non-E2E room
Fix these:

    <Unknown File>: media_crypt_dict is undefined.
    Adding an object with a undefined member does not create a role for it.
2020-09-04 14:57:09 -04:00
miruka
56f676e35d "X removed this event": say "message" instead
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.
2020-09-04 14:52:10 -04:00
miruka
ebfc3d3ee2 Fix redacted media events keeping their thumbnails 2020-09-04 14:47:47 -04:00
miruka
65a1324eb0 Fix initial and non-initial sync filters reversed
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.
2020-09-04 14:40:00 -04:00
miruka
89f8cf25d3 Show login page if current was for logged out acc. 2020-09-04 14:05:07 -04:00
miruka
8376d85961 Fix possible segfault when EventDelegate destroyed 2020-09-04 12:57:46 -04:00
miruka
7b6478f514 Correctly handle account with invalid access token
Show a popup saying the session was signed out and cleanup
the models data, instead of spamming the users with
never-ending errors.
2020-09-04 11:25:29 -04:00
miruka
3c9895b0b2 Fix EventHandlers.onModelCleared callback 2020-09-04 10:58:04 -04:00
miruka
1c306f421a Fix PageLoader initial page when no account 2020-09-04 10:51:33 -04:00
miruka
99ae075bb4 Reset composer when recycling chat page 2020-09-03 18:30:36 -04:00
miruka
82bcc29475 Field/area: insertAtCursor() when restoring text
Instead of assigning to `text` directly, which kills editing history and
has worse performance.
2020-09-03 18:27:31 -04:00
miruka
2545ba6c00 Reset room pane state when recycling chat page
Side effect: the members filter field's text is no longer saved to disk
2020-09-03 18:09:50 -04:00
miruka
601b42a503 Rename PageLoader.showPage() → PageLoader.show() 2020-09-03 17:33:19 -04:00
miruka
90929691c6 PageLoader: remove unused proporties 2020-09-03 17:31:33 -04:00
vslg
180e995f33 Print Window.qml component creation errors 2020-09-03 12:26:19 -04:00
miruka
2b45c07819 Fix starting Mirage when initial page isn't a chat 2020-09-03 11:08:31 -04:00
miruka
462d3972ff Small window: close main pane when recycling page 2020-09-03 11:06:45 -04:00
miruka
f5c6a2627b Improve pageLoader animation 2020-09-03 10:49:15 -04:00
miruka
3f339b7bb9 Add global baseGIFSpeed property to DebugConsole
for great debugging
2020-09-02 15:56:13 -04:00
miruka
bed19eb117 Play appearAnimation when recycling page 2020-09-02 15:25:02 -04:00
miruka
e947fe7695 Refactor PageLoader show methods
Also lets the chat page recycling work with showPrevious() (ctrl+tab)
2020-09-02 15:19:27 -04:00
miruka
a4bbbfee87 Recycle chat pages if possible when switching room
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.
2020-09-02 15:19:21 -04:00
miruka
509c4a0871 Add defaultCurrentIndex to H(List/Grid)View
When the model of a view changes, Qt automatically sets the
currentIndex to 0.
Reset it back to the set default (usually -1) instead.
2020-09-02 14:40:06 -04:00
miruka
3fb64dbef5 Fix EventContextMenu errs if timeline has 0 events 2020-09-02 14:02:12 -04:00
miruka
d8c006a8c8 Remove a bunch of leftover debug prints 2020-09-02 13:41:31 -04:00