Initial work to create a model so that new servers can be added to the list.
The model will also check if the server is valid before allowing it to be added.
Implements network/neochat#11
### TODO
- [x] Add functionality to cache added servers
This is the start of a significant refactoring of everything related to sending messages, which is roughly:
- the chatbox
- action handling
- message sending on the c++ side
- autocompletion of users/rooms/emojis/commands/things i forgot
Notable changes so far include:
- ChatBox is now a ColumnLayout. As part of this, i removed the height animations for now. <del>as far as i can tell, they were broken anyway.</del> I'll readd them later
- Actions were refactored to live outside of the message sending function and are now each an object; it's mostly a wrapper around a function that is executed when the action is invoked
- Everything that used to live in ChatBoxHelper is now in NeoChatRoom; that means that the exact input status (text, message being replied to, message being edited, attachment) is now saved between room switching).
- To edit/reply an event, set `NeoChatRoom::chatBox{edit,reply}Id` to the desired event id, `NeoChatRoom::chatBox{reply,edit}{User,Message}` will then be updated automatically
- Attachments behave equivalently with `NeoChatRoom::chatBoxAttachmentPath`
- Error message reporting from ActionsHandler has been fixed (same fix as in !517) and moved to NeoChatRoom
Broken at the moment:
- [x] Any kind of autocompletion
- [x] Mentions
- [x] Fancy effects
- [x] sed-style edits
- [x] last-user-message edits and replies
- [x] Some of the actions, probably
- [x] Replies from notifications
- [x] Lots of keyboard shortcuts
- [x] Custom emojis
- [x] ChatBox height animations
TODO:
- [x] User / room mentions based on QTextCursors instead of the hack we currently use
- [x] Refactor autocompletion stuff
- [x] ???
- [x] Profit
Uses Matrix's preview API to generate embedded link previews.
Only title and description for now.

This commit adds the ability to set the master push rule and set push rules for individual rooms as per the matrix spec. See https://spec.matrix.org/v1.3/client-server-api/#push-rules.
The master push rule is just on/off and uses the existing notification setting in general setting to enable/disable the server default master push rule .m.rule.master.
For each room there is now a page in the room setting that allows the following to be set:
- Default
- All messages
- @mentions and keywords
- off
New room or override rules are added/removed to achieve this.
There is also functionality to check the master/room notification state whenever the setting menu is entered. This allows the status to be updated if changed in another client or get the initial state for a room as it isn't stored.
Note - There is currently no menu items in the room list for setting the room push rule settings. This will be added in a later commit, the aim is to focus on making sure the technical implementation is good for now.
Currently when we want to show/raise the window in reaction to the tray icon/notification being clicked etc we do this by emitting a signal on the controller.
This is connected to in main.qml, which does some things, then calls back to controller to do more things.
This is quite convoluted. Instead introduce a new class WindowController that is responsible for all things window, in particular showing/raising and config saving
Fix the reply an edit text being shown in all chat rooms when multiple windows are open. This is done by changing chatBoxHelper from a singleton to being instantiated for each instance of roompage.
BUG: 454963
### Summary
This merge request adds a horizontal bar at top of room list, which shows spaces. By clicking on a space, user can filter out rooms belonging only to that specific space.
### Pending/ Help needed
#### Segfault when loading active connection on startup
Refer `void SortFilterRoomListModel::cacheSpaceHierarchy()` ([link](8c372800d7 (b969e462c30df43ef3714ea441948d8d8027f6a0_117_126))) in `src/sortfilterroomlistmodel.cpp`.
On [line 129](8c372800d7 (b969e462c30df43ef3714ea441948d8d8027f6a0_117_129)), I have called `connection->allRooms()`, which segfaults if the active connection hasn't been loaded yet. Is there a way to ensure that `Controller::instance().activeConnection()` on line 128 waits till connection is loaded?
#### Avatars
Avatars on space horizontal bar aren't aligned to vertical middle. I'll need help with that.
Using the code below doesn't help with padding
```qml
delegate: QQC2.Control {
topPadding: 10
contentItem: Kirigami.Avatar { ..... }
}
```
This complains about uninitialized properties in `Kirigami.Avatar`. (`id`, `currentRoom`, `avatar`, `index` are properties utilized during run time)
After we get around these two issue, this MR will be ready from my side.
QDesktopServices::openUrl does not have XDG activation support yet so it can't raise an existing browser window when opening URLs
Instead use KIO::OpenUrlJob, which does support that
* use KWindowSystem::updateStartupId() for abstract update of X11
startup id or wayland activation token
* call QWindow::raise() also for wayland to prepare when it will
support it
* call KWindowSystem::activateWindow() for all platforms, like done
by other apps on user-triggered activation
If the user wants to automatically launch NeoChat when the system
starts up, the user may also want to minimize the window to system tray
on startup. So a new option named "Minimize to system tray on startup"
is added.
The option is only visible on desktop platforms, and is only enabled
when "Close to system tray" is checked.
In order to restore window geometry for the first time the user opens
the window if the option is checked,
1. a new function named `restoreWindowGeometry` is added, and
`restoreWindowGeometryConnections` will be enabled if the option is
checked, and will be disabled after the window debuts.
2. `saveWindowGeometryConnections` will be enabled if the option is not
checked, and will be disabled if checked and enabled after the window
debuts.
Adds support for xdg_activation_v1 when calling the application from the
system tray by using KStatusNotifier which supports it.
Listens to XDG_ACTIVATION_TOKEN as it's passed when we are started from
dbus.