Commit Graph

57 Commits

Author SHA1 Message Date
Tobias Fella
1c9575ccfd Fix notifications with libquotient 0.7 2022-10-17 21:14:03 +02:00
Tobias Fella
4bfd857093 Refactor input stuff
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
2022-10-10 23:10:00 +00:00
Tobias Fella
22448ea9ae Clean up includes 2022-10-08 19:03:49 +02:00
Tobias Fella
d70a8a652a Always use system-style includes for libQuotient 2022-09-09 00:16:39 +02:00
Snehit Sah
91d1f6ffeb Show spaces horizontal bar
### 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.
2022-08-25 13:46:09 +00:00
Nicolas Fella
1cc8d915bc Add rooms runner
This allows to search for and open rooms in KRunner
2022-04-01 10:56:19 +00:00
Snehit Sah
9a5f2e4938 Show subtitle text without markdown
Create new role in RoomListModel to send back cleaned subtitle text
2022-03-31 17:39:34 +00:00
Tobias Fella
011cf3c652 Fix highlighted room when opening room from notification 2021-10-03 16:21:53 +00:00
Tobias Fella
d28279313d Rename type because of conflict 2021-09-24 12:42:05 +02:00
Smitty van Bodegom
db1a9a0c4c Categorize Spaces as such in sidebar
Currently they are shown at the bottom, since Neochat doesn't support
displaying Spaces yet.
2021-08-03 19:54:48 +00:00
Carl Schwan
a086964769 Make sidebar collapsible 2021-06-14 12:50:09 +00:00
Tobias Fella
2cb81d1276 Unify License header style in C++ 2021-04-06 19:25:06 +02:00
Tobias Fella
9f637ab925 Improve notification handling 2021-03-29 21:24:26 +00:00
Tobias Fella
1cb6b3bbd6 Consistently use pragma once in all headers 2021-02-04 23:14:54 +01:00
Tobias Fella
546d17b1a2 Correctly open all kinds of matrix.to links in TextDelegate and MessageDelegateContextMenu 2021-02-04 20:23:16 +00:00
Carl Schwan
4be3eac7af Fix avatar loading in multiple places and prefers name instead of
display name for avatar fallback.

This also fixes a bug where users didn't get their avatar loaded in the
room list.

Fix #209
2021-01-09 00:37:13 +01:00
Carl Schwan
136a8f2af8 Clang-tidy + clang-format 2020-11-27 00:26:39 +01:00
Tobias Fella
79ee2e1279 Apply clang-format to rest of cpp 2020-11-12 11:07:36 +00:00
Tobias Fella
d8dde6e082 Add license headers to code files 2020-11-11 15:17:23 +00:00
Carl Schwan
122a7cdd2f Rebrand files names Spectral -> NeoChat 2020-11-08 23:17:30 +01:00
Tobias Fella
95e2993f70 Implement sorting rooms by category 2020-11-08 16:13:53 +00:00
Nicolas Fella
a08d017c02 Normalize includes 2020-11-04 20:25:52 +01:00
Nicolas Fella
00b6908f25 Correct some whitespace issues 2020-11-04 19:43:56 +01:00
Carl Schwan
8b3f89cf2e Fix a bunch of clazy warnings 2020-11-03 15:15:16 +00:00
Carl Schwan
abea051f1c s/slots/Q_SLOTS and s/signals/Q_SIGNALS 2020-11-03 12:09:06 +01:00
Carl Schwan
bea870ad75 Apply Clang Format 2020-11-02 16:11:24 +01:00
Tobias Fella
5993c1f683 Port from SortFilterProxyModel to KSortFilterProxyModel 2020-11-02 08:11:55 +00:00
Black
6af7befd11 Improve room settings dialog. 2020-01-22 20:37:27 -08:00
Black Hat
086891ef4e QMatrixClient -> Quotient 2019-08-15 22:52:12 +08:00
Black Hat
ced82bd666 Modern C++. 2019-08-04 22:36:32 +08:00
Black Hat
3e0009a069 Show notification count in tray icon. 2019-07-01 18:19:00 +08:00
Black Hat
c0126cea95 Clean up roomlistmodel. 2019-05-20 13:42:18 +08:00
Black Hat
2565b8ba79 Add basic room upgrade support.
Add full screen image view.
Fix a bug in image provider.
2019-04-23 10:57:35 +08:00
Black Hat
c727eb3bfd Fix #2.
Issue #2 is actually fixed!
A somewhat primitive UI for room management.
A new style for AutoTextField.
Limit max width of drawers.
2019-04-22 19:49:22 +08:00
Black Hat
579a1dfca8 Init notification count. 2019-03-03 19:09:12 +08:00
Black Hat
ec43131a10 Clean up notification. 2018-12-24 20:31:40 +08:00
Black Hat
8959be2cb8 Remove ImageItem, Paintable and use unified image provider. 2018-12-03 19:55:42 +08:00
Black Hat
5a46810016 Init rewritten avatar. 2018-11-04 19:14:02 +08:00
Black Hat
2e4fed72fe Init Windows notification image. 2018-10-20 14:59:37 +08:00
Black Hat
bb069197d6 Notification improvements. 2018-10-19 22:02:12 +08:00
Black Hat
0361432c3d Sort rooms by last event, not unread count. 2018-09-18 20:57:38 +08:00
Black Hat
81a7172f29 Genesis commit.
Not really, but a lot of renaming.
2018-09-17 21:01:02 +08:00
Black Hat
cfc32289d1 Add highlight support. 2018-09-06 12:34:15 +08:00
Black Hat
cfa8043596 A lot of improvements.
Fix laggish RoomListView when dragging.
Remove per-room timer and add timer in RoomForm.
Remove singleton module and use file as singleton.
Minor UI tweak in RoomListView.
Pass room to RoomListView via "currentRoom" delegate property and remove
RoomListForm-wide currentRoom.
Put menu files in a separate folder.
Show initial image in ImageStatus when avatar is not loaded.
Add about page.
Merge all setting pages into Setting.qml.
Add option to rearrange rooms by activity.
Add option to use RichText parser.
Add document url.
2018-08-24 13:25:41 +08:00
Black Hat
cca9467703 Display room's latest event instead of topic when possible. 2018-08-22 23:21:39 +08:00
Black Hat
4383dfa5a1 Working notification.
Also, fixes #6.
2018-08-19 14:32:18 +08:00
Black Hat
3a7f182c52 Uses MatriqueRoom inherited from QMatrixClient::Room and rewrite related
objects.
2018-08-18 16:02:47 +08:00
Black Hat
43e0ccaf2f Add accept/reject and use .cache 2018-08-17 12:55:57 +08:00
Black Hat
4db5f3f355 Add an option to lazy load room message at initial sync.
Reduces initial sync time. Useful if you joined a lot of rooms and have
a slow homeserver.
2018-08-10 18:58:53 +08:00
Black Hat
f8c89886d2 Remove binding between RoomListForm and RoomForm and reformat code.
This commit allows user to do a series of operations(via press and hold)
on a room without entering the room in RoomForm.
Fixes #14.
2018-08-07 00:17:58 +08:00