Compare commits

...

353 Commits

Author SHA1 Message Date
Tomaz Canabrava
7cc68d2658 Adapt to newer API 2024-04-19 10:42:03 +02:00
Tomaz Canabrava
f4b87caefe Adapt to new AUP 2024-04-19 10:18:39 +02:00
Tomaz Canabrava
07a9497f4c Fix bad commit 2024-04-19 10:18:31 +02:00
Tomaz Canabrava
35f1ace458 Adapt to newer API
TODO: There are some missing methods and I do not know what to do there
2024-04-19 10:04:13 +02:00
Tomaz Canabrava
11dd0ee151 Adapt to new Avatar API 2024-04-19 10:03:49 +02:00
Tomaz Canabrava
07e200c74f Adapt to breaking changes in libQuotient
localUser() -> localMember()
2024-04-19 09:45:11 +02:00
l10n daemon script
ee405fbff6 GIT_SILENT Sync po/docbooks with svn 2024-04-19 01:25:40 +00:00
James Graham
c87c6fbabb Add kitemmodels back to Permissions.qml 2024-04-18 20:48:24 +01:00
Tobias Fella
096b36b89b Try fixing test some more 2024-04-18 19:19:31 +02:00
Tobias Fella
c3db90d2e3 Make DrKonqi work with NeoChat 2024-04-18 18:49:12 +02:00
Tobias Fella
b7df10aa45 Try fixing appium test 2024-04-18 18:15:15 +02:00
l10n daemon script
fea5e02e7d GIT_SILENT Sync po/docbooks with svn 2024-04-18 01:18:34 +00:00
Tobias Fella
cb94261727 Fix compatibility with libQuotient dev branch 2024-04-17 13:01:32 +02:00
l10n daemon script
efac7e4860 GIT_SILENT Sync po/docbooks with svn 2024-04-17 01:25:31 +00:00
Tobias Fella
0f6fd3adee Remove outdated event registrations 2024-04-16 22:39:16 +02:00
James Graham
e5e0405401 Fix typo 2024-04-16 21:16:21 +01:00
Tobias Fella
bb35e9ce15 Add option to show all rooms in "uncategorized" tab 2024-04-16 20:49:17 +02:00
Tobias Fella
5881db4e55 Add missing import to global menu 2024-04-16 20:25:04 +02:00
Tobias Fella
89f7167b08 Remember previous downloads after restarts
Fixes #636
2024-04-16 17:55:26 +02:00
l10n daemon script
3b39fcff84 GIT_SILENT Sync po/docbooks with svn 2024-04-16 01:27:26 +00:00
Tobias Fella
0daf45a465 Fix opening account editor 2024-04-15 17:48:26 +02:00
Tobias Fella
c0d7b96e79 Mark ThreePIdModel as uncreatable 2024-04-15 17:15:01 +02:00
Laurent Montel
a247e40865 Add missing includes moc 2024-04-15 08:10:50 +02:00
Laurent Montel
c3e7a99bca Add missing #pragma once 2024-04-15 08:10:22 +02:00
l10n daemon script
9080d8be6a GIT_SILENT Sync po/docbooks with svn 2024-04-15 01:20:15 +00:00
James Graham
b7ee83f6b6 Add visualisation of the account's third party IDs in the account editor.
A category won't be shown if there are no relevant IDs (will add the ability to add new ones later).

Part of network/neochat#565

![image](/uploads/7da00b0b4acf90d145c09969ac2a91e1/image.png)
2024-04-14 16:37:34 +00:00
James Graham
1e24bde9a9 Add hover button for maximising a code block
Forgot to add it with the maximize mr
2024-04-14 16:32:12 +00:00
l10n daemon script
ba82df1152 GIT_SILENT Sync po/docbooks with svn 2024-04-14 01:20:38 +00:00
Tobias Fella
8980fe7838 Improve README 2024-04-13 21:59:16 +02:00
James Graham
ef34ed7c20 Fix Verification Window Sizing
Update the layouts in the device verifcation process to make sure that all possible window sizes can be handled

BUG: 485309
2024-04-13 18:51:06 +00:00
James Graham
17d60b79ca Fix showing the unread count for DM section when not selected 2024-04-13 15:15:27 +00:00
James Graham
ab0a32c339 Add a debug options page to devtools with the option to always allow verification for now
Closes network/neochat#646
2024-04-13 15:11:25 +00:00
James Graham
697778df8d Fix feature flag devtools page by adding necohat import as this is where config comes from now 2024-04-13 15:28:26 +01:00
Yuri Chornoivan
55caf84b94 Fix minor typos 2024-04-13 08:47:48 +03:00
l10n daemon script
335c012f1b GIT_SILENT Sync po/docbooks with svn 2024-04-13 01:25:05 +00:00
Tobias Fella
3c4c538de8 Use declarative type registration for remaining types 2024-04-12 22:17:39 +02:00
Tobias Fella
c344a3ee55 Devtools: Implement changing room state 2024-04-12 22:08:33 +02:00
l10n daemon script
d2695947ed GIT_SILENT Sync po/docbooks with svn 2024-04-12 01:22:49 +00:00
Tobias Fella
21beeef920 Load Main qml component from module 2024-04-11 21:01:55 +02:00
James Graham
a4630a53fa Create QML module for login 2024-04-11 18:56:08 +00:00
Tobias Fella
f5aef8d0c3 Use Qt.createComponent in non-weird way
Fixed #647
2024-04-11 18:16:19 +02:00
l10n daemon script
e044e66030 GIT_SILENT Sync po/docbooks with svn 2024-04-11 01:23:29 +00:00
James Graham
88bfacd386 Show QR code for room in drawer 2024-04-10 18:19:05 +00:00
James Graham
c61c73088f Add button to get a QR code for the local user to the account editor page 2024-04-10 17:19:11 +00:00
l10n daemon script
2887263f26 GIT_SILENT Sync po/docbooks with svn 2024-04-10 01:24:51 +00:00
James Graham
72b90bdf5c Fix gaps at the top and bottom of SpaceHomePage witht he wrong background colour.
Note: the bottom gap only happened after a room was loaded for the first time
2024-04-09 19:03:24 +00:00
James Graham
163b02f023 Add image info for stickers
Closes network/neochat#584
2024-04-09 18:54:59 +00:00
James Graham
1a96899336 Linkpreviewer Improvements
- Have LinkPreviewers stored in NeoChatConnection so that they don't have to be reloaded everytime the MessageContentModel is refreshed
- This means the link is never changed (it will be swiched for a new previewer with the new link)
- LinkPreviewers are stored by URL so they can be re-used by any event with the same URL

BUG: 484927  (because the offending code is ripped out)
2024-04-09 18:35:16 +00:00
l10n daemon script
554c086aba GIT_SILENT Sync po/docbooks with svn 2024-04-09 01:25:03 +00:00
Heiko Becker
1fad9bf7db GIT_SILENT Update Appstream for new release
(cherry picked from commit 86e8dc2e40)
2024-04-08 17:57:25 +02:00
l10n daemon script
22d922e451 GIT_SILENT Sync po/docbooks with svn 2024-04-08 01:23:31 +00:00
snow flurry
70bff21632 Render custom emoji icons in the completion pane 2024-04-07 19:40:02 +00:00
James Graham
f58c390a47 Re-add requirement for having devtools active for the show message source action
Re-add requirement for having devtools active for the show message source action

BUG: 485140
2024-04-07 08:40:14 +00:00
l10n daemon script
089a9abcb4 GIT_SILENT Sync po/docbooks with svn 2024-04-07 01:23:56 +00:00
Joshua Goins
bf1c76d0a6 Force the choose room dialog's search dialog to be focused
This makes it possible to open the share dialog and start typing to find
the room immediately.
2024-04-06 15:40:03 -04:00
Joshua Goins
879da627b1 Fix the share dialog not showing up
Seems to be a leftover from the refactor to use modules.
2024-04-06 15:39:36 -04:00
James Graham
9b93eb44d5 Show a verified icon for verified devices rather than a verify option 2024-04-06 14:19:38 +00:00
l10n daemon script
b30220eca9 GIT_SILENT Sync po/docbooks with svn 2024-04-06 01:23:47 +00:00
l10n daemon script
d270d4e5e1 GIT_SILENT Sync po/docbooks with svn 2024-04-05 01:21:52 +00:00
l10n daemon script
21da6cb0f4 GIT_SILENT Sync po/docbooks with svn 2024-04-04 01:24:44 +00:00
l10n daemon script
6ac75df935 GIT_SILENT Sync po/docbooks with svn 2024-04-03 01:24:31 +00:00
l10n daemon script
f29781349c SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-04-03 01:14:45 +00:00
Tobias Fella
bb776d5c2b Only ask for URL opening confirmation for QR codes
BUG: 484870
2024-04-02 19:47:07 +02:00
James Graham
6cfab9e3ea Tree Model 2 Electric Boogaloo
This draws heavily on what @carlschwan did in network/neochat!1579 but I found it easier to start again and grab the bits as I needed them plus some other copying from what I did in the Space tree model.

From my current limited testing this seems to work nicely try and break it.
2024-04-02 14:44:20 +00:00
l10n daemon script
6373186c15 GIT_SILENT Sync po/docbooks with svn 2024-04-02 01:18:19 +00:00
Nate Graham
e342de3bc1 Make ConfirmUrlDialog HIG-compliant
* "URL" is an acronym; make it all caps
* Use descriptive context-appropriate buttons instead of "Yes" and "No"
* Use KUIT markup for styling the link
2024-04-01 11:32:27 -06:00
Tobias Fella
4cd7b69ea5 Fix QML warning 2024-04-01 15:48:42 +02:00
Tobias Fella
988e8529da Remove leftover signal handler 2024-04-01 15:43:31 +02:00
James Graham
6a32d1e961 Create component for showing a maximize version of a code snippet 2024-04-01 11:20:10 +00:00
James Graham
0552c798fb Create qml module for devtools 2024-04-01 10:58:29 +00:00
l10n daemon script
a53ad41879 GIT_SILENT Sync po/docbooks with svn 2024-04-01 01:17:50 +00:00
Tobias Fella
92351edcd0 Fix location delegates
- Mark OSMLocationPlugina as singleton in cmake
- Use this plugin for the LocationChooser
2024-03-31 20:57:58 +02:00
James Graham
878eb48cb0 Shut qt up about models passed to QML
Shutup qt about below

```
SortFilterRoomListModel is neither a QObject, nor default- and copy-constructible, nor uncreatable. You should not use it as a QML type.
SortFilterRoomTreeModel is neither a QObject, nor default- and copy-constructible, nor uncreatable. You should not use it as a QML type.
SortFilterSpaceListModel is neither a QObject, nor default- and copy-constructible, nor uncreatable. You should not use it as a QML type.
```
2024-03-31 17:49:35 +00:00
James Graham
053ca6bed8 Move the various room models into RoomManager
Move the various room models into RoomManager. This means the same room models are always used and is a base from which further logic can be moved from QML to cpp.
2024-03-31 12:56:27 +00:00
Tobias Fella
78ae14ab2f Stay in DM tab when selecting a DM 2024-03-31 14:31:22 +02:00
l10n daemon script
5fdc2ad765 GIT_SILENT Sync po/docbooks with svn 2024-03-31 01:30:45 +00:00
Tobias Fella
b75dbe8d5c Rework roommanager for improved stability
Fixes #645

- Active space handling is moved from QML to RoomManager
- Active tab in SpaceDrawer (space / no space / DM) is unified in a single variable
- RoomList & RoomPage loading is simplified: We're always pushing a RoomPage now; if there is no room, a placeholder is shown
- SpaceHomePage is moved into RoomPage; This replaces the entire push/replace room/spacehome logic
- If the current room is a space, the space home is shown, otherwise the timeline
- The concept of "previous room" is removed entirely. If we're leaving the active room, the placeholder room page is shown
- When clicking on a space in the list, the space room list is switched and the space home page is shown

In short, these changes should (after some initial regressions) lead to a less crashy NeoChat :)
2024-03-31 00:22:23 +01:00
James Graham
eaf4663c84 RoomManger connection
RoomManger should just get it's connection from Controller, no need to involve QML
2024-03-30 19:48:34 +00:00
James Graham
64b8cd5bcc Space Search
Allow to refine searches to spaces only in the main exlore function.
Show which rooms are spaces in the search page.

Closes #577
2024-03-30 19:37:46 +00:00
James Graham
482d61ee47 Fix marking messages as read when the window is thin
Make sure that messages are not marked as read when going back to the roomlist after entering a room when neochat is thin and only showing a single page

Fixes #642
2024-03-30 19:32:19 +00:00
l10n daemon script
276dcce95e GIT_SILENT Sync po/docbooks with svn 2024-03-30 01:18:07 +00:00
Tobias Fella
217f9e2e02 Set OUTPUT_DIRECTORY for qml modules
This fixes some cmake warning and might make qmlls happier
2024-03-29 20:06:26 +01:00
Tobias Fella
f40a0a6f5f Remove unused property 2024-03-29 16:43:06 +01:00
Tobias Fella
9bd67acc2f Remove leftover signal 2024-03-29 16:05:07 +01:00
James Graham
e87da0feb0 Add pagination to space hierarchy cache
Add pagination to space hierarchy cache to ensure all rooms get cached.
2024-03-29 15:03:50 +00:00
Tobias Fella
2608d879fa Add "Leave room" button to sidebar
BUG: 484425
2024-03-29 13:53:59 +01:00
Tobias Fella
6ab61fd41f Fix opening the last room active room if it's not in a space
At the moment, the saved room was effectively always overridden by the first room in the list
2024-03-29 13:29:41 +01:00
Tobias Fella
30dd6297ee Make sure we're switching out of the space home page when leaving the currently opened space 2024-03-29 11:57:06 +01:00
Tobias Fella
ce02183f82 Fix plural handling in space member strings 2024-03-29 11:56:29 +01:00
Tobias Fella
7c74a6cbe1 Improve space management strings 2024-03-29 11:56:06 +01:00
Tobias Fella
e6a11b2ad8 Make various models more robust against deleted rooms 2024-03-29 11:55:14 +01:00
James Graham
158942d1b5 UserInfo compact
Make UserInfo work in compact mode. This includes showing the account switch popup in a dialog

BUG: 482261
2024-03-29 09:09:13 +00:00
l10n daemon script
aaa97ec029 GIT_SILENT Sync po/docbooks with svn 2024-03-29 01:30:58 +00:00
Tobias Fella
882ead5715 Remove external room window feature
At its best, this worked ok-ish, though it was always missing basic features.

It's also a massive memory leak and significantly complicates the codebase.
(Which is not yet cleaned up by this commit)

Currently, it is entirely broken and noone noticed or cared enough to report or fix that.

BUG: 455984
2024-03-28 22:05:50 +01:00
Tobias Fella
ab4519dedd Show custom delegate for in-room user verification
This is independent of the in-room verification actually working, but prevents a fallback from appearing
2024-03-28 22:03:58 +01:00
Tobias Fella
c3fd2428a2 Add QR code scanner 2024-03-28 22:02:55 +01:00
James Graham
fbb4b962fa Support selected text for replies in the right click menu
Support selected text for replies in the right click menu

BUG: 463885
2024-03-28 21:01:21 +00:00
Tobias Fella
9bf65de649 Use custom room drawer icons 2024-03-28 21:34:47 +01:00
Tobias Fella
75f069cb7d SpaceChildrenModel: Handle space being deleted 2024-03-28 16:46:38 +01:00
l10n daemon script
87d50125ab GIT_SILENT Sync po/docbooks with svn 2024-03-28 01:38:17 +00:00
l10n daemon script
dc2cf21cb8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-28 01:18:33 +00:00
Tobias Fella
bae14ecd35 Simplify spacedrawer width code 2024-03-27 21:09:27 +01:00
Gary Wang
b48c1c3b80 Allow show sender detail from message context menu
When curtain user is spamming a lot of messages in a short amount
of time, mod need to scroll all the way up to the first spam message to
know who send those spam message, thus start banning them.

This patch add a context menu to open the sender detail dialog, it could
make banning the spam user and batch-deleting spam messages easier.
2024-03-27 19:39:29 +00:00
James Graham
0f9eb4beeb Fix logout current connection crash
Make sure that the neochat can handle switching connection when the current one is logged out. This is mostly about using QPointer to handle use after free issues due to room objects being deleted.
2024-03-27 15:25:24 +00:00
l10n daemon script
0ab8624d79 GIT_SILENT Sync po/docbooks with svn 2024-03-27 09:54:21 +00:00
l10n daemon script
e872c934c3 GIT_SILENT Sync po/docbooks with svn 2024-03-27 01:31:49 +00:00
James Graham
c3d5d18aae Use unique pointers for space child items 2024-03-26 13:41:03 +00:00
James Graham
ff5853a850 Create a QML module for settings 2024-03-26 13:23:43 +00:00
l10n daemon script
f772906324 GIT_SILENT Sync po/docbooks with svn 2024-03-26 01:31:34 +00:00
l10n daemon script
07eabb2dc1 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-26 01:13:52 +00:00
l10n daemon script
b3c88763a4 GIT_SILENT Sync po/docbooks with svn 2024-03-25 01:31:49 +00:00
Tobias Fella
f7081f8829 Always encrypt DMs when creating them 2024-03-24 11:36:21 +01:00
James Graham
ceef2167fd Don't Maximize Stickers
Make sure that sticker don't open the maximize component as they aren't in the media model

BUG: 482701
2024-03-24 10:01:41 +00:00
James Graham
1dcfd94328 Fix Message Components for Tags with Attributes
Don't assume that the close tag is the length of the start tag +1

BUG: 482331
2024-03-24 10:01:00 +00:00
l10n daemon script
a1aa0804e2 GIT_SILENT Sync po/docbooks with svn 2024-03-24 01:20:31 +00:00
l10n daemon script
77176478eb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-24 01:14:27 +00:00
l10n daemon script
bf4ebfa7a8 GIT_SILENT made messages (after extraction) 2024-03-24 00:38:05 +00:00
Tobias Fella
6e7d622b41 Fix crash when visiting user
We're adding the "join" action so that rooms are joined.
libQuotient doesn't like it when we the action is join and the uri is for a user.

BUG: 483744
2024-03-23 20:46:56 +01:00
Tobias Fella
8398b7d24d Fix manual user search dialog 2024-03-23 20:45:15 +01:00
James Graham
aef9b7375a Fix Opening Maximized Media
Make sure the Image and Video Components can correctly get the index for opening the Maximize Media component.
2024-03-23 17:52:29 +00:00
James Graham
ba45318b56 Improved itinerary delegates
Steal the look of itinerary items from itinerary but simplified. Also includes new support for flights and restaurants

![image](/uploads/a574d2362edad52ecf91ce89a1849f27/image.png)
2024-03-23 09:33:51 +00:00
l10n daemon script
7d4f8780ad GIT_SILENT Sync po/docbooks with svn 2024-03-23 01:19:12 +00:00
l10n daemon script
b504c990f8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-23 01:13:26 +00:00
Tobias Fella
e07b876677 Add UI for entering key backup passphrase 2024-03-22 22:04:07 +01:00
Tobias Fella
a0bfd34951 Fix removing a parent space when we're not joined 2024-03-21 21:25:26 +01:00
l10n daemon script
b173714bbe GIT_SILENT Sync po/docbooks with svn 2024-03-21 01:20:56 +00:00
l10n daemon script
db4021b601 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-21 01:14:53 +00:00
l10n daemon script
2f46fd1d2c GIT_SILENT Sync po/docbooks with svn 2024-03-20 01:22:05 +00:00
Tobias Fella
1f85f848e2 Clean up button 2024-03-19 21:31:11 +01:00
Tobias Fella
d7e0954e86 Fix opening manual room dialog 2024-03-19 21:27:18 +01:00
James Graham
1671e05d12 More file previews
This adds previews for downloaded pdfs and code files.

![image](/uploads/9c199e91a1b4ea296c9b82a76e11038b/image.png)

![image](/uploads/17ea3869469417ee78e650ce750dbeb7/image.png)
2024-03-19 20:06:32 +00:00
Tobias Fella
33c55d1563 Add back errouneously removed import 2024-03-19 21:00:48 +01:00
Tobias Fella
4984181613 Refactor and improve emoji detection in reactions
UCHAR_EMOJI_PRESENTATION is replaced with UCHAR_EMOJI, which seems to be more useful for decting emojis.
The lambda is also turned into a proper function as there's no apparent reason for it to be a lambda.
2024-03-19 20:51:50 +01:00
Tobias Fella
af75136269 Bump compiler settings level to 6.0 2024-03-19 20:05:23 +01:00
l10n daemon script
c8eb75a148 GIT_SILENT Sync po/docbooks with svn 2024-03-19 01:22:10 +00:00
Joshua Goins
5109b4fcd1 Fix the quick format bar not actually doing anything 2024-03-18 20:17:06 +00:00
Joshua Goins
1b7f482d0b Exclude lonely question marks from the linkify regex
Many URLs we see in the KDE rooms end with a question mark, without a
space. The linkify regex for plain URLs incorrectly considered them as
part of the link, which usually breaks them when opened in a web
browser. Now the regex excludes these, unless they are accompanied by
another character (so links like kde.org/realurl?is=true will still
work.)
2024-03-18 15:46:22 -04:00
James Graham
6f9a273d39 Timeline Module
Move all the timeline QML files into their own QML module. Having them all in the same location is annoying and hard to work with.
2024-03-18 18:39:59 +00:00
l10n daemon script
51d354a9c8 GIT_SILENT Sync po/docbooks with svn 2024-03-18 01:31:43 +00:00
l10n daemon script
40b2b9554b SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-18 01:13:51 +00:00
l10n daemon script
ba1aca84ff GIT_SILENT Sync po/docbooks with svn 2024-03-17 01:30:01 +00:00
James Graham
17688a49d5 Remove stray log 2024-03-16 13:33:37 +00:00
James Graham
5ff199cc3e Itinerary Component
Move the itinerary model representation to it's own component and instantiate from MessageComponentModel. This starts to lay some groundwork for previewing other files.
2024-03-16 09:28:30 +00:00
l10n daemon script
81a79105d7 GIT_SILENT Sync po/docbooks with svn 2024-03-16 01:34:25 +00:00
l10n daemon script
e39760ccfb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-16 01:15:17 +00:00
Heiko Becker
1c43da2532 GIT_SILENT Update Appstream for new release
(cherry picked from commit f731877519)
2024-03-15 22:12:56 +01:00
Joshua Goins
2846def00f Fix typo in MessageEditComponent 2024-03-15 15:12:46 -04:00
Joshua Goins
e2eb6ab33c Don't destroy formatting when editing previous messages
Adds a few new methods to grab the markdown/slightly rich text from the
message, and will intelligently re-insert user mentions as needed.
2024-03-15 14:54:06 -04:00
Joshua Goins
35b08d085c Prevent collision between KUnifiedPush DBus and KRunner DBus
These share the same D-Bus service name (org.kde.neochat) which comes
with a fun little addition: KRunner activation! While this is not a
problem while NeoChat is running - since it's already registered - this
becomes an issue while searching for NeoChat in something like the
Kickoff. The Kickoff (and consequently, KRunner) tries to activate the
NeoChat D-Bus service which runs our unified push parts.

This introduces a "FakeRunner" which watches closely for calls to the
KRunner interface while we're in unified push mode (or directly called
from D-Bus but not running) so it quits immediately.
2024-03-15 18:41:04 +00:00
Joshua Goins
064b0581a7 Make the tabs in developer tools full-width
It looks slightly better, and since there's only four tabs it increases
the tappable area for them.
2024-03-15 18:39:21 +00:00
l10n daemon script
0cc38aa69a GIT_SILENT Sync po/docbooks with svn 2024-03-15 01:31:04 +00:00
l10n daemon script
8312483659 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-15 01:13:30 +00:00
l10n daemon script
0ceb0b4421 GIT_SILENT Sync po/docbooks with svn 2024-03-14 01:32:04 +00:00
l10n daemon script
cc373365fb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-14 01:14:11 +00:00
l10n daemon script
75d9b6e2a1 GIT_SILENT Sync po/docbooks with svn 2024-03-13 01:20:21 +00:00
l10n daemon script
78fa38ba68 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-13 01:15:08 +00:00
l10n daemon script
0b28712a34 GIT_SILENT made messages (after extraction) 2024-03-13 00:38:07 +00:00
Tobias Fella
48937c8d9a Make sure that timeline is scrolled to end when switching room 2024-03-12 22:45:29 +01:00
l10n daemon script
8c966a5e1a GIT_SILENT Sync po/docbooks with svn 2024-03-12 01:18:54 +00:00
l10n daemon script
f49dd371b7 GIT_SILENT made messages (after extraction) 2024-03-12 00:37:52 +00:00
Tobias Fella
6947fbc12a Add purpose plugin
Implements #182
2024-03-11 20:07:00 +01:00
Nicolas Fella
550dc43dc0 Remove manual window toggling for system tray icon
KStatusNotifierItem automatically does this for us
since we associate our window with it

Doing it again causes the window to be toggled again, which means
it won't be shown

BUG: 479721

BUG: 482779
2024-03-11 11:31:49 +01:00
l10n daemon script
23c9a4fea7 GIT_SILENT Sync po/docbooks with svn 2024-03-11 01:18:43 +00:00
Carl Schwan
7d26f3351f Fix crash in RoomTreeModel 2024-03-10 19:15:05 +01:00
Tobias Fella
b546554fef Require frameworks 6.0 2024-03-10 14:30:49 +01:00
James Graham
cc058a7cd3 Re-order spaces by dragging and dropping
Title
2024-03-10 11:18:28 +00:00
James Graham
7654b83339 Move the devtools button to UserInfo
Makes more sense now that room is selectable anyway and allows access from space home pages
2024-03-10 10:55:05 +00:00
James Graham
93426546ad Make sure that the MessageSourceSheet component is created properly in devtools 2024-03-10 10:25:53 +00:00
l10n daemon script
23bc38ca6c GIT_SILENT Sync po/docbooks with svn 2024-03-10 01:30:55 +00:00
Tobias Fella
5ccce364d3 Allow opening the settings from the welcome page
This is required to configure a proxy before logging in
2024-03-09 11:49:18 +01:00
l10n daemon script
b488b55a71 GIT_SILENT Sync po/docbooks with svn 2024-03-09 01:23:06 +00:00
l10n daemon script
0bace17074 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-09 01:14:29 +00:00
Tobias Fella
ad6c7dbd1f Don't link KDBusAddons on windows 2024-03-08 22:01:55 +01:00
James Graham
2a6e63595e Fix space tree refresh
Stop space hierarchy being duplicated. This is done by making sure old jobs are cleared at all resets and to make doubly sure when a child is inserted it overrides itself so there can never be duplicates
2024-03-08 18:36:43 +00:00
l10n daemon script
4d62ad1938 GIT_SILENT Sync po/docbooks with svn 2024-03-08 01:18:17 +00:00
l10n daemon script
e7c3a24011 GIT_SILENT Sync po/docbooks with svn 2024-03-07 01:17:40 +00:00
l10n daemon script
37468607fe GIT_SILENT Sync po/docbooks with svn 2024-03-06 01:18:26 +00:00
Albert Astals Cid
5b007129e3 flatpak: Switch to non-preview runtime 2024-03-06 00:33:31 +01:00
Tobias Fella
93ceb4d49c Improve hover link indicator accessibility
It's a bit pointless, since hovering it requires a mouse... but it's better than the previous behavior
2024-03-05 19:14:31 +01:00
Tobias Fella
85b806fcba Fix appstream 2024-03-05 18:27:39 +01:00
l10n daemon script
20596aabb8 GIT_SILENT Sync po/docbooks with svn 2024-03-05 01:18:31 +00:00
l10n daemon script
825108c59e GIT_SILENT made messages (after extraction) 2024-03-05 00:37:50 +00:00
James Graham
09c31b20e6 stripBlockTags Fixes
Make the code more robust by accounting for things like tag attributes
2024-03-04 21:05:11 +00:00
James Graham
78271a3738 Add highlight and copy button to code component 2024-03-04 20:09:22 +00:00
James Graham
e029aaadfc No Code String Convert
No need to try and convert code strings anymore this is now handled in KSyntaxHighlighter

see frameworks/syntax-highlighting!603 and frameworks/syntax-highlighting!604
2024-03-04 18:05:25 +00:00
l10n daemon script
f6efa35ed2 GIT_SILENT Sync po/docbooks with svn 2024-03-04 01:18:21 +00:00
l10n daemon script
728bad00b4 GIT_SILENT made messages (after extraction) 2024-03-04 00:37:35 +00:00
James Graham
97f3013f7a Visualise readacted messages
Make sure that a text delegate is added for redacted messages so that a message can be shown when show deletions is on
2024-03-03 16:33:21 +00:00
Tobias Fella
269a832ac9 Fix binding loop in NotificationsView 2024-03-03 16:56:18 +01:00
Tobias Fella
3b5b7af531 Fix QML warning 2024-03-03 16:43:52 +01:00
l10n daemon script
76e7eb7009 GIT_SILENT Sync po/docbooks with svn 2024-03-03 01:23:44 +00:00
l10n daemon script
fa99b8829d SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-03-03 01:15:35 +00:00
l10n daemon script
98b749ee9f GIT_SILENT made messages (after extraction) 2024-03-03 00:38:27 +00:00
Joshua Goins
cb9fd02dc7 Show link preview for links in room topics
This has an important security benefit, to prevent hiding fake links
behind real-looking ones.
2024-03-02 23:15:28 +00:00
Joshua Goins
1f4a271dd6 Remove unnecessary regex in room topic component
This makes Markdown links work again
2024-03-02 23:15:28 +00:00
Tobias Fella
bdf192df58 Use plaintext in devtools room selection combo 2024-03-02 19:36:46 +01:00
Tobias Fella
1249304907 Add devtools button to account menu 2024-03-02 19:07:13 +01:00
Tobias Fella
10e3ab1f78 Hide typing notifications for ignored users
Fixes #635
2024-03-02 18:43:08 +01:00
James Graham
59ea270b2f Fix the top section heading in the timeline. It was previously causing anchor loops 2024-03-02 10:28:04 +00:00
l10n daemon script
3b748e2e21 GIT_SILENT Sync po/docbooks with svn 2024-03-02 01:18:53 +00:00
l10n daemon script
432fae5ce2 GIT_SILENT made messages (after extraction) 2024-03-02 00:37:39 +00:00
James Graham
f557ceda19 Notification Consistency
Make sure that the new rules for counting notifications for muted, mention and low priority rooms is applied consistently to the room list, space drawer and the task manager notification badge

implements #644
2024-03-01 17:56:13 +00:00
Tobias Fella
943f6c762c Fix (un)ignoring unknown users 2024-03-01 09:32:45 +00:00
l10n daemon script
5a9293e293 GIT_SILENT Sync po/docbooks with svn 2024-03-01 01:32:00 +00:00
l10n daemon script
a1bc52c1a5 GIT_SILENT made messages (after extraction) 2024-03-01 00:38:01 +00:00
Carl Schwan
dcd752be8f Fix compilation error 2024-02-29 23:48:35 +01:00
Carl Schwan
deb2c61b28 Improve appstream metadata 2024-02-29 23:48:35 +01:00
Joshua Goins
5e346283a9 Add app identifier in donation url 2024-02-29 20:11:16 +00:00
Carl Schwan
dc1e4219a0 Add more appstream urls 2024-02-29 09:08:30 +00:00
l10n daemon script
a916f70698 GIT_SILENT Sync po/docbooks with svn 2024-02-29 01:19:12 +00:00
l10n daemon script
77da4d2d53 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-02-29 01:13:28 +00:00
James Graham
1ae3fc86da Updated room sorting
Change the LastActivity sort order to Activity and update to a more flexible way of sorting based on an order from model roles.
Add options to actually switch between Alphabetical and Activity

Based on some old work by @tdfischer 

implements #103
2024-02-28 17:57:32 +00:00
l10n daemon script
0c24996b44 GIT_SILENT Sync po/docbooks with svn 2024-02-28 01:18:27 +00:00
l10n daemon script
1cbb4a93eb SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-02-28 01:13:32 +00:00
James Graham
1fac6ca34a Split text section into blocks
The aim is to be able to use separate delegate for things like codeblocks and quotes so that they can be styled differently.

![image](/uploads/c813c0d1767f45df14cebe632e2ee10a/image.png)
2024-02-27 18:52:06 +00:00
l10n daemon script
ca439b0f86 GIT_SILENT Sync po/docbooks with svn 2024-02-27 01:19:14 +00:00
l10n daemon script
f70febc8d3 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-02-27 01:13:57 +00:00
Tobias Fella
628de56087 Devtools: Split state keys into a separate list 2024-02-26 17:05:28 +01:00
Tobias Fella
bc67033c00 Adapt to QTP0001 2024-02-26 16:49:17 +01:00
l10n daemon script
e0ba2a179c GIT_SILENT Sync po/docbooks with svn 2024-02-26 01:20:46 +00:00
Tobias Fella
e0ce5d9544 Show AccountData in Devtools 2024-02-25 21:05:12 +01:00
Tobias Fella
38acfe04b9 Fix sharing 2024-02-25 20:13:39 +01:00
Tobias Fella
5b0068d9e4 Cache space hierarchy to disk
This significantly improves the startup experiences by eliminating
the changes in the space drawer while neochat loads.

Implements #640
Replaces !1563
2024-02-25 20:12:07 +01:00
James Graham
38edad2ac5 Make sure that only text messages can be edited 2024-02-25 17:20:49 +00:00
Tobias Fella
e95f191dc6 Add view of ignored users and allow unignoring them 2024-02-25 18:03:10 +01:00
Tobias Fella
8ae92ff4d4 Port room upgrade dialog to Kirigami.Dialog 2024-02-25 17:55:05 +01:00
Tobias Fella
40e15d456a Favourites -> Favorites
BUG: 481814
2024-02-25 16:35:10 +01:00
l10n daemon script
a1b3308cd7 GIT_SILENT Sync po/docbooks with svn 2024-02-25 01:23:35 +00:00
l10n daemon script
48ef19e4be GIT_SILENT Sync po/docbooks with svn 2024-02-24 01:17:25 +00:00
l10n daemon script
d3f00b9246 GIT_SILENT Sync po/docbooks with svn 2024-02-23 01:18:21 +00:00
Tobias Fella
89de676982 Don't build kirigami-addons master 2024-02-22 19:06:14 +01:00
Tobias Fella
6dec624d22 Pin kirigami-addons 2024-02-22 19:05:00 +01:00
Tobias Fella
d4eb9ea320 Move ShowAuthorRole to MessageFilterModel
Only there can it be calculated correctly.
Fixes #632
2024-02-22 18:42:04 +01:00
l10n daemon script
1cfaa88989 GIT_SILENT Sync po/docbooks with svn 2024-02-22 01:19:42 +00:00
James Graham
82ae0891a8 Create a feature flag page in devtools. 2024-02-21 23:53:51 +00:00
James Graham
58c43b0cd4 Make sure that the room isn't already in the model before appending.
Make sure that the room isn't already in the model before appending. Move it if it's in the wrong catgeory
2024-02-21 23:52:10 +00:00
Tobias Fella
1c373031bd Html-escape display name in user detail sheet 2024-02-21 18:10:32 +01:00
Tobias Fella
e93842a95f Fix saving images from maximize component
Fixes #643
2024-02-21 16:51:23 +01:00
l10n daemon script
9cdb34cb1d GIT_SILENT Sync po/docbooks with svn 2024-02-21 01:19:26 +00:00
James Graham
864f9b8f74 Add feature flag for reply in thread
Currently the ability to reply in threads was added but not the ability to actually view threads so this doesn't currently make much sense to just have enabled int he main build.

Note: I want to cherrypick this so it's just the flag. I'll add a feature flag page to dev tools for master soon.
2024-02-20 20:09:49 +00:00
Tobias Fella
d99fae333a Introduce MediaManager
Currently, this is only to pause playback of other media when something new starts playing.
In the future, it will also be used for other things, like call ringing, etc.
2024-02-20 21:08:47 +01:00
Tobias Fella
b27bec3e16 Leave predecessor rooms when leaving room
Implements #621
2024-02-20 20:59:04 +01:00
Tobias Fella
5fb4838734 Improve push notification string 2024-02-20 20:50:17 +01:00
Tobias Fella
1296255a86 Remove room from RoomTreeModel before leaving it
This makes sure that the room disappears from the tree view
2024-02-20 20:42:02 +01:00
Tobias Fella
e3ed2fcaa9 Fix crash in ImagePacksModel 2024-02-20 20:36:33 +01:00
Tobias Fella
69d6b90a12 Fix email 2024-02-20 18:43:23 +01:00
Tobias Fella
6937a4b2fe Quotient -> libQuotient 2024-02-20 18:42:13 +01:00
Tobias Fella
621c36f821 Fix disconnect warning 2024-02-20 18:40:00 +01:00
Tobias Fella
940929d044 Fix qml warning 2024-02-20 18:22:42 +01:00
Tobias Fella
bac5fa8c14 Don't try setting up push notifications when there's no endpoint 2024-02-20 18:19:49 +01:00
Tobias Fella
a10da64378 Run qmlformat 2024-02-20 18:11:23 +01:00
Tobias Fella
f2c12c582e Remove duplicated actions 2024-02-20 18:06:09 +01:00
l10n daemon script
a686c44555 GIT_SILENT Sync po/docbooks with svn 2024-02-20 01:21:08 +00:00
Joshua Goins
8e96217ae6 Separate MessageDelegateContextMenu to its own base component
This is the first step in separation, so we can focus more on the
actions in this menu, and it's not tangled up in how the context menu is
shown and displayed.
2024-02-19 22:07:00 +01:00
Tobias Fella
ec906813fc Remove redundant checks 2024-02-19 21:28:31 +01:00
Tobias Fella
36543d0872 Fix some properties
Properties with READ and WRITE need to NOTIFY
2024-02-19 21:21:08 +01:00
Tobias Fella
fc6ea0b779 Port RoomList to TreeView
Use a tree model for the room list

closes network/neochat#156

BUG: 456643
2024-02-19 20:09:43 +00:00
Tobias Fella
dae23ccd4b Fix crash when there is no recommended space 2024-02-19 18:13:37 +01:00
Tobias Fella
666cd3c81f Fix audio playback 2024-02-19 18:05:25 +01:00
Carl Schwan
dc5366e924 Add neochat 24.02 release note 2024-02-19 11:12:58 +01:00
l10n daemon script
f21b3bb0e4 GIT_SILENT Sync po/docbooks with svn 2024-02-19 01:21:38 +00:00
Tobias Fella
4ebcc36fb3 Add a way for distros to recommend joining a space
Implements #137
2024-02-18 17:13:34 +01:00
James Graham
292cfb0d3d Change ExploreComponent to signal text changes and set filterText from there 2024-02-18 11:13:36 +00:00
James Graham
1b59917f16 Space notification count
Show the number of notifications for a space if it isn't selected. This respects choices like low priority only adding highlights.
2024-02-18 11:04:56 +00:00
James Graham
fcf64a7e1b Fix Space Saving
This handles the following non-functioning cases from the space saving mr:
- Selecting home or friends
- Switching space that has the same room selected
2024-02-18 10:24:30 +00:00
James Graham
b598584aea Message Content Rework
For now everything should look identical. However this moves to using a model for the content of the message and is intended to lay the foundation for improved message content representation, e.g. splitting up a text message in multiple sections and using different delegates for things like code and quotes.
2024-02-18 09:53:08 +00:00
l10n daemon script
0ebcacce69 GIT_SILENT Sync po/docbooks with svn 2024-02-18 01:21:04 +00:00
l10n daemon script
33c38288a3 GIT_SILENT Sync po/docbooks with svn 2024-02-17 01:20:38 +00:00
l10n daemon script
f00e3ded45 GIT_SILENT Sync po/docbooks with svn 2024-02-16 01:21:00 +00:00
Heiko Becker
250483fbe7 GIT_SILENT Update Appstream for new release
(cherry picked from commit 1c910165c1)
2024-02-16 00:48:38 +01:00
Carl Schwan
755a060e12 Fix reaction delegate sizing for text reaction 2024-02-15 17:51:39 +00:00
Carl Schwan
6d3839dd42 Fix reaction update event when the event is not there anymore
Happens when interacting witht Mjonir quite often
2024-02-15 16:55:20 +01:00
l10n daemon script
15084459bb GIT_SILENT Sync po/docbooks with svn 2024-02-15 01:17:29 +00:00
Tobias Fella
7150445f8e Skip Welcome screen when there's only one connection and it's loaded
If the connection is stuck, we can still log in to a different one that way.
2024-02-14 18:14:38 +01:00
Tobias Fella
b02bdd22dd Allow dropping connections from the welcome page
This is the last piece required to make sure that we can recover from broken connections, e.g., when the access token is invalid.
2024-02-14 17:38:46 +01:00
l10n daemon script
8755cd9d61 GIT_SILENT Sync po/docbooks with svn 2024-02-14 01:20:54 +00:00
l10n daemon script
2c4c07dc81 GIT_SILENT made messages (after extraction) 2024-02-14 00:38:03 +00:00
l10n daemon script
645771c03d GIT_SILENT Sync po/docbooks with svn 2024-02-13 01:21:53 +00:00
Joshua Goins
b2af69fd92 Make the settings window a little bit taller to accommodate most pages
According to the HIG, scrolling should be kept to a minimum on settings
dialogs. The default window size for the dialog is too small on desktop,
and usually needs to be resized to prevent scrolling.
2024-02-12 18:19:44 +01:00
Tobias Fella
ca57732871 Show custom emoji reactions as per MSC4027 2024-02-12 14:11:54 +01:00
l10n daemon script
cd9e98f24b GIT_SILENT Sync po/docbooks with svn 2024-02-12 01:18:29 +00:00
l10n daemon script
136da65381 GIT_SILENT Sync po/docbooks with svn 2024-02-11 01:21:13 +00:00
Tobias Fella
b909cb2db8 Fix AudioDelegate playback 2024-02-10 17:22:09 +01:00
James Graham
3a4b531edf Remember Space
Save the last space entered so it can be recalled on startup
2024-02-10 14:51:57 +00:00
James Graham
413453dd85 Improve getBody
Create basic event types so that we can switch on type for live location beacons, widget and server acl events
2024-02-10 14:24:30 +00:00
Tobias Fella
fe52d26f05 Run qmlformat over everything 2024-02-10 12:06:08 +01:00
l10n daemon script
6029c0d0b3 GIT_SILENT Sync po/docbooks with svn 2024-02-10 01:28:07 +00:00
Heiko Becker
12bfe9d6ca GIT_SILENT Update Appstream for new release
(cherry picked from commit 0cd0a6a672)
2024-02-10 00:24:47 +01:00
l10n daemon script
dd910f2856 GIT_SILENT Sync po/docbooks with svn 2024-02-09 01:22:35 +00:00
l10n daemon script
b4e0d9e996 GIT_SILENT Sync po/docbooks with svn 2024-02-07 01:16:46 +00:00
l10n daemon script
d3f691548c GIT_SILENT Sync po/docbooks with svn 2024-02-06 01:30:50 +00:00
James Graham
367131d64c Fix layoutTimer
Only change the room when a space is change rather than on all layout refreshes
2024-02-05 17:48:04 +00:00
l10n daemon script
2895b7bc21 GIT_SILENT Sync po/docbooks with svn 2024-02-05 01:26:55 +00:00
James Graham
f9cdd55a4d Support the order parameter in m.space.child events
Support the order parameter in m.space.child events, with the exception of always putting spaces higher than non-spaces

see https://spec.matrix.org/v1.8/client-server-api/#ordering-of-children-within-a-space for the spec algorithm
2024-02-04 19:10:37 +00:00
James Graham
1854373dd6 - Low priority rooms only show highlights and mentions in the roomlist
- Muted rooms hide their bubble in the `roomlist`
- Mentions and keywords only show highlights
2024-02-04 18:05:34 +00:00
l10n daemon script
00a621a5f7 GIT_SILENT Sync po/docbooks with svn 2024-02-04 01:18:54 +00:00
l10n daemon script
f047bd797e GIT_SILENT Sync po/docbooks with svn 2024-02-03 01:21:25 +00:00
Akseli Lahtinen
777f8b4276 Use resolveResource for SpaceDrawer and RoomListPage
Fixes a bug where opening a space would not do anything due to enterRoom and enterSpaceHome missing.
2024-02-02 11:02:11 +00:00
l10n daemon script
0992b7fc93 GIT_SILENT Sync po/docbooks with svn 2024-02-02 01:17:11 +00:00
Nate Graham
b7d6208869 Revert "Compact Mode Improvements"
This reverts commit fb3b1490a9.

BUG: 480504
2024-02-01 08:45:01 -07:00
l10n daemon script
da4ce27168 GIT_SILENT Sync po/docbooks with svn 2024-02-01 01:17:48 +00:00
James Graham
4746401bec Change the behaviour when clicking on a space
- When click on a space the space home page is shown, unless the current room is also a member of the new space
- When changing to friends or global the first is entered
- The global now only contains rooms that are not part of a space
- Global is now home
2024-01-31 20:33:36 +00:00
l10n daemon script
79cf399bf5 GIT_SILENT Sync po/docbooks with svn 2024-01-31 01:22:04 +00:00
l10n daemon script
563323f241 GIT_SILENT Sync po/docbooks with svn 2024-01-30 01:19:27 +00:00
Tobias Fella
e2048dfa1c Revert "Add a way for distros to recommend joining a space"
This reverts commit c986c63b84.
2024-01-29 23:14:07 +01:00
Tobias Fella
c986c63b84 Add a way for distros to recommend joining a space
Implements #137
2024-01-29 23:12:51 +01:00
l10n daemon script
0b3426a9b2 GIT_SILENT Sync po/docbooks with svn 2024-01-29 01:17:13 +00:00
Tobias Fella
173e507ebf Don't color usernames in state delegates
This starts to look quite messy when there are many state delegates visible
2024-01-28 18:24:23 +01:00
James Graham
fb3b1490a9 Compact Mode Improvements
Get rid of the anchors and move to layouts for th bubble and avatars.

This allows the timestamp to be fixed in compact mode so it always sits on the far right. It's also just now more compact than before.

![image](/uploads/7747a9b3f2f4cfb56a8d9b0f943a127f/image.png)
2024-01-28 17:13:23 +00:00
James Graham
48502480df Fix copying selected text from a message 2024-01-28 01:40:10 +00:00
l10n daemon script
efb3b8f38c GIT_SILENT Sync po/docbooks with svn 2024-01-28 01:19:49 +00:00
l10n daemon script
f185b1773c GIT_SILENT Sync po/docbooks with svn 2024-01-27 01:18:13 +00:00
James Graham
95fff4c9f7 Refactor EventHandler
Refactor EventHandler to be a Q_GADGET and create from a constructor
2024-01-26 17:17:53 +00:00
James Graham
27662f9a4a MessageSource Line Numbers
Create a model for getting line numbers from a QQuickTextDocument and then add them to the MessageSource page
2024-01-26 15:58:12 +00:00
l10n daemon script
f9f678a801 GIT_SILENT Sync po/docbooks with svn 2024-01-26 01:19:44 +00:00
l10n daemon script
8e07e7553a GIT_SILENT Sync po/docbooks with svn 2024-01-25 01:16:35 +00:00
James Graham
bb566e3c7b Always use resolveResource instead of enterRoom or EnterSpaceHome 2024-01-24 20:26:21 +00:00
James Graham
35c68a6de1 Manual friend ID
Add manual ID dialog to the friend search page
2024-01-24 19:56:52 +00:00
l10n daemon script
7fd8394253 GIT_SILENT Sync po/docbooks with svn 2024-01-24 01:17:22 +00:00
Tobias Fella
c54a447caf Add appstream developer tag and remove developer_name tag 2024-01-23 22:42:36 +01:00
l10n daemon script
61b009422d GIT_SILENT Sync po/docbooks with svn 2024-01-23 01:18:48 +00:00
l10n daemon script
5a8b0184ea GIT_SILENT Sync po/docbooks with svn 2024-01-22 01:29:04 +00:00
James Graham
f48c2a21d9 Autosearch
Make the user search automatically. This includes a timer to ensure that we aren't constantly pinging the server as the user types, the search is started 0.5s after the user stops typing. The `PublicRoomListModel` is upgraded to work in the same manner as it was architected slightly differently.
2024-01-21 11:24:40 +00:00
l10n daemon script
538cfbee8d GIT_SILENT Sync po/docbooks with svn 2024-01-21 01:17:19 +00:00
James Graham
7666f1c362 Fix the vertical alignment of the notification bubble text 2024-01-20 19:07:27 +00:00
James Graham
4b5d828bf8 The search for friendship
Add the ability to search in the user directory for friends.

This adds an option in roomlist when on the friends tab and opens a search dialog when clicked. The new search model searches the user directory for the given filter term.
2024-01-20 16:13:49 +00:00
Tobias Fella
4bd160cceb Remove workaround for QTBUG 93281
Seems to no longer be required
2024-01-20 16:13:13 +00:00
Joshua Goins
5f56fc1156 Add icon for notification state menu
In Qt6 we can (finally) add icons to QQC Menus!
2024-01-20 13:47:17 +00:00
l10n daemon script
72a2a74395 GIT_SILENT Sync po/docbooks with svn 2024-01-20 01:17:30 +00:00
James Graham
f6a5cc7c25 Generic Search Page
Pull the generic aspects from Room search and join room pages into it's own component. This is done in anticipation of using the new generic search page for a user search functionality.

- `SearchPage` is now used for the generic version with the old one being renamed `RoomSearchPage`
- `JoinRoomPage` is renamed to `ExploreRoomsPage` inline with everywhere else in NeoChat

There is also some cleanup of the code for both search pages in here.
2024-01-19 17:59:45 +00:00
l10n daemon script
80f3bd64b6 GIT_SILENT Sync po/docbooks with svn 2024-01-18 01:18:17 +00:00
Joshua Goins
1f69a96766 Hide the subtitle text for room delegates if there is none
This centers the room name label for room list items, which looks a bit
cleaner than nothing being there at all.
2024-01-17 17:29:57 +00:00
James Graham
f963e06983 Remove the option to merge the room list 2024-01-17 16:58:51 +00:00
l10n daemon script
e6980e2370 GIT_SILENT Sync po/docbooks with svn 2024-01-17 01:19:30 +00:00
James Graham
8e8105d04d Clip QuickSwitcher
Clip QuickSwitcher to stop the delegates overlapping the dialog
2024-01-16 20:08:53 +00:00
Ingo Klöcker
21d9e69712 Require master of ECM
We need the fix for APK packaging with Android NDK r25
2024-01-16 13:57:33 +01:00
l10n daemon script
e0783a3c6e GIT_SILENT Sync po/docbooks with svn 2024-01-16 01:19:20 +00:00
l10n daemon script
3b9337d2a8 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2024-01-16 01:12:42 +00:00
James Graham
85cda8ffa7 Current Room Messages
Make sure that message delegates are getting the room object directly rather than requiring the assumption that currentRoom is declared somewhere higher up.
2024-01-15 19:47:50 +00:00
l10n daemon script
f1efc1f17d GIT_SILENT Sync po/docbooks with svn 2024-01-15 01:19:09 +00:00
James Graham
0486fa61cd NeoChatConnection signals
Move the signal connects to a function and call from both constructors
2024-01-14 12:25:53 +00:00
Joshua Goins
2247a2a7af Make the search message dialog header way prettier, like it is in KCMs
I think I've heard of this before...
2024-01-14 01:36:59 +00:00
Joshua Goins
08a0fbfd6b Add missing thread roles in SearchModel
This fixes the message search so it works again!
2024-01-14 01:34:43 +00:00
l10n daemon script
898b993b94 GIT_SILENT Sync po/docbooks with svn 2024-01-14 01:30:05 +00:00
James Graham
77e366b179 Why can't we be friends
Update the UX to refer to structure direct chats as friends. The direct chats are pulled into their own tab in the space drawer.

The `UserDetailDialog` is also updated to check whether a direct chat already exists and if not ask to invite as friend.

![image](/uploads/67f13fa8558e704e0acaf7c60e135bbc/image.png)
2024-01-13 21:38:43 +00:00
Tobias Fella
981edc9cf7 Refactor proxy configuration and move to separate file 2024-01-13 17:39:56 +01:00
Tobias Fella
d45aa14348 Refactor some code around connection handling 2024-01-13 13:00:29 +00:00
Tobias Fella
4926488d49 Move notifications button to space drawer.
Since this means that the space drawer can no longer be hidden when there are no spaces,
also make it less empty by adding a button for creating new spaces.
More things will come in the future.

BUG: 479051
2024-01-13 11:28:25 +01:00
l10n daemon script
dcc1935150 GIT_SILENT Sync po/docbooks with svn 2024-01-13 01:24:17 +00:00
Tobias Fella
55364a8eb8 Add basic Itinerary integration
After downloading a file, the model calls the extractor and uses the
JSON to show some basic information about the content and allows to import
the data to Itinerary. This is entirely runtime-optional; no build-time dependencies
are required and nothing changes if the extractor isn't available.
2024-01-12 21:00:14 +00:00
Tobias Fella
70bb06715f Don't crash when calling directChatRemoteUser in something that isn't a direct chat
Can happen e.g. in gammaray
2024-01-12 16:32:49 +01:00
James Graham
ec4aa73e37 Readonly Room
Add readonly property to a room and use it to decide whether to show chatbar, replies and edits

BUG: 479590
2024-01-12 01:59:09 +00:00
Albert Astals Cid
c1d122a717 GIT_SILENT Upgrade release service version to 24.04.70. 2024-01-11 21:36:24 +01:00
416 changed files with 133196 additions and 95586 deletions

View File

@@ -2,5 +2,5 @@
; SPDX-License-Identifier: CC0-1.0
[BlueprintSettings]
kde/unreleased/kirigami-addons.version=master
kde/frameworks/extra-cmake-modules.version=master
libs/qt.qtMajorVersion=6

View File

@@ -2,7 +2,7 @@
"id": "org.kde.neochat",
"branch": "master",
"runtime": "org.kde.Platform",
"runtime-version": "6.6-kf6preview",
"runtime-version": "6.6",
"sdk": "org.kde.Sdk",
"command": "neochat",
"tags": [
@@ -27,7 +27,7 @@
"name": "kirigamiaddons",
"config-opts": [ "-DBUILD_TESTING=OFF" ],
"buildsystem": "cmake-ninja",
"sources": [ { "type": "git", "url": "https://invent.kde.org/libraries/kirigami-addons.git" } ]
"sources": [ { "type": "git", "url": "https://invent.kde.org/libraries/kirigami-addons.git", "commit": "34d311219e8b7209746a98b3a29b91ded05ff936" } ]
},
{
"name": "kquickimageeditor",

1
.gitignore vendored
View File

@@ -12,3 +12,4 @@ kate.project.ctags.*
.idea/
cmake-build-*
src/res.generated.qrc
.qmlls.ini

View File

@@ -28,9 +28,11 @@ Dependencies:
'frameworks/kio': '@latest-kf6'
'frameworks/kwindowsystem': '@latest-kf6'
'frameworks/kstatusnotifieritem': '@latest-kf6'
'frameworks/kcrash': '@latest-kf6'
- 'on': ['Linux', 'FreeBSD']
'require':
'frameworks/kdbusaddons': '@latest-kf6'
'frameworks/purpose': '@latest-kf6'
- 'on': ['Linux']
'require':

View File

@@ -49,3 +49,7 @@ License: CC0-1.0
Files: appiumtests/data/*
Copyright: 2023 Tobias Fella <tobias.fella@kde.org>
License: CC0-1.0
Files: src/purpose/purposeplugin.json
Copyright: 2023 Tobias Fella <tobias.fella@kde.org>
License: BSD-2-Clause

View File

@@ -8,13 +8,13 @@ cmake_minimum_required(VERSION 3.16)
# KDE Applications version, managed by release script.
set(RELEASE_SERVICE_VERSION_MAJOR "24")
set(RELEASE_SERVICE_VERSION_MINOR "01")
set(RELEASE_SERVICE_VERSION_MICRO "90")
set(RELEASE_SERVICE_VERSION_MINOR "04")
set(RELEASE_SERVICE_VERSION_MICRO "70")
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
set(KF_MIN_VERSION "5.240.0")
set(KF_MIN_VERSION "6.0")
set(QT_MIN_VERSION "6.5")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
@@ -24,7 +24,7 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(KDE_COMPILERSETTINGS_LEVEL 5.105)
set(KDE_COMPILERSETTINGS_LEVEL 6.0)
include(FeatureSummary)
include(ECMSetupVersion)
@@ -58,6 +58,9 @@ set_package_properties(Qt6 PROPERTIES
TYPE REQUIRED
PURPOSE "Basic application components"
)
qt_policy(SET QTP0001 NEW)
find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme)
set_package_properties(KF6 PROPERTIES
TYPE REQUIRED
@@ -69,6 +72,10 @@ set_package_properties(KF6Kirigami PROPERTIES
)
find_package(KF6KirigamiAddons 0.7.2 REQUIRED)
if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT NEOCHAT_FLATPAK AND NOT NEOCHAT_APPIMAGE)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Purpose)
endif ()
if(ANDROID)
find_package(OpenSSL)
set_package_properties(OpenSSL PROPERTIES
@@ -77,7 +84,8 @@ if(ANDROID)
)
else()
find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem Crash)
find_package(KF6SyntaxHighlighting ${KF_MIN_VERSION} REQUIRED)
set_package_properties(KF6QQC2DesktopStyle PROPERTIES
TYPE RUNTIME
)

View File

@@ -1,6 +1,6 @@
<!--
SPDX-FileCopyrightText: 2020-2021 Carl Schwan <carlschwan@kde.org>
SPDX-FileCopyrightText: 2020-2021 Tobias Fella <tobias.fella@kde.org>
SPDX-FileCopyrightText: 2020-2024 Tobias Fella <tobias.fella@kde.org>
SPDX-FileCopyrightText: 2023 James Graham <james.h.graham@protonmail.com>
SPDX-License-Identifier: CC0-1.0
-->
@@ -16,19 +16,18 @@ A Qt/QML based Matrix client.
## Introduction
NeoChat is a client for [Matrix](https://matrix.org), the decentralized communication protocol for instant
messaging. It is a fork of Spectral, using KDE frameworks, most notably [Kirigami](https://invent.kde.org/frameworks/kirigami)
to provide a convergent experience across multiple platforms.
messaging.
NeoChat also make use of other KDE Frameworks as well as [libQuotient](https://github.com/quotient-im/libQuotient), a
NeoChat is based on KDE frameworks and as [libQuotient](https://github.com/quotient-im/libQuotient), a
Qt-based SDK for the [Matrix Protocol](https://spec.matrix.org/).
![Timeline](https://cdn.kde.org/screenshots/neochat/application.png)
## Features
NeoChat aims to be a fully featured application for the Matrix specification. As such everything in the current stable specification with the notable exceptions
of VoIP, threads and some aspects of End-to-End Encryption are supported. There are a few other smaller omissions due to the fact that the Matrix spec is constantly
evolving but the aim remains to provide eventual support for the entire spec.
NeoChat aims to be a fully featured application for the Matrix specification. As such most parts of the current specification are supported, with the notable exceptions
of VoIP, threads, and some aspects of End-to-End Encryption. There are a few other smaller omissions due to the fact that the Matrix spec is constantly
evolving, but the aim remains to provide eventual support for the entire spec.
Due to the nature of the Matrix specification development NeoChat also supports numerous unstable features. Currently these are:
- Polls - MSC3381
@@ -39,26 +38,9 @@ Due to the nature of the Matrix specification development NeoChat also supports
Details where to find stable releases for NeoChat can be found on its [homepage](https://apps.kde.org/neochat).
In addition to the stable builds, unstable nightly builds are available for all platforms. These can be downloaded
from the [binary factory](https://binary-factory.kde.org/). There are unstable versions for the following platforms
in addition to stable ones:
- Android
- MacOS
- Windows
Additionally the nightly Flatpak version can be obtained from the nightly Flatpak repo using the following commands in your terminal:
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists kdeapps --from https://distribute.kde.org/kdeapps.flatpakrepo
flatpak install kdeapps org.kde.neochat
```
The unstable Android version can also be obtained from the [KDE nightly F-Droid repo](https://community.kde.org/Android/FDroid).
## Running
Just start the executable in your preferred way - either from the build directory or from the installed location.
Nightly builds for linux and windows can be downloaded from [cdn.kde.org](https://cdn.kde.org/ci-builds/network/neochat/).
Nightly builds for android are available from [KDE's nightly F-Droid repository](https://community.kde.org/Android/F-Droid).
Nightly Flatpaks are available from [KDE's nightly Flatpak repository](https://userbase.kde.org/Tutorials/Flatpak).
## Building NeoChat
@@ -69,14 +51,18 @@ is primarily aimed at Linux development.
For Windows and Android [Craft](https://invent.kde.org/packaging/craft) is the primary choice. There are guides for setting up
development environments for [Windows](https://community.kde.org/Get_Involved/development/Windows) and [Android](https://develop.kde.org/docs/packaging/android/building_applications/).
## Running
Just start the executable in your preferred way - either from the build directory or from the installed location.
## Tests
Tests are in the repository under [autotests](autotests) and should all pass for any contribution.
Tests are in the repository under [autotests](autotests) and [appiumtests](appiumtests).
The project has CI setup to test new commits to the repository. All tests are expected to pass for a merge request to
be complete.
Current build status
## Current build status
![coverage](https://invent.kde.org/network/neochat/badges/master/pipeline.svg)
@@ -100,9 +86,9 @@ The best place to reach the maintainers is on the KDE Matrix instance in the Neo
## Acknowledgement
This program utilizes [libQuotient](https://github.com/quotient-im/libQuotient/) as its Matrix SDK.
NeoChat utilizes [libQuotient](https://github.com/quotient-im/libQuotient/) as its Matrix SDK.
This program is a fork of [Spectral](https://gitlab.com/spectral-im/spectral/).
NeoChat is a fork of [Spectral](https://gitlab.com/spectral-im/spectral/).
## License

View File

@@ -39,6 +39,10 @@ class OpenUserDetailsTest(unittest.TestCase):
def test_open_sheet(self):
self.driver.find_element(by=AppiumBy.NAME, value="@user:localhost:1234").click()
try:
self.driver.find_element(by=AppiumBy.NAME, value="Expand Normal").click()
except:
pass
self.driver.find_element(by=AppiumBy.NAME, value="Empty room (!room_id_1234:localhost:1234)").click()
self.driver.find_element(by=AppiumBy.NAME, value="A Display Name").click()
self.driver.find_element(by=AppiumBy.NAME, value="Account Details")

View File

@@ -130,7 +130,7 @@ void DelegateSizeHelperTest::equalBreakpoint_data()
}
/**
* We expect a default return except in the case where the the two percentages are
* We expect a default return except in the case where the two percentages are
* equal as that case can be calculated without dividing by zero.
*/
void DelegateSizeHelperTest::equalBreakpoint()

View File

@@ -12,7 +12,6 @@
#include <Quotient/quotient_common.h>
#include <Quotient/syncdata.h>
#include "enums/delegatetype.h"
#include "linkpreviewer.h"
#include "models/reactionmodel.h"
#include "neochatroom.h"
@@ -29,19 +28,14 @@ class EventHandlerTest : public QObject
private:
Connection *connection = nullptr;
TestUtils::TestRoom *room = nullptr;
EventHandler eventHandler;
EventHandler emptyHandler;
EventHandler noEventHandler;
EventHandler emptyHandler = EventHandler(nullptr, nullptr);
private Q_SLOTS:
void initTestCase();
void nullSetEvent();
void eventId();
void nullEventId();
void delegateType_data();
void delegateType();
void nullDelegateType();
void author();
void nullAuthor();
void authorDisplayName();
@@ -61,6 +55,7 @@ private Q_SLOTS:
void genericBody_data();
void genericBody();
void nullGenericBody();
void markdownBody();
void subtitle();
void nullSubtitle();
void mediaInfo();
@@ -69,8 +64,6 @@ private Q_SLOTS:
void nullHasReply();
void replyId();
void nullReplyId();
void replyDelegateType();
void nullReplyDelegateType();
void replyAuthor();
void nullReplyAuthor();
void replyBody();
@@ -83,76 +76,36 @@ private Q_SLOTS:
void nullLocation();
void readMarkers();
void nullReadMarkers();
void cleanup();
};
void EventHandlerTest::initTestCase()
{
connection = Connection::makeMockConnection(QStringLiteral("@bob:kde.org"));
room = new TestUtils::TestRoom(connection, QStringLiteral("#myroom:kde.org"), QLatin1String("test-eventhandler-sync.json"));
eventHandler.setRoom(room);
noEventHandler.setRoom(room);
}
void EventHandlerTest::nullSetEvent()
{
QTest::ignoreMessage(QtWarningMsg, "cannot setEvent when m_room is set to nullptr.");
emptyHandler.setEvent(room->messageEvents().at(0).get());
}
void EventHandlerTest::eventId()
{
eventHandler.setEvent(room->messageEvents().at(0).get());
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.getId(), QStringLiteral("$153456789:example.org"));
}
void EventHandlerTest::nullEventId()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getId called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getId(), QString());
}
void EventHandlerTest::delegateType_data()
{
QTest::addColumn<int>("eventNum");
QTest::addColumn<DelegateType::Type>("delegateType");
QTest::newRow("message") << 0 << DelegateType::Message;
QTest::newRow("state") << 1 << DelegateType::State;
QTest::newRow("message 2") << 2 << DelegateType::Message;
QTest::newRow("reaction") << 3 << DelegateType::Other;
QTest::newRow("video") << 4 << DelegateType::Video;
QTest::newRow("location") << 7 << DelegateType::Location;
}
void EventHandlerTest::delegateType()
{
QFETCH(int, eventNum);
QFETCH(DelegateType::Type, delegateType);
eventHandler.setEvent(room->messageEvents().at(eventNum).get());
QCOMPARE(eventHandler.getDelegateType(), delegateType);
}
void EventHandlerTest::nullDelegateType()
{
QTest::ignoreMessage(QtWarningMsg, "getDelegateType called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getDelegateType(), DelegateType::Other);
}
void EventHandlerTest::author()
{
auto event = room->messageEvents().at(0).get();
auto author = room->user(event->senderId());
eventHandler.setEvent(event);
EventHandler eventHandler(room, event);
auto eventHandlerAuthor = eventHandler.getAuthor();
QCOMPARE(eventHandlerAuthor["isLocalUser"_ls], author->id() == room->localUser()->id());
QCOMPARE(eventHandlerAuthor["isLocalUser"_ls], author->id() == room->localMember().id());
QCOMPARE(eventHandlerAuthor["id"_ls], author->id());
QCOMPARE(eventHandlerAuthor["displayName"_ls], author->displayname(room));
QCOMPARE(eventHandlerAuthor["avatarSource"_ls], room->avatarForMember(author));
@@ -166,15 +119,14 @@ void EventHandlerTest::nullAuthor()
QTest::ignoreMessage(QtWarningMsg, "getAuthor called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getAuthor(), QVariantMap());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getAuthor called with m_event set to nullptr. Returning empty user.");
QCOMPARE(noEventHandler.getAuthor(), room->getUser(nullptr));
}
void EventHandlerTest::authorDisplayName()
{
auto event = room->messageEvents().at(1).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(1).get());
QCOMPARE(eventHandler.getAuthorDisplayName(), QStringLiteral("before"));
}
@@ -183,15 +135,14 @@ void EventHandlerTest::nullAuthorDisplayName()
QTest::ignoreMessage(QtWarningMsg, "getAuthorDisplayName called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getAuthorDisplayName(), QString());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getAuthorDisplayName called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getAuthorDisplayName(), QString());
}
void EventHandlerTest::singleLineSidplayName()
{
auto event = room->messageEvents().at(11).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(11).get());
QCOMPARE(eventHandler.singleLineAuthorDisplayname(), QStringLiteral("Look at me I put newlines in my display name"));
}
@@ -200,14 +151,14 @@ void EventHandlerTest::nullSingleLineDisplayName()
QTest::ignoreMessage(QtWarningMsg, "getAuthorDisplayName called with m_room set to nullptr.");
QCOMPARE(emptyHandler.singleLineAuthorDisplayname(), QString());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getAuthorDisplayName called with m_event set to nullptr.");
QCOMPARE(noEventHandler.singleLineAuthorDisplayname(), QString());
}
void EventHandlerTest::time()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.getTime(), QDateTime::fromMSecsSinceEpoch(1432735824654, Qt::UTC));
QCOMPARE(eventHandler.getTime(true, QDateTime::fromMSecsSinceEpoch(1234, Qt::UTC)), QDateTime::fromMSecsSinceEpoch(1234, Qt::UTC));
@@ -215,18 +166,18 @@ void EventHandlerTest::time()
void EventHandlerTest::nullTime()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getTime called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getTime(), QDateTime());
eventHandler.setEvent(room->messageEvents().at(0).get());
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QTest::ignoreMessage(QtWarningMsg, "a value must be provided for lastUpdated for a pending event.");
QCOMPARE(eventHandler.getTime(true), QDateTime());
}
void EventHandlerTest::timeString()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(0).get());
KFormat format;
@@ -246,25 +197,22 @@ void EventHandlerTest::timeString()
void EventHandlerTest::nullTimeString()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getTimeString called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getTimeString(false), QString());
eventHandler.setEvent(room->messageEvents().at(0).get());
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QTest::ignoreMessage(QtWarningMsg, "a value must be provided for lastUpdated for a pending event.");
QCOMPARE(eventHandler.getTimeString(false, QLocale::ShortFormat, true), QString());
}
void EventHandlerTest::highlighted()
{
auto event = room->messageEvents().at(2).get();
eventHandler.setEvent(event);
EventHandler eventHandlerHighlight(room, room->messageEvents().at(2).get());
QCOMPARE(eventHandlerHighlight.isHighlighted(), true);
QCOMPARE(eventHandler.isHighlighted(), true);
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.isHighlighted(), false);
EventHandler eventHandlerNoHighlight(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoHighlight.isHighlighted(), false);
}
void EventHandlerTest::nullHighlighted()
@@ -272,21 +220,18 @@ void EventHandlerTest::nullHighlighted()
QTest::ignoreMessage(QtWarningMsg, "isHighlighted called with m_room set to nullptr.");
QCOMPARE(emptyHandler.isHighlighted(), false);
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "isHighlighted called with m_event set to nullptr.");
QCOMPARE(noEventHandler.isHighlighted(), false);
}
void EventHandlerTest::hidden()
{
auto event = room->messageEvents().at(3).get();
eventHandler.setEvent(event);
EventHandler eventHandlerHidden(room, room->messageEvents().at(3).get());
QCOMPARE(eventHandlerHidden.isHidden(), true);
QCOMPARE(eventHandler.isHidden(), true);
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.isHidden(), false);
EventHandler eventHandlerNoHidden(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoHidden.isHidden(), false);
}
void EventHandlerTest::nullHidden()
@@ -294,14 +239,14 @@ void EventHandlerTest::nullHidden()
QTest::ignoreMessage(QtWarningMsg, "isHidden called with m_room set to nullptr.");
QCOMPARE(emptyHandler.isHidden(), false);
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "isHidden called with m_event set to nullptr.");
QCOMPARE(noEventHandler.isHidden(), false);
}
void EventHandlerTest::body()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.getRichBody(), QStringLiteral("<b>This is an example<br>text message</b>"));
QCOMPARE(eventHandler.getRichBody(true), QStringLiteral("<b>This is an example text message</b>"));
@@ -311,6 +256,8 @@ void EventHandlerTest::body()
void EventHandlerTest::nullBody()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getRichBody called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getRichBody(), QString());
@@ -335,32 +282,37 @@ void EventHandlerTest::genericBody()
QFETCH(int, eventNum);
QFETCH(QString, output);
eventHandler.setEvent(room->messageEvents().at(eventNum).get());
EventHandler eventHandler(room, room->messageEvents().at(eventNum).get());
QCOMPARE(eventHandler.getGenericBody(), output);
}
void EventHandlerTest::nullGenericBody()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getGenericBody called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getGenericBody(), QString());
}
void EventHandlerTest::markdownBody()
{
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.getMarkdownBody(), QStringLiteral("This is an example\ntext message"));
}
void EventHandlerTest::subtitle()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.subtitleText(), QStringLiteral("after: This is an example text message"));
event = room->messageEvents().at(2).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.subtitleText(), QStringLiteral("after: This is a highlight @bob:kde.org and this is a link https://kde.org"));
EventHandler eventHandler2(room, room->messageEvents().at(2).get());
QCOMPARE(eventHandler2.subtitleText(), QStringLiteral("after: This is a highlight @bob:kde.org and this is a link https://kde.org"));
}
void EventHandlerTest::nullSubtitle()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "subtitleText called with m_event set to nullptr.");
QCOMPARE(noEventHandler.subtitleText(), QString());
}
@@ -368,7 +320,7 @@ void EventHandlerTest::nullSubtitle()
void EventHandlerTest::mediaInfo()
{
auto event = room->messageEvents().at(4).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, event);
auto mediaInfo = eventHandler.getMediaInfo();
auto thumbnailInfo = mediaInfo["tempInfo"_ls].toMap();
@@ -393,80 +345,52 @@ void EventHandlerTest::nullMediaInfo()
QTest::ignoreMessage(QtWarningMsg, "getMediaInfo called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getMediaInfo(), QVariantMap());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getMediaInfo called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getMediaInfo(), QVariantMap());
}
void EventHandlerTest::hasReply()
{
auto event = room->messageEvents().at(5).get();
eventHandler.setEvent(event);
EventHandler eventHandlerReply(room, room->messageEvents().at(5).get());
QCOMPARE(eventHandlerReply.hasReply(), true);
QCOMPARE(eventHandler.hasReply(), true);
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.hasReply(), false);
EventHandler eventHandlerNoReply(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoReply.hasReply(), false);
}
void EventHandlerTest::nullHasReply()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "hasReply called with m_event set to nullptr.");
QCOMPARE(noEventHandler.hasReply(), false);
}
void EventHandlerTest::replyId()
{
auto event = room->messageEvents().at(5).get();
eventHandler.setEvent(event);
EventHandler eventHandlerReply(room, room->messageEvents().at(5).get());
QCOMPARE(eventHandlerReply.getReplyId(), QStringLiteral("$153456789:example.org"));
QCOMPARE(eventHandler.getReplyId(), QStringLiteral("$153456789:example.org"));
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.getReplyId(), QStringLiteral(""));
EventHandler eventHandlerNoReply(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoReply.getReplyId(), QStringLiteral(""));
}
void EventHandlerTest::nullReplyId()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getReplyId called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReplyId(), QString());
}
void EventHandlerTest::replyDelegateType()
{
auto event = room->messageEvents().at(5).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.getReplyDelegateType(), DelegateType::Message);
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.getReplyDelegateType(), DelegateType::Other);
}
void EventHandlerTest::nullReplyDelegateType()
{
QTest::ignoreMessage(QtWarningMsg, "getReplyDelegateType called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReplyDelegateType(), DelegateType::Other);
QTest::ignoreMessage(QtWarningMsg, "getReplyDelegateType called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReplyDelegateType(), DelegateType::Other);
}
void EventHandlerTest::replyAuthor()
{
auto event = room->messageEvents().at(5).get();
auto replyEvent = room->messageEvents().at(0).get();
auto replyAuthor = room->user(replyEvent->senderId());
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(5).get());
auto eventHandlerReplyAuthor = eventHandler.getReplyAuthor();
QCOMPARE(eventHandlerReplyAuthor["isLocalUser"_ls], replyAuthor->id() == room->localUser()->id());
QCOMPARE(eventHandlerReplyAuthor["isLocalUser"_ls], replyAuthor->id() == room->localMember().id());
QCOMPARE(eventHandlerReplyAuthor["id"_ls], replyAuthor->id());
QCOMPARE(eventHandlerReplyAuthor["displayName"_ls], replyAuthor->displayname(room));
QCOMPARE(eventHandlerReplyAuthor["avatarSource"_ls], room->avatarForMember(replyAuthor));
@@ -474,10 +398,8 @@ void EventHandlerTest::replyAuthor()
QCOMPARE(eventHandlerReplyAuthor["color"_ls], Utils::getUserColor(replyAuthor->hueF()));
QCOMPARE(eventHandlerReplyAuthor["object"_ls], QVariant::fromValue(replyAuthor));
event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.getReplyAuthor(), room->getUser(nullptr));
EventHandler eventHandlerNoAuthor(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoAuthor.getReplyAuthor(), room->getUser(nullptr));
}
void EventHandlerTest::nullReplyAuthor()
@@ -485,14 +407,14 @@ void EventHandlerTest::nullReplyAuthor()
QTest::ignoreMessage(QtWarningMsg, "getReplyAuthor called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReplyAuthor(), QVariantMap());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getReplyAuthor called with m_event set to nullptr. Returning empty user.");
QCOMPARE(noEventHandler.getReplyAuthor(), room->getUser(nullptr));
}
void EventHandlerTest::replyBody()
{
auto event = room->messageEvents().at(5).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(5).get());
QCOMPARE(eventHandler.getReplyRichBody(), QStringLiteral("<b>This is an example<br>text message</b>"));
QCOMPARE(eventHandler.getReplyRichBody(true), QStringLiteral("<b>This is an example text message</b>"));
@@ -502,6 +424,8 @@ void EventHandlerTest::replyBody()
void EventHandlerTest::nullReplyBody()
{
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getReplyRichBody called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReplyRichBody(), QString());
@@ -513,7 +437,7 @@ void EventHandlerTest::replyMediaInfo()
{
auto event = room->messageEvents().at(6).get();
auto replyEvent = room->messageEvents().at(4).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, event);
auto mediaInfo = eventHandler.getReplyMediaInfo();
auto thumbnailInfo = mediaInfo["tempInfo"_ls].toMap();
@@ -538,31 +462,26 @@ void EventHandlerTest::nullReplyMediaInfo()
QTest::ignoreMessage(QtWarningMsg, "getReplyMediaInfo called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReplyMediaInfo(), QVariantMap());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getReplyMediaInfo called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReplyMediaInfo(), QVariantMap());
}
void EventHandlerTest::thread()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandlerNoThread(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoThread.isThreaded(), false);
QCOMPARE(eventHandlerNoThread.threadRoot(), QString());
QCOMPARE(eventHandler.isThreaded(), false);
QCOMPARE(eventHandler.threadRoot(), QString());
EventHandler eventHandlerThreadRoot(room, room->messageEvents().at(9).get());
QCOMPARE(eventHandlerThreadRoot.isThreaded(), true);
QCOMPARE(eventHandlerThreadRoot.threadRoot(), QStringLiteral("$threadroot:example.org"));
QCOMPARE(eventHandlerThreadRoot.getReplyId(), QStringLiteral("$threadroot:example.org"));
event = room->messageEvents().at(9).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.isThreaded(), true);
QCOMPARE(eventHandler.threadRoot(), QStringLiteral("$threadroot:example.org"));
QCOMPARE(eventHandler.getReplyId(), QStringLiteral("$threadroot:example.org"));
event = room->messageEvents().at(10).get();
eventHandler.setEvent(event);
QCOMPARE(eventHandler.isThreaded(), true);
QCOMPARE(eventHandler.threadRoot(), QStringLiteral("$threadroot:example.org"));
QCOMPARE(eventHandler.getReplyId(), QStringLiteral("$threadmessage1:example.org"));
EventHandler eventHandlerThreadReply(room, room->messageEvents().at(10).get());
QCOMPARE(eventHandlerThreadReply.isThreaded(), true);
QCOMPARE(eventHandlerThreadReply.threadRoot(), QStringLiteral("$threadroot:example.org"));
QCOMPARE(eventHandlerThreadReply.getReplyId(), QStringLiteral("$threadmessage1:example.org"));
}
void EventHandlerTest::nullThread()
@@ -570,14 +489,14 @@ void EventHandlerTest::nullThread()
QTest::ignoreMessage(QtWarningMsg, "isThreaded called with m_event set to nullptr.");
QCOMPARE(emptyHandler.isThreaded(), false);
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "threadRoot called with m_event set to nullptr.");
QCOMPARE(noEventHandler.threadRoot(), QString());
}
void EventHandlerTest::location()
{
auto event = room->messageEvents().at(7).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(7).get());
QCOMPARE(eventHandler.getLatitude(), QStringLiteral("51.7035").toFloat());
QCOMPARE(eventHandler.getLongitude(), QStringLiteral("-1.14394").toFloat());
@@ -598,9 +517,7 @@ void EventHandlerTest::nullLocation()
void EventHandlerTest::readMarkers()
{
auto event = room->messageEvents().at(0).get();
eventHandler.setEvent(event);
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.hasReadMarkers(), true);
auto readMarkers = eventHandler.getReadMarkers();
@@ -611,18 +528,16 @@ void EventHandlerTest::readMarkers()
QCOMPARE(eventHandler.getNumberExcessReadMarkers(), QString());
QCOMPARE(eventHandler.getReadMarkersString(), QStringLiteral("1 user: @alice:matrix.org"));
event = room->messageEvents().at(2).get();
eventHandler.setEvent(event);
EventHandler eventHandler2(room, room->messageEvents().at(2).get());
QCOMPARE(eventHandler2.hasReadMarkers(), true);
QCOMPARE(eventHandler.hasReadMarkers(), true);
readMarkers = eventHandler.getReadMarkers();
readMarkers = eventHandler2.getReadMarkers();
QCOMPARE(readMarkers.size(), 5);
QCOMPARE(eventHandler.getNumberExcessReadMarkers(), QStringLiteral("+ 1"));
QCOMPARE(eventHandler2.getNumberExcessReadMarkers(), QStringLiteral("+ 1"));
// There are no guarantees on the order of the users it will be different every time so don't match the whole string.
QCOMPARE(eventHandler.getReadMarkersString().startsWith(QStringLiteral("6 users:")), true);
QCOMPARE(eventHandler2.getReadMarkersString().startsWith(QStringLiteral("6 users:")), true);
}
void EventHandlerTest::nullReadMarkers()
@@ -639,6 +554,8 @@ void EventHandlerTest::nullReadMarkers()
QTest::ignoreMessage(QtWarningMsg, "getReadMarkersString called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReadMarkersString(), QString());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "hasReadMarkers called with m_event set to nullptr.");
QCOMPARE(noEventHandler.hasReadMarkers(), false);
@@ -652,10 +569,5 @@ void EventHandlerTest::nullReadMarkers()
QCOMPARE(noEventHandler.getReadMarkersString(), QString());
}
void EventHandlerTest::cleanup()
{
eventHandler.setEvent(nullptr);
}
QTEST_MAIN(EventHandlerTest)
#include "eventhandlertest.moc"

View File

@@ -32,8 +32,6 @@ private Q_SLOTS:
void linkPreviewsReject_data();
void linkPreviewsReject();
void editedLink();
};
void LinkPreviewerTest::initTestCase()
@@ -59,7 +57,7 @@ void LinkPreviewerTest::linkPreviewsMatch()
QFETCH(QUrl, testOutputLink);
auto event = TestUtils::loadEventFromFile<RoomMessageEvent>(eventSource);
auto linkPreviewer = LinkPreviewer(room, event.get());
auto linkPreviewer = LinkPreviewer(LinkPreviewer::linkPreview(event.get()), connection);
QCOMPARE(linkPreviewer.empty(), false);
QCOMPARE(linkPreviewer.url(), testOutputLink);
@@ -79,22 +77,7 @@ void LinkPreviewerTest::linkPreviewsReject()
QFETCH(QString, eventSource);
auto event = TestUtils::loadEventFromFile<RoomMessageEvent>(eventSource);
auto linkPreviewer = LinkPreviewer(room, event.get());
QCOMPARE(linkPreviewer.empty(), true);
QCOMPARE(linkPreviewer.url(), QUrl());
}
void LinkPreviewerTest::editedLink()
{
room->syncNewEvents(QStringLiteral("test-linkpreviewerintial-sync.json"));
auto event = eventCast<const RoomMessageEvent>(room->messageEvents().at(0).get());
auto linkPreviewer = LinkPreviewer(room, event);
QCOMPARE(linkPreviewer.empty(), false);
QCOMPARE(linkPreviewer.url(), QUrl("https://kde.org"_ls));
room->syncNewEvents(QStringLiteral("test-linkpreviewerreplace-sync.json"));
auto linkPreviewer = LinkPreviewer(LinkPreviewer::linkPreview(event.get()), connection);
QCOMPARE(linkPreviewer.empty(), true);
QCOMPARE(linkPreviewer.url(), QUrl());

View File

@@ -103,7 +103,6 @@ void MessageEventModelTest::simpleTimeline()
QCOMPARE(model->data(model->index(1)), QStringLiteral("<b>This is an example<br>text message</b>"));
QCOMPARE(model->data(model->index(1), MessageEventModel::DelegateTypeRole), DelegateType::Message);
QCOMPARE(model->data(model->index(1), MessageEventModel::PlainText), QStringLiteral("This is an example\ntext message"));
QCOMPARE(model->data(model->index(1), MessageEventModel::EventIdRole), QStringLiteral("$153456789:example.org"));
QTest::ignoreMessage(QtWarningMsg, "Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)");

View File

@@ -10,7 +10,9 @@
#include <Quotient/syncdata.h>
#include <qnamespace.h>
#include "enums/messagecomponenttype.h"
#include "models/customemojimodel.h"
#include "models/messagecontentmodel.h"
#include "neochatconnection.h"
#include "utils.h"
@@ -33,7 +35,6 @@ private Q_SLOTS:
void stripDisallowedTags();
void stripDisallowedAttributes();
void emptyCodeTags();
void formatBlockQuote();
void sendSimpleStringCase();
void sendSingleParaMarkup();
@@ -59,11 +60,13 @@ private Q_SLOTS:
void receiveRichtextIn();
void receiveRichMxcUrl();
void receiveRichPlainUrl();
void receiveRichEmote();
void receiveRichEdited_data();
void receiveRichEdited();
void receiveLineSeparator();
void receiveRichCodeUrl();
void componentOutput_data();
void componentOutput();
};
void TextHandlerTest::initTestCase()
@@ -139,16 +142,6 @@ void TextHandlerTest::emptyCodeTags()
QCOMPARE(testTextHandler.handleRecieveRichText(), testOutputString);
}
void TextHandlerTest::formatBlockQuote()
{
auto input = QStringLiteral("<blockquote>\n<p>Lorem Ispum</p>\n</blockquote>");
auto expectedOutput = QStringLiteral("<blockquote><table><tr><td>\u201CLorem Ispum\u201D</td></tr></table></blockquote>");
TextHandler testTextHandler;
testTextHandler.setData(input);
QCOMPARE(testTextHandler.handleRecieveRichText(), expectedOutput);
}
void TextHandlerTest::sendSimpleStringCase()
{
const QString testInputString = QStringLiteral("This data should just be put in a paragraph.");
@@ -470,22 +463,6 @@ void TextHandlerTest::receiveRichPlainUrl()
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText), testOutputStringMxId);
}
// Test that user pill is add to an emote message.
// N.B. The second message in the test timeline is marked as an emote.
void TextHandlerTest::receiveRichEmote()
{
auto event = room->messageEvents().at(1).get();
auto author = room->user(event->senderId());
const QString testInputString = QStringLiteral("This is an emote.");
const QString testOutputString = QStringLiteral("* <a href=\"https://matrix.to/#/@example:example.org\" style=\"color:")
+ Utils::getUserColor(author->hueF()).name() + QStringLiteral("\">@example:example.org</a> This is an emote.");
TextHandler testTextHandler;
testTextHandler.setData(testInputString);
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText, room, event), testOutputString);
}
void TextHandlerTest::receiveRichEdited_data()
{
QTest::addColumn<QString>("testInputString");
@@ -494,9 +471,6 @@ void TextHandlerTest::receiveRichEdited_data()
QTest::newRow("basic") << QStringLiteral("Edited") << QStringLiteral("Edited <span style=\"color:#000000\">(edited)</span>");
QTest::newRow("multiple paragraphs") << QStringLiteral("<p>Edited</p>\n<p>Edited</p>")
<< QStringLiteral("<p>Edited</p>\n<p>Edited <span style=\"color:#000000\">(edited)</span></p>");
QTest::newRow("blockquote")
<< QStringLiteral("<blockquote>Edited</blockquote>")
<< QStringLiteral("<blockquote><table><tr><td>\u201CEdited\u201D</td></tr></table></blockquote><p> <span style=\"color:#000000\">(edited)</span></p>");
}
void TextHandlerTest::receiveRichEdited()
@@ -507,7 +481,8 @@ void TextHandlerTest::receiveRichEdited()
TextHandler testTextHandler;
testTextHandler.setData(testInputString);
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText, room, room->messageEvents().at(2).get()), testOutputString);
const auto event = eventCast<const Quotient::RoomMessageEvent>(room->messageEvents().at(2).get());
QCOMPARE(testTextHandler.handleRecieveRichText(Qt::RichText, room, event, false, event->isReplaced()), testOutputString);
}
void TextHandlerTest::receiveLineSeparator()
@@ -526,5 +501,57 @@ void TextHandlerTest::receiveRichCodeUrl()
QCOMPARE(testTextHandler.handleRecieveRichText(), input);
}
void TextHandlerTest::componentOutput_data()
{
QTest::addColumn<QString>("testInputString");
QTest::addColumn<QList<MessageComponent>>("testOutputComponents");
QTest::newRow("multiple paragraphs") << QStringLiteral("<p>Text</p>\n<p>Text</p>")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
QTest::newRow("code") << QStringLiteral("<p>Text</p>\n<pre><code class=\"language-html\">Some code\n</code></pre>")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
MessageComponent{MessageComponentType::Code,
QStringLiteral("Some code"),
QVariantMap{{QStringLiteral("class"), QStringLiteral("html")}}}};
QTest::newRow("quote") << QStringLiteral("<p>Text</p>\n<blockquote>\n<p>blockquote</p>\n</blockquote>")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
MessageComponent{MessageComponentType::Quote, QStringLiteral("\"blockquote\""), {}}};
QTest::newRow("no tag first paragraph") << QStringLiteral("Text\n<p>Text</p>")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
QTest::newRow("no tag last paragraph") << QStringLiteral("<p>Text</p>\nText")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}},
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
QTest::newRow("inline code") << QStringLiteral("<p><code>https://kde.org</code></p>\n<p>Text</p>")
<< QList<MessageComponent>{MessageComponent{MessageComponentType::Text, QStringLiteral("<code>https://kde.org</code>"), {}},
MessageComponent{MessageComponentType::Text, QStringLiteral("Text"), {}}};
QTest::newRow("inline code single block") << QStringLiteral("<code>https://kde.org</code>")
<< QList<MessageComponent>{
MessageComponent{MessageComponentType::Text, QStringLiteral("<code>https://kde.org</code>"), {}}};
QTest::newRow("long start tag")
<< QStringLiteral(
"Ah, you mean something like<br/><pre data-md=\"```\"><code class=\"language-qml\"># main.qml\nimport CustomQml\n...\nControls.TextField { id: "
"someField }\nCustomQml {\n someTextProperty: someField.text\n}\n</code></pre>Sure you can, it's still local to the same file where you "
"defined the id")
<< QList<MessageComponent>{
MessageComponent{MessageComponentType::Text, QStringLiteral("Ah, you mean something like"), {}},
MessageComponent{
MessageComponentType::Code,
QStringLiteral(
"# main.qml\nimport CustomQml\n...\nControls.TextField { id: someField }\nCustomQml {\n someTextProperty: someField.text\n}"),
QVariantMap{{QStringLiteral("class"), QStringLiteral("qml")}}},
MessageComponent{MessageComponentType::Text, QStringLiteral("Sure you can, it's still local to the same file where you defined the id"), {}}};
}
void TextHandlerTest::componentOutput()
{
QFETCH(QString, testInputString);
QFETCH(QList<MessageComponent>, testOutputComponents);
TextHandler testTextHandler;
QCOMPARE(testTextHandler.textComponents(testInputString), testOutputComponents);
}
QTEST_MAIN(TextHandlerTest)
#include "texthandlertest.moc"

View File

@@ -32,6 +32,7 @@
<name xml:lang="it">NeoChat</name>
<name xml:lang="ka">NeoChat</name>
<name xml:lang="ko">NeoChat</name>
<name xml:lang="lv">NeoChat</name>
<name xml:lang="nl">NeoChat</name>
<name xml:lang="nn">NeoChat</name>
<name xml:lang="pa">ਨਿਓ-ਚੈਟ</name>
@@ -59,48 +60,43 @@
<summary xml:lang="fi">Keskustelu ystäviesi kanssa Matrixissa</summary>
<summary xml:lang="fr">Discuter avec vos ami(e)s sur le réseau Matrix</summary>
<summary xml:lang="gl">Charle coas súas amizades en Matrix.</summary>
<summary xml:lang="ia">Starta Conversation conntu amicos sur matrix</summary>
<summary xml:lang="hu">Csevegjen barátaival a matrixon</summary>
<summary xml:lang="ia">Starta Conversation con tu amicos sur matrix</summary>
<summary xml:lang="it">Conversa con i tuoi contatti su matrix</summary>
<summary xml:lang="ka">ესაუბრეთ მეგობრებს Matrix-ზე</summary>
<summary xml:lang="ko">Matrix를 사용하여 친구들과 대화하기</summary>
<summary xml:lang="lv">Tērzējiet ar saviem draugiem „Matrix“ tīklā</summary>
<summary xml:lang="nl">Met uw vrienden chatten op matrix</summary>
<summary xml:lang="nn">Prat med vennar på Matrix</summary>
<summary xml:lang="pl">Rozmawiaj ze swoimi znajomymi w Matriksie</summary>
<summary xml:lang="sl">Klepet z vašimi prijatelji na matrixu</summary>
<summary xml:lang="sv">Chatta med dina vänner på Matrix</summary>
<summary xml:lang="ta">மேட்ரிக்ஸு மூலம் உங்கள் நண்பர்களிடம் பேசலாம்</summary>
<summary xml:lang="tr">Matrix'te arkadaşlarınızla sohbet edin</summary>
<summary xml:lang="tr">Matrixte arkadaşlarınızla sohbet edin</summary>
<summary xml:lang="uk">Спілкуйтеся з вашими друзями у matrix</summary>
<summary xml:lang="x-test">xxChat with your friends on matrixxx</summary>
<summary xml:lang="zh-CN">在 Matrix 上与朋友聊天</summary>
<summary xml:lang="zh-TW">在 Matrix 上與您的朋友聊天</summary>
<description>
<p>NeoChat is a client for Matrix, the decentralized communication protocol for instant messaging. It allows you to send text messages, videos and audio files to your family, colleagues and friends. It uses KDE frameworks and most notably Kirigami
to provide a convergent experience across multiple platforms.</p>
<p xml:lang="ar">نيوتشات هو عميل ماتركس Matrix، (ميفاق الاتصال اللامركزي للمراسلة الفورية). يتيح لك نيوتشات إرسال رسائل نصية ومقاطع فيديو وملفات صوتية إلى عائلتك وزملائك وأصدقائك. يستخدم أطر عمل كيدي وأبرزها Kirigami لتوفير تجربة متقاربة عبر منصات متعددة.</p>
<p xml:lang="ca">El NeoChat és un client de Matrix, el protocol descentralitzat de comunicacions de missatgeria instantània. Permet enviar missatges de text, fitxers de vídeo i d'àudio a la família, col·legues i amics. Fa servir els Frameworks de KDE i, sobretot, el Kirigami per a proporcionar una experiència convergent a través de diverses plataformes.</p>
<p xml:lang="ca-valencia">NeoChat és un client de Matrix, el protocol descentralitzat de comunicacions de missatgeria instantània. Permet enviar missatges de text, fitxers de vídeo i d'àudio a la família, col·legues i amics. Utilitza els Frameworks de KDE i, sobretot, Kirigami per a proporcionar una experiència convergent a través de diverses plataformes.</p>
<p xml:lang="en-GB">NeoChat is a client for Matrix, the decentralised communication protocol for instant messaging. It allows you to send text messages, videos and audio files to your family, colleagues and friends. It uses KDE frameworks and most notably Kirigami to provide a convergent experience across multiple platforms.</p>
<p xml:lang="eo">NeoChat estas kliento por Matrix, la malcentra komunikoprotokolo por tuja mesaĝado. Ĝi ebligas al vi sendi tekstmesaĝojn, filmetojn kaj sondosierojn al via familio, kolegoj kaj amikoj. Ĝi uzas KDE-framojn kaj precipe Kirigami por disponigi konverĝan sperton tra pluraj platformoj.</p>
<p xml:lang="es">NeoChat es un cliente para Matrix, el protocolo de comunicaciones descentralizado para mensajería instantánea. Le permite enviar mensajes de texto, vídeos y archivos de sonido a su familia, compañeros de trabajo y amigos. Usa la infraestructura de KDE y, en particular, Kirigami para proporcionar una experiencia convergente en muchas plataformas.</p>
<p xml:lang="eu">NeoChat «Matrix»erako, bat-bateko mezularitzarako komunikazio deszentralizatuko protokolorako, bezero bat da. Zure sendiari, kide eta lagunei testu mezuak, bideo eta audio fitxategiak bidaltzeko aukera ematen dizu. «KDE Frameworks» eta bereziki «Kirigami» erabiltzen ditu plataforma anitzen artean esperientzia konbergente bat eskaintzeko.</p>
<p xml:lang="fi">NeoChat on asiakassovellus Matrixille, hajautetulle pikaviestinyhteyskäytännölle. Sillä voi lähettää teksti-, video- ja ääniviestejä perheelle, tutuille ja ystäville. Se käyttää KDE-kehystä ja erityisesti Kirigamia tuottaakseen mukautuvan monialustaisen käyttökokemuksen.</p>
<p xml:lang="fr">NeoChat est un client pour le protocole Matrix, un protocole décentralisé de communications pour messagerie instantané. Il vous permet d'envoyer des messages de texte, des vidéos et des fichiers audio à votre famille, vos collègues et vos amis. Il utilise les environnements de développement et plus précisément Kirigami pour fournir une expérience convergente sur plusieurs plate-formes. </p>
<p xml:lang="gl">NeoChat é un cliente para Matrix, o protocolo de comunicación descentralizada para mensaxaría instantánea. Podes enviar mensaxes de texto, vídeos e ficheiros de son á túa familia, colegas e amizades. Usas infraestruturas de KDE e principalmente Kirigami para proporcionar unha experiencia de uso converxente para varias plataformas.</p>
<p xml:lang="ia">NeoChat es un cliente per Matrix, le protocollo de communication decentralisate per messager instantanee. Illo te permitte inviar messager de texto, files de video e audio a tu familia, collegas e amicos usante. Illo usa KDE frameworks e super toto Kirigamii forni un experientia convergente trans platteforme multiple.</p>
<p xml:lang="it">NeoChat è un client per Matrix, il protocollo di comunicazione decentralizzato per la messaggistica istantanea. Ti consente di inviare messaggi di testo, video e file audio a familiari, colleghi e amici. Utilizza i framework KDE e in particolare Kirigami per fornire un'esperienza convergente su più piattaforme.</p>
<p xml:lang="ka">NeoChat არის Matrix კლიენტი. ის საშუალებას გაძლევთ გაგზავნოთ ტექსტური შეტყობინებები, ვიდეოები და აუდიო ფაილები თქვენს ოჯახს, კოლეგებსა და მეგობრებს მატრიქსის პროტოკოლის გამოყენებით.</p>
<p xml:lang="ko">NeoChat은 분산형 인스턴트 메시징 통신 프로토콜인 Matrix 클라이언트입니다. 가족, 동료, 친구에게 텍스트 메시지, 동영상, 오디오 파일을 전송할 수 있습니다. KDE 프레임워크와 Kirigami를 사용하여 다양한 플랫폼에서 일관적인 사용자 경험을 제공합니다.</p>
<p xml:lang="nl">NeoChat is een client voor Matrix, het gedecentraliseerde communicatieprotocol voor instant messages. Het biedt u het verzenden van tekstberichten, video's en geluidsbestanden naar uw familie, collega's en vrienden. Het gebruik KDE frameworks en het meest opmerkelijk Kirigami om een convergente ervaring te leveren op meerdere platforms.</p>
<p xml:lang="nn">NeoChat er ein klient for Matrix, ein protokoll for desentralisert kommunikasjon. Du kan utveksla tekst, lyd og videoar med kollegaar, vennar og familie. Programmet brukar KDE Frameworks og Kirigami for å gje ei brukarflate tilpassa ulike plattformer.</p>
<p xml:lang="pl">NeoChat jest programem do Matriksa, protokołu rozproszonego porozumiewania się w czasie rzeczywistym. Umożliwia wysyłanie wiadomości tekstowych, filmów oraz dźwięku do twojej rodziny, znajomych oraz przyjaciół. Używa szkieletów KDE i głównie Kirigami, aby zapewnić spójne wrażenia na wielu platformach</p>
<p xml:lang="pt">O NeoChat é um cliente do Matrix. O mesmo permite-lhe enviar mensagens de texto, ficheiros de vídeo e áudio para a sua família, colegas e amigos com o protocolo Matrix. Usa as plataformas do KDE, e principalmente o Kirigami, para oferecer uma experiência convergente entre várias plataformas.</p>
<p xml:lang="sl">Neochat je odjemalec za Matrix, decentralizirani komunikacijski protokol za takojšnje sporočanje. Omogoča vam pošiljanje besedilnih sporočil, videoposnetkov in zvočnih datotek svoji družini, sodelavcem in prijateljem. Uporablja okvire ogrodje KDE frameworks in predvsem Kirigami za zagotavljanje konvergentne izkušnje na več platformah.</p>
<p xml:lang="sv">NeoChat är en klient för Matrix, det decentraliserade kommunikationsprotokollet för direktmeddelanden. Den låter dig skicka textmeddelanden, videor och ljudfiler till din familj, kollegor och vänner. Den använder KDE Ramverk, i synnerhet Kirigami, för att tillhandahålla en konvergent upplevelse på flera plattformar.</p>
<p xml:lang="tr">NeoChat, anlık iletileşme için merkezi olmayan iletişim protokolü olan Matrix için bir istemcidir. Ailenize, iş arkadaşlarınıza ve arkadaşlarınıza metin iletiler, videolar ve ses dosyaları göndermenize olanak tanır. Birden çok platformda yakınsak bir deneyim sağlamak için KDE Frameworks ve en önemlilerinden Kirigami'yi kullanır.</p>
<p xml:lang="uk">NeoChat — клієнт Matrix, децентралізованого протоколу спілкування для миттєвого обміну повідомленнями. За його допомогою ви можете надсилати текстові повідомлення, відео та звукові файли вашій родин, колегами та друзям. У програмі використано бібліотеки KDE, зокрема Kirigami, для надання однорідного середовища на декількох програмних та апаратних платформах.</p>
<p xml:lang="x-test">xxNeoChat is a client for Matrix, the decentralized communication protocol for instant messaging. It allows you to send text messages, videos and audio files to your family, colleagues and friends. It uses KDE frameworks and most notably Kirigami to provide a convergent experience across multiple platforms.xx</p>
<p xml:lang="zh-TW">NeoChat 是去中心化即時通訊協定 Matrix 的一個用戶端。它讓您可以傳送文字訊息、影片、音訊檔案給您的家人、同事或朋友。NeoChat 使用 KDE frameworks尤其是 Kirigami來提供跨平台的響應式體驗。</p>
<p>NeoChat is a chat app that lets you take full advantage of the Matrix network. It provides you with a secure way to send text messages, videos and audio files to your family, colleagues and friends.</p>
<p xml:lang="ca">El NeoChat és una aplicació de xat que us permet aprofitar plenament la xarxa Matrix. Proporciona una manera segura d'enviar missatges de text, vídeos i arxius d'àudio a la vostra família, companys i amics.</p>
<p xml:lang="ca-valencia">NeoChat és una aplicació de xat que us permet aprofitar plenament la xarxa Matrix. Proporciona una manera segura d'enviar missatges de text, vídeos i arxius d'àudio a la vostra família, companys i amics.</p>
<p xml:lang="eo">NeoChat estas babilej-apo, kiu ebligas al vi plene profiti de la Matrix-reto. Ĝi provizas al vi sekuran manieron sendi tekstmesaĝojn, filmetojn kaj sondosierojn al via familio, kolegoj kaj amikoj.</p>
<p xml:lang="es">NeoChat es una aplicación de chat que le permite aprovechar al máximo la red Matrix. Le proporciona un modo seguro de enviar mensajes de texto, vídeos y archivos de sonido a su familia, colegas y amigos.</p>
<p xml:lang="eu">NeoChat, Matrix sarearen abantaila guztiei probetsua ateratzeko aukera ematen dizun berriketa aplikaizo bat da. Zure familiari, kideei eta lagunei testu mezuak, bideoak eta audio fitxategiak era seguruan bidaltzeko aukera ematen dizu.</p>
<p xml:lang="fr">NeoChat est une application de discussions vous permettant de profiter pleinement du réseau Matrix. Elle vous offre un moyen sécurisé denvoyer des messages de texte, des vidéos et des fichiers audio à votre famille, vos collègues et vos ami(e)s.</p>
<p xml:lang="hu">A NeoChat egy olyan csevegőalkalmazás, amellyel teljes mértékben kihasználhatja a Matrix hálózatot. Biztonságos módot biztosít szöveges üzenetek, videók és hangfájlok küldéséhez családtagjainak, kollégáinak és barátainak.</p>
<p xml:lang="ia">NeoChat es un app de conversation que te permitte prender avantage plen del rete Matrix. Il te forni un modo secur de inviar messages de texto, videos e files audio a tui familia, collegas e amicos.</p>
<p xml:lang="it">NeoChat è un'applicazione di chat che ti consente di sfruttare appieno la rete Matrix. Ti fornisce un modo sicuro per inviare messaggi di testo, video e file audio a familiari, colleghi e amici.</p>
<p xml:lang="ka">NeoChat ჩატის აპია, რომელიც საშუალება გაძლევთ, Matrix-ის ქსელის საშუალებები ბოლომდე გამოიყენოთ. ის გაძლევთ უსაფრთხო გზას, გააგზავნოთ ტექსტური შეტყობინებები, ვიდეოებ და აუდიოფაილები თქვენს ოჯახთან, კოლეგებთან და მეგობრებთან.</p>
<p xml:lang="lv">NeoChat“ ir tērzēšanas programma, kas ļauj pilnvērtīgi izmantot „Matrix“ tīklu. Tā sniedz drošu veidu teksta ziņu, video un audio sūtīšanai ģimenes locekļiem, kolēģiem un draugiem.</p>
<p xml:lang="nl">NeoChat is een chat-toepassing die u het volledige voordeel van het Matrix-netwerk laat genieten. Het levert u op een veilige manier tekstberichten, video's en geluidsbestanden naar uw familie, collega's en vrienden te verzenden.</p>
<p xml:lang="pl">NoeChat to aplikacja do rozmów, która umożliwia wykorzystanie wszystkich możliwości Matriksa. Umożliwia wysyłanie wiadomości tekstowych, filmów i dźwięków w bezpieczny sposób do twojej rodziny, kolegów i przyjaciół.</p>
<p xml:lang="sl">NeoChat je aplikacija za klepet, ki vam omogoča, da v celoti izkoristite omrežje Matrix. Zagotavlja vam varen način za pošiljanje besedilnih sporočil, videoposnetkov in zvočnih datotek vaši družini, sodelavcem in prijateljem.</p>
<p xml:lang="tr">NeoChat, Matrix ağının tüm özelliklerini kullanan bir sohbet uygulamasıdır. Ailenize, arkadaşlarınıza ve iş arkadaşlarınıza metin iletileri, ses ve video dosyaları göndermenin kolay bir yolunu sunar.</p>
<p xml:lang="uk">NeoChat є програмою для спілкування, за допомогою якої ви можете скористатися усіма перевагами мережі Matrix. За її допомогою ви можете безпечно надсилати текстові повідомлення, відео та звукові файли вашим родичам, колегам та друзям.</p>
<p xml:lang="x-test">xxNeoChat is a chat app that lets you take full advantage of the Matrix network. It provides you with a secure way to send text messages, videos and audio files to your family, colleagues and friends.xx</p>
<p xml:lang="zh-TW">NeoChat 是一個讓您能夠完全利用 Matrix 網路的聊天應用程式。它讓您安全地傳送文字訊息、影片或音訊檔給家人、同事或朋友等等。</p>
<p>NeoChat aims to be a fully featured application for the Matrix specification. As such everything in the current stable specification with the notable exceptions of VoIP, threads and some aspects of End-to-End Encryption are supported. There are a few other smaller omissions due to the fact that the Matrix spec is constantly evolving but the aim remains to provide eventual support for the entire spec.</p>
<p xml:lang="ar">يهدف نيوتشات إلى أن يكون تطبيقًا كامل الميزات لمواصفات ماتركس. على هذا النحو يتم دعم كل شيء في المواصفات المستقرة الحالية مع الاستثناءات الملحوظة لـ VoIP والخيوط وبعض جوانب التشفير من طرف إلى طرف. هناك عدد قليل من الإغفالات الصغيرة الأخرى بسبب حقيقة أن مواصفات ماتركس تتطور باستمرار ، ولكن يبقى الهدف توفير الدعم النهائي للمواصفات بأكملها.</p>
<p xml:lang="ca">NeoChat pretén ser una aplicació amb totes les característiques per a l'especificació de Matrix. Com a tal, s'ha implementat tota l'especificació actual estable amb les notables excepcions de la VoIP, fils i alguns aspectes de l'encriptatge d'extrem a extrem. Hi ha algunes altres omissions més petites a causa del fet que l'especificació de Matrix està evolucionant constantment, però l'objectiu segueix sent proporcionar suport eventual per a tota l'especificació.</p>
@@ -112,17 +108,19 @@ to provide a convergent experience across multiple platforms.</p>
<p xml:lang="fi">NeoChat pyrkii olemaan Matrix-määritelmän täysominaisuuksinen sovellus, joten se tukee kaikkea nykyisessä vakaassa määritelmässä muutamaa huomattavaa poikkeusta lukuun ottamatta (VoIP, säikeet ja jotkin piirteet päästä päähän -salauksessa). Joitakin pienempiäkin puutteita on Matrix-määritelmän jatkuvan kehityksen vuoksi, mutta lopputavoitteena on tarjota määritelmän täysi tuki.</p>
<p xml:lang="fr">L'objectif de NeoChat est d'être une application complète pour le protocole Matrix. En tant que tel, tout dans la spécification stable actuelle avec les exceptions notables de VoIP, les processus et certains aspects du chiffrement de bout en bout sont pris en charge. Il y a quelques autres petites omissions en raison du fait que la spécification du protocole Matrix est en constante évolution. Cependant, l'objectif reste de fournir un soutien éventuel pour l'ensemble de la spécification.</p>
<p xml:lang="gl">NeoChat pretende ser unha aplicación completa para a especificación de Matrix. Coas excepcións de VoIP, conversas fiadas e algúns aspectos da cifraxe de extremo a extremo, a versión estábel segue as especificacións. Existen algunhas outras pequenas omisións debido ao feito de que Matrix está en continua evolución pero a intención é implementar a especificación completa.</p>
<p xml:lang="hu">A NeoChat célja, hogy a Matrix specifikációnak megfelelő teljes funkcionalitású alkalmazás legyen. Mint ilyen, a jelenlegi stabil specifikáció támogatott a VoIP, a szálak és a végpontok közötti titkosítás egyes elemeinek kivételével. Van még néhány kisebb hiányosság annak köszönhetően, hogy a Matrix specifikáció folyamatosan fejlődik, de végső cél a teljes specifikáció megvalósítása.</p>
<p xml:lang="ia">NeoChat aspira a esser un application plenemente eminente per le specification de Matrix. Tal como omne cosas in le specification currentemente stabile con le exceptiones notabile de VOIP, threads e alcun aspectos del cryptation End-to-End es supportate. Il ha ltere pauc omissiones, debite al facto que le specification de Matrix es in evolution constante ma le aspiration remane a fornir supporto eventual per le integre specification.</p>
<p xml:lang="it">NeoChat mira ad essere un'applicazione completa per le specifiche Matrix. Pertanto, sono supportati tutti gli elementi dell'attuale specifica stabile con le notevoli eccezioni di VoIP, conversazioni e alcuni aspetti della cifratura end-to-end. Ci sono alcune altre piccole omissioni dovute al fatto che le specifiche Matrix sono in continua evoluzione, ma l'obiettivo rimane quello di fornire un eventuale supporto per l'intera specifica.</p>
<p xml:lang="ka">NeoChat-ი მიზნად ისახავს Matrix სპეციფიკაციის სრული განხორციელება ჰქონდეს. როგორც ასეთი, ყველაფერი მიმდინარე სპეციფიკაციიდან, VoIP-ის, ძაფებისა და გამჭოლი დაშიფვრის ზოგიერთი ასპექტის გარდა, მხარდაჭერილია. შეძლება ასევე იყოს მცირე ლაფსუსებიც იმის გამო, რომ Matrix-ის სპეციფიკაცია მუდმივად ვითარდება, მაგრამ ჩვენი მიზანი მისი სრული მხარდაჭერაა.</p>
<p xml:lang="ka">NeoChat მიზნად ისახავს Matrix სპეციფიკაციის სრული განხორციელება ჰქონდეს. როგორც ასეთი, ყველაფერი მიმდინარე სპეციფიკაციიდან, VoIP-ის, ძაფებისა და გამჭოლი დაშიფვრის ზოგიერთი ასპექტის გარდა, მხარდაჭერილია. შეძლება ასევე იყოს მცირე ლაფსუსებიც იმის გამო, რომ Matrix-ის სპეციფიკაცია მუდმივად ვითარდება, მაგრამ ჩვენი მიზანი მისი სრული მხარდაჭერაა.</p>
<p xml:lang="ko">NeoChat은 Matrix 표준을 따르는 프로그램을 목표로 합니다. 현재 안정 버전의 표준에서 제공하는 기능의 대부분을 지원하며, VoIP, 스레드, 일부 종단간 암호화와 같은 기능은 아직 지원하지 않습니다. Matrix 표준은 계속하여 진화 중이기 때문에 일부 기능이 빠져 있을 수도 있지만 장기적으로는 전체 표준을 지원하는 것이 목표입니다.</p>
<p xml:lang="lv">„NeoChat“ mērķis ir piedāvāt plašas iespējas atbilstoši „Matrix“ specifikācijai. Līdz ar to programma atbalsta visu pašreizējā stabilajā specifikācijā, izņemot VoIP, pavedienus un dažos aspektos galšifrēšanu. Pastāv citas atsevišķas sīkas neieviestas daļas, jo „Matrix“ specifikācija nepārtraukti attīstās, tomēr mērķis ir ar laiku nodrošināt atbalstu pilnai specifikācijai.</p>
<p xml:lang="nl">NeoChat richt zich op het volledig bieden van alle mogelijkheden van de Matrix-specificatie. Alles in de huidige stabiele specificatie met merkbare uitzondering van VoIP, gekoppelde discussies en sommige aspecten van eind-tot-eind versleuteling worden ondersteund. Er zijn een paar andere kleinere omissies vanwege het feit dat de Matrix specificatie constant evolueert maar het doel blijft het eventueel bieden van ondersteuning van de gehele specificatie.</p>
<p xml:lang="nn">NeoChat har som mål å støtta all funksjonalitet i Matrix-spesifikasjonen. Førebels er alt i den gjeldande stabile spesifikasjonen støtta, med unntak av VoIP, trådar og nokre delar av ende-til-kryptering. Det finst òg andre småting som ikkje er støtta, sidan Matrix-spesifikasjon er i stadig endring, men målet er altså støtte for alt.</p>
<p xml:lang="pl">NeoChat w zamyśle ma być pełnowartościową aplikacją wg wytycznych Matriksa. Z tego powodu, wszystko, co jest obecnie w stabilnych wytycznych z pominięciem VoIP, wątków i niektórych części szyfrowania Użytkownik-do-Użytkownika są obecnie obsługiwane. Pominięto też kilka mniejszych rzeczy ze względu na ciągły rozwój wytycznych Matriksa, lecz celem nadal jest zapewnienie obsługi wszystkich wytycznych.</p>
<p xml:lang="pt">O NeoChat pretende ser uma aplicação completa para a especificação do Matrix. Como tal, tudo o que existe na especificação estável actual, com as notáveis excepções do VoIP, tópicos e alguns aspectos da Encriptação Ponto-a-Ponto, são suportados. Existem mais algumas omissões, devido ao facto que a norma do Matrix está em constante evolução, mas o objectivo continua a ser oferecer o suporte eventual para a norma por inteiro.</p>
<p xml:lang="sl">Neochat cilja, da bi bila popolna aplikacija po specifikaciji Matrixa. Kot takšna vsebuje vse v trenutni stabilni specifikaciji z pomembnimi izjemami pri VoIP, nitih in nekaterih vidikov šifriranja od konca do konca. Obstaja nekaj drugih manjših opustitev zaradi dejstva, da se specifikacija Matrix nenehno razvija, vendar cilj ostaja zagotoviti morebitno podporo celotni specifikaciji.</p>
<p xml:lang="sv">NeoChat har som mål att vara ett fullständigt program enligt Matrix-specifikationen. Som sådant stöds allt i den nuvarande stabila specifikationen, med de nämnvärda undantagen VoIP, trådar och några aspekter av kryptering hela vägen. Det finns några ytterligare utelämnanden på grund av att Matrix-specifikationen hela tiden utvecklas, men målet förblir att till slut erbjuda stöd för hela specifikationen.</p>
<p xml:lang="tr">NeoChat, Matrix belirtimi için tam özellikli bir uygulama olmayı hedefler. Bu nedenle; VoIP, ileti zincirleri ve Uçtan Uca Şifreleme'nin bazı yönleri gibi dikkate değer istisnalar dışında var olan kararlı belirtimdeki her şey desteklenir. Matrix belirtiminin sürekli gelişmesi nedeniyle birkaç küçük eksiklik daha var; ancak amaç tüm belirtim için nihai destek sağlamak olmayı sürdürüyor.</p>
<p xml:lang="tr">NeoChat, Matrix belirtimi için tam özellikli bir uygulama olmayı hedefler. Bu nedenle; VoIP, ileti zincirleri ve Uçtan Uca Şifrelemenin bazı yönleri gibi dikkate değer istisnalar dışında var olan kararlı belirtimdeki her şey desteklenir. Matrix belirtiminin sürekli gelişmesi nedeniyle birkaç küçük eksiklik daha var; ancak amaç tüm belirtim için nihai destek sağlamak olmayı sürdürüyor.</p>
<p xml:lang="uk">Метою створення NeoChat є повноцінна реалізація програми для специфікації Matrix. Як наслідок, реалізовано усе у поточній стабільній специфікації, окрім голосового інтернет-зв'язку, потоків та деяких аспектів міжвузлового шифрування. Є також декілька інших незначних прогалин через те, що специфікація Matrix постійно змінюється, але метою лишається повна підтримка специфікації.</p>
<p xml:lang="x-test">xxNeoChat aims to be a fully featured application for the Matrix specification. As such everything in the current stable specification with the notable exceptions of VoIP, threads and some aspects of End-to-End Encryption are supported. There are a few other smaller omissions due to the fact that the Matrix spec is constantly evolving but the aim remains to provide eventual support for the entire spec.xx</p>
<p xml:lang="zh-TW">NeoChat 以完整支援 Matrix 標準為目標,因此目前穩定版標準除了 VoIP、對話串與端對端加密的某些部分以外的所有部分都有支援。其他部分還有一些較小的不支援的部分這是因為 Matrix 標準隨時都在改進,但目標仍然時最終提供整個標準的完整支援。</p>
@@ -137,10 +135,12 @@ to provide a convergent experience across multiple platforms.</p>
<p xml:lang="fi">Matrix-määritelmän kehittyessä NeoChat tukee myös monia epävakaita ominaisuuksia. Tällä hetkellä näitä ovat:</p>
<p xml:lang="fr">En raison de la nature du développement des spécifications du protocole Matrix, NeoChat prend également en charge de nombreuses fonctionnalités instables. Actuellement, ce sont :</p>
<p xml:lang="gl">Debido á natureza do desenvolvemento da especificación de Matrix, NeoChat tamén inclúe varias funcionalidades non estábeis:</p>
<p xml:lang="hu">A Matrix specifikáció fejlesztésének jellegéből adódóan a NeoChat számos instabil funkciót is támogat. Jelenleg a következőket:</p>
<p xml:lang="ia">Debite al natura del disveloppamento de specification de Matrix NeoChat tamben supporta numerose characteristicas instabile. Currentemente istes es:</p>
<p xml:lang="it">A causa della natura dello sviluppo delle specifiche Matrix, NeoChat supporta anche numerose funzionalità instabili. Attualmente queste sono:</p>
<p xml:lang="ka">Matrix-ის სპეციფიკაციის განვითარების ბუნების გამო NeoChat-ს ასევე აქვს უამრავი არასტაბილური ფუნქციაც. ახლა ისინია:</p>
<p xml:lang="ko">Matrix 표준 개발의 특징으로 인하여 NeoChat은 일부 실험적인 기능을 지원합니다. 현재 지원하는 기능은 다음과 같습니다.</p>
<p xml:lang="lv">„Matrix“ specifikācijas veida dēļ „NeoChat“ attīstība atbalsta arī vairākas nestabilas iespējas, šobrīd šādas ir:</p>
<p xml:lang="nl">Vanwege de aard van de ontwikkeling van de Matrix specificatie ondersteunt NeoChat ook talloze onstabiele mogelijkheden. Dit zijn nu:</p>
<p xml:lang="nn">På grunn av måten Matrix-spesifikasjonen vert utvikla på, støttar NeoChat òg nokre uferdige funksjonar:</p>
<p xml:lang="pl">Ze względu na sposób rozwoju Matriksa, NeoChat obsługuje także kilka niestabilnych możliwości. Obecnie są to:</p>
@@ -164,10 +164,12 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="fi">Kyselyt MSC3381</li>
<li xml:lang="fr">Sondages - MSC3381</li>
<li xml:lang="gl">Enquisas — MSC3381</li>
<li xml:lang="hu">Szavazások - MSC3381</li>
<li xml:lang="ia">Inquestas - MSC3381</li>
<li xml:lang="it">Sondaggi - MSC3381</li>
<li xml:lang="ka">Polls - MSC3381</li>
<li xml:lang="ko">투표 - MSC3381</li>
<li xml:lang="lv">Aptaujas — MSC3381</li>
<li xml:lang="nl">Polls - MSC3381</li>
<li xml:lang="nn">Avstemmingar  MSC3381</li>
<li xml:lang="pl">Ankiety - MSC3381</li>
@@ -175,7 +177,7 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="sl">Polls - MSC3381</li>
<li xml:lang="sv">Polls - MSC3381</li>
<li xml:lang="ta">வாக்கெடுப்புகள் - MSC3381</li>
<li xml:lang="tr">Anketler - MSC3381</li>
<li xml:lang="tr">Anketler MSC3381</li>
<li xml:lang="uk">Опитування - MSC3381</li>
<li xml:lang="x-test">xxPolls - MSC3381xx</li>
<li xml:lang="zh-TW">投票 - MSC3381</li>
@@ -190,10 +192,12 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="fi">Tarrapakkaukset MSC2545</li>
<li xml:lang="fr">Paquets d'auto-collants - MSC2545</li>
<li xml:lang="gl">Paquetes de adhesivos — MSC2545</li>
<li xml:lang="hu">Matricacsomagok - MSC2545</li>
<li xml:lang="ia">Etiquetta gummate (sticker) -MSC2545</li>
<li xml:lang="it">Pacchetti di adesivi - MSC2545</li>
<li xml:lang="ka">სტიკერების პაკეტები - MSC2545</li>
<li xml:lang="ko">스티커 팩 - MSC2545</li>
<li xml:lang="lv">Uzlīmju pakas — MSC2545</li>
<li xml:lang="nl">Sticker Packs - MSC2545</li>
<li xml:lang="nn">Klistremerke-pakkar  MSC2545</li>
<li xml:lang="pl">Paczki naklejek - MSC2545</li>
@@ -201,7 +205,7 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="sl">Sticker Packs - MSC2545</li>
<li xml:lang="sv">Sticker Packs - MSC2545</li>
<li xml:lang="ta">ஒட்டி தொகுப்புகள் - MSC2545</li>
<li xml:lang="tr">Yapışkan Paketleri - MSC2545</li>
<li xml:lang="tr">Yapışkan Paketleri MSC2545</li>
<li xml:lang="uk">Пакунки наліпок - MSC2545</li>
<li xml:lang="x-test">xxSticker Packs - MSC2545xx</li>
<li xml:lang="zh-TW">貼圖包 - MSC2545</li>
@@ -216,10 +220,12 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="fi">Sijaintitapahtumat MSC3488</li>
<li xml:lang="fr">Événements de lieu - MSC3488</li>
<li xml:lang="gl">Localización de eventos — MSC3488</li>
<li xml:lang="hu">Események helyadatai - MSC3488</li>
<li xml:lang="ia">Eventos de Location - MSC3488</li>
<li xml:lang="it">Località eventi - MSC3488</li>
<li xml:lang="ka">მდებარეობის მოვლენები - MSC3488</li>
<li xml:lang="ko">위치 이벤트 - MSC3488</li>
<li xml:lang="lv">Atrašanās vietas notikumi — MSC3488</li>
<li xml:lang="nl">Locatie gebeurtenissen - MSC3488</li>
<li xml:lang="nn">Posisjonshendingar  MSC3488</li>
<li xml:lang="pl">Wydarzenia w miejscach - MSC3488</li>
@@ -227,7 +233,7 @@ to provide a convergent experience across multiple platforms.</p>
<li xml:lang="sl">Location Events - MSC3488</li>
<li xml:lang="sv">Location Events - MSC3488</li>
<li xml:lang="ta">இட நிகழ்வுகள் - MSC3488</li>
<li xml:lang="tr">Konum Etkinlikleri - MSC3488</li>
<li xml:lang="tr">Konum Etkinlikleri MSC3488</li>
<li xml:lang="uk">Місцеві зустрічі - MSC3488</li>
<li xml:lang="x-test">xxLocation Events - MSC3488xx</li>
<li xml:lang="zh-TW">位置事件 - MSC3488</li>
@@ -235,47 +241,21 @@ to provide a convergent experience across multiple platforms.</p>
</description>
<url type="homepage">https://apps.kde.org/neochat</url>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?product=NeoChat</url>
<url type="vcs-browser">https://invent.kde.org/network/neochat</url>
<url type="contact">https://go.kde.org/matrix/#/#neochat:kde.org</url>
<url type="donation">https://kde.org/community/donations/?app=neochat</url>
<url type="contribute">https://community.kde.org/Get_Involved/</url>
<categories>
<category>Network</category>
</categories>
<developer_name>The KDE Community</developer_name>
<developer_name xml:lang="ar">مجتمع كِيدِي</developer_name>
<developer_name xml:lang="az">KDE Cəmiyyəti</developer_name>
<developer_name xml:lang="ca">La comunitat KDE</developer_name>
<developer_name xml:lang="ca-valencia">La comunitat KDE</developer_name>
<developer_name xml:lang="cs">Komunita KDE</developer_name>
<developer_name xml:lang="de">Die KDE-Gemeinschaft</developer_name>
<developer_name xml:lang="el">Η Κοινότητα του KDE</developer_name>
<developer_name xml:lang="en-GB">The KDE Community</developer_name>
<developer_name xml:lang="eo">La KDE-Komunumo</developer_name>
<developer_name xml:lang="es">La comunidad KDE</developer_name>
<developer_name xml:lang="eu">KDE komunitatea</developer_name>
<developer_name xml:lang="fi">KDE-yhteisö</developer_name>
<developer_name xml:lang="fr">La communauté de KDE</developer_name>
<developer_name xml:lang="gl">A comunidade KDE</developer_name>
<developer_name xml:lang="hu">A KDE Közösség</developer_name>
<developer_name xml:lang="ia">Le communitate de KDE</developer_name>
<developer_name xml:lang="id">Komunitas KDE</developer_name>
<developer_name xml:lang="ie">Li comunité de KDE</developer_name>
<developer_name xml:lang="it">La comunità KDE</developer_name>
<developer_name xml:lang="ka">KDE-ის საზოგადოება</developer_name>
<developer_name xml:lang="ko">KDE 커뮤니티</developer_name>
<developer_name xml:lang="nl">De KDE gemeenschap</developer_name>
<developer_name xml:lang="nn">KDE-fellesskapet</developer_name>
<developer_name xml:lang="pa">ਕੇਡੀਈ ਕਮਿਊਨਟੀ</developer_name>
<developer_name xml:lang="pl">Społeczność KDE</developer_name>
<developer_name xml:lang="pt">A Comunidade do KDE</developer_name>
<developer_name xml:lang="pt-BR">A comunidade KDE</developer_name>
<developer_name xml:lang="ru">Сообщество KDE</developer_name>
<developer_name xml:lang="sk">KDE Komunita</developer_name>
<developer_name xml:lang="sl">Skupnost KDE</developer_name>
<developer_name xml:lang="sv">KDE-gemenskapen</developer_name>
<developer_name xml:lang="ta">கே.டீ.யீ. சமூகம்</developer_name>
<developer_name xml:lang="tr">KDE Topluluğu</developer_name>
<developer_name xml:lang="uk">Спільнота KDE</developer_name>
<developer_name xml:lang="x-test">xxThe KDE Communityxx</developer_name>
<developer_name xml:lang="zh-CN">KDE 社区</developer_name>
<developer_name xml:lang="zh-TW">KDE 社群</developer_name>
<keywords>
<keyword>Matrix</keyword>
<keyword>Kirigami</keyword>
</keywords>
<developer id="kde.org">
<name>The KDE Community</name>
<url>https://kde.org</url>
</developer>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<custom>
@@ -290,11 +270,64 @@ to provide a convergent experience across multiple platforms.</p>
<launchable type="desktop-id">org.kde.neochat.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://cdn.kde.org/screenshots/neochat/application-mobile.png</image>
<image>https://cdn.kde.org/screenshots/neochat/application.png</image>
<caption>Main view with room list, chat, and room information</caption>
<caption xml:lang="ar">العرض الرئيسة مع قائمة الغرف والدردشات و معلومات الغرفة</caption>
<caption xml:lang="ca">Vista principal amb la llista de sales, xats i informació de les sales</caption>
<caption xml:lang="ca-valencia">Vista principal amb la llista de sales, xats i informació de les sales</caption>
<caption xml:lang="eo">Ĉefa vido kun ĉambra listo, babilejo kaj ĉambra informo</caption>
<caption xml:lang="es">Vista principal con la lista de salas, chat e información de la sala</caption>
<caption xml:lang="eu">Ikuspegi nagusia gela-zerrenda, berriketa, eta gelako informazioarekin</caption>
<caption xml:lang="fi">Päänäkymä, jossa huoneluettelo, keskustelu ja huoneen tiedot</caption>
<caption xml:lang="fr">Vue principale avec la liste des salons ainsi que des informations sur les salons et forums de discussions</caption>
<caption xml:lang="gl">Vista principal coa lista de salas, a charla, e información da sala.</caption>
<caption xml:lang="hu">A fő nézet a szobalistával, csevegéssel és szobainformációkkal</caption>
<caption xml:lang="ia">Vista principal con lista de sala, chat e information de sala</caption>
<caption xml:lang="it">Vista principale con elenco delle stanze, chat e informazioni sulla stanza</caption>
<caption xml:lang="ka">მთავარი ხედი სურათების სიით, ჩატით და ოთახის ინფორმაციით</caption>
<caption xml:lang="ko">대화방 목록, 채팅, 대화방 정보가 표시된 주 보기</caption>
<caption xml:lang="lv">Pamata skats ar istabu sarakstu, tērzēšanu un istabas informāciju</caption>
<caption xml:lang="nl">Hoofdweergave met lijst met rooms, chat en roominformatie</caption>
<caption xml:lang="nn">Hovudvising med romliste, pratevindauge og rominformasjon</caption>
<caption xml:lang="pl">Główny widok z wykazem pokojów, rozmowami i szczegółami pokojów</caption>
<caption xml:lang="pt">A área principal com a lista de salas e com informações sobre a conversa e a sala</caption>
<caption xml:lang="sl">Glavni pogled s seznamom sob, klepetom in informacijami o sobah</caption>
<caption xml:lang="sv">Huvudvy med rumslista, chatt, och rumsinformation</caption>
<caption xml:lang="ta">அரங்குப்பட்டியல், உரையாடல், மற்றும் அரங்குவிவரங்களைக் கொண்டுள்ள பிரதான காட்சி</caption>
<caption xml:lang="tr">Oda listesini, sohbet penceresini ve oda bilgisini gösteren ana görünüm</caption>
<caption xml:lang="uk">Головна панель із списком кімнат, спілкуванням та даними щодо кімнати</caption>
<caption xml:lang="x-test">xxMain view with room list, chat, and room informationxx</caption>
<caption xml:lang="zh-TW">主頁面,包含聊天室列表、聊天內容,與聊天室資訊</caption>
</screenshot>
<screenshot type="default">
<image>https://cdn.kde.org/screenshots/neochat/application.png</image>
<image>https://cdn.kde.org/screenshots/neochat/spaces.png</image>
<caption>Discover new communities with Matrix Spaces</caption>
<caption xml:lang="ca">Descobriu comunitats noves amb els espais de Matrix</caption>
<caption xml:lang="ca-valencia">Descobriu comunitats noves amb els espais de Matrix</caption>
<caption xml:lang="eo">Malkovru novajn komunumojn per Matrix Spaces</caption>
<caption xml:lang="es">Descubra nuevas comunidades con los espacios de Matrix</caption>
<caption xml:lang="eu">Ezagutu komunitate berriak Matrixeko Tokiak erabiliz</caption>
<caption xml:lang="fr">Découvrez de nouvelles communautés avec les espaces sous Matrix</caption>
<caption xml:lang="hu">Fedezzen fel új közösségeket a Matrix Terek segítségével</caption>
<caption xml:lang="ia">Discoperi nove communitate con Matrix Spaces (Spatios de Matrix)</caption>
<caption xml:lang="it">Scopri nuove comunità con Matrix Spaces</caption>
<caption xml:lang="ka">აღმოაჩინეთ ახალი საზოგადოებები Matrix Spaces-თან ერთად</caption>
<caption xml:lang="lv">Atklājiet jaunas kopienas ar „Matrix“ telpām</caption>
<caption xml:lang="nl">Ontdek nieuwe gemeenschappen met Matrix-ruimten</caption>
<caption xml:lang="pl">Odkrywaj nowe społeczności w Przestrzeniach Matriksa</caption>
<caption xml:lang="sl">Odkrijte nove skupnosti z Matrix Spaces</caption>
<caption xml:lang="tr">Matrix Alanlar ile yeni topluluklar keşfedin</caption>
<caption xml:lang="uk">Пошук нових спільнот за допомогою Matrix Spaces</caption>
<caption xml:lang="x-test">xxDiscover new communities with Matrix Spacesxx</caption>
<caption xml:lang="zh-TW">利用 Matrix 聊天空間發現新的社群</caption>
</screenshot>
<!--
Currently invalid. See https://github.com/ximion/appstream/issues/611
<screenshot type="default" environment="plasma-mobile">
<image>https://cdn.kde.org/screenshots/neochat/neochat-1.png</image>
<caption>List of chats on mobile</caption>
</screenshot>
-->
<screenshot environment="windows">
<image>https://cdn.kde.org/screenshots/neochat/NeoChat-Windows-Timeline.png</image>
<caption>Main view with room list, chat, and room information</caption>
@@ -307,10 +340,12 @@ to provide a convergent experience across multiple platforms.</p>
<caption xml:lang="fi">Päänäkymä, jossa huoneluettelo, keskustelu ja huoneen tiedot</caption>
<caption xml:lang="fr">Vue principale avec la liste des salons ainsi que des informations sur les salons et forums de discussions</caption>
<caption xml:lang="gl">Vista principal coa lista de salas, a charla, e información da sala.</caption>
<caption xml:lang="hu">A fő nézet a szobalistával, csevegéssel és szobainformációkkal</caption>
<caption xml:lang="ia">Vista principal con lista de sala, chat e information de sala</caption>
<caption xml:lang="it">Vista principale con elenco delle stanze, chat e informazioni sulla stanza</caption>
<caption xml:lang="ka">მთავარი ხედი სურათების სიით, ჩატით და ოთახის ინფორმაციით</caption>
<caption xml:lang="ko">대화방 목록, 채팅, 대화방 정보가 표시된 주 보기</caption>
<caption xml:lang="lv">Pamata skats ar istabu sarakstu, tērzēšanu un istabas informāciju</caption>
<caption xml:lang="nl">Hoofdweergave met lijst met rooms, chat en roominformatie</caption>
<caption xml:lang="nn">Hovudvising med romliste, pratevindauge og rominformasjon</caption>
<caption xml:lang="pl">Główny widok z wykazem pokojów, rozmowami i szczegółami pokojów</caption>
@@ -336,10 +371,12 @@ to provide a convergent experience across multiple platforms.</p>
<caption xml:lang="fi">Kirjautumisnäkymä</caption>
<caption xml:lang="fr">Écran de connexion</caption>
<caption xml:lang="gl">Pantalla de identificación.</caption>
<caption xml:lang="hu">Bejelentkező képernyő</caption>
<caption xml:lang="ia">Schermo de accesso</caption>
<caption xml:lang="it">Schermata di accesso</caption>
<caption xml:lang="ka">შესვლის ეკრანი</caption>
<caption xml:lang="ko">로그인 화면</caption>
<caption xml:lang="lv">Ierakstīšanās logs</caption>
<caption xml:lang="nl">Aanmeldscherm</caption>
<caption xml:lang="nn">Innloggingsbilete</caption>
<caption xml:lang="pl">Ekran logowania</caption>
@@ -357,6 +394,26 @@ to provide a convergent experience across multiple platforms.</p>
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<releases>
<release version="24.02.2" date="2024-04-11"/>
<release version="24.02.1" date="2024-03-21"/>
<release version="24.02.0" date="2024-02-28">
<url>https://kde.org/announcements/megarelease/6/#neochat</url>
<description>
<p>In the newest version, when launching the app, you will get a welcome page that lets you choose which account you want to use and lets you log in to other accounts. The welcome screen will also warn you when NeoChat cannot load an account.</p>
<p>NeoChat will also let you register a new account directly from the app itself. Deactivating your Matrix account is also possible from within NeoChat.</p>
<p>Spaces are a relatively new feature of Matrix that let you group chat channels together. This is used to improve the discoverability of rooms, manage large communities, or just tidy all the channels you are in. You can now do all this without leaving NeoChat.</p>
<p>NeoChat won't let you miss any new notifications anymore. We added a new page that includes all your recent notifications and when NeoChat is closed, you will still be able to receive push notifications. The main timeline will let you know when more messages are loading and when you reach the end of it.</p>
<p>More NeoChat Goodies</p>
<ul>
<li>QR Codes to share contacts</li>
<li>Improved room upgrades</li>
<li>Added button to reject invitation and ignore user</li>
<li>Display device security details</li>
<li>Added room security settings</li>
</ul>
</description>
</release>
<release version="23.08.5" date="2024-02-15"/>
<release version="23.08.4" date="2023-12-07"/>
<release version="23.08.3" date="2023-11-09"/>
<release version="23.08.2" date="2023-10-12"/>
@@ -504,4 +561,8 @@ to provide a convergent experience across multiple platforms.</p>
<url>https://carlschwan.eu/2020/12/23/announcing-neochat-1.0-the-kde-matrix-client/</url>
</release>
</releases>
<branding>
<color type="primary" scheme_preference="light">#a6e4f3</color>
<color type="primary" scheme_preference="dark">#235670</color>
</branding>
</component>

View File

@@ -26,6 +26,7 @@ Name[it]=NeoChat
Name[ka]=NeoChat
Name[ko]=NeoChat
Name[lt]=NeoChat
Name[lv]=NeoChat
Name[nl]=NeoChat
Name[nn]=NeoChat
Name[pa]=ਨਿਓ-ਚੈਟ
@@ -65,7 +66,8 @@ GenericName[ie]=Cliente de Matrix
GenericName[it]=Client Matrix
GenericName[ka]=Matrix -ის კლიენტი
GenericName[ko]=Matrix 클라이언트
GenericName[lt]=Matrix kliento programą
GenericName[lt]=Matrix kliento programa
GenericName[lv]=„Matrix“ klients
GenericName[nl]=Matrix-client
GenericName[nn]=Matrix-klient
GenericName[pa]=ਮੈਟਰਿਕਸ ਕਲਾਈਂਟ
@@ -105,6 +107,7 @@ Comment[it]=Client per il protocollo Matrix
Comment[ka]=კლიენტი Matrix-ის პროტოკოლისთვის
Comment[ko]=Matrix 프로토콜용 클라이언트
Comment[lt]=Matrix protokolo kliento programa
Comment[lv]=Klients „Matrix“ protokolam
Comment[nl]=Client voor het Matrix-protocol
Comment[nn]=Klient for Matrix-protokollen
Comment[pa]=ਮੈਟਰਿਕਸ ਪਰੋਟੋਕਾਲ ਲਈ ਕਲਾਈਂਟ ਹੈ

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

5247
po/lv/neochat.po Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -77,7 +77,7 @@ SPDX-License-Identifier: CC-BY-SA-4.0
></term>
<listitem>
<para
>Bir kullanıcı veya oda için matrix URI'si; örneğin, matrix:u/kullanıcı:örnek.org ve matrix:r/kök:örnek.org. Bu, NeoChat'in verilen odayı veya konuşmayı açmayı denemesini sağlar. </para>
>Bir kullanıcı veya oda için matrix URIsi; örneğin, matrix:u/kullanıcı:örnek.org ve matrix:r/kök:örnek.org. Bu, NeoChatin verilen odayı veya konuşmayı açmayı denemesini sağlar. </para>
</listitem>
</varlistentry>
</variablelist>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -3,6 +3,10 @@
# SPDX-FileCopyrightText: 2020-2021 Tobias Fella <tobias.fella@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE AND NOT NEOCHAT_FLATPAK AND NOT NEOCHAT_APPIMAGE)
add_subdirectory(purpose)
endif()
add_library(neochat STATIC
controller.cpp
controller.h
@@ -56,6 +60,8 @@ add_library(neochat STATIC
notificationsmanager.h
models/sortfilterroomlistmodel.cpp
models/sortfilterroomlistmodel.h
models/roomtreemodel.cpp
models/roomtreemodel.h
chatdocumenthandler.cpp
chatdocumenthandler.h
models/devicesmodel.cpp
@@ -120,6 +126,7 @@ add_library(neochat STATIC
events/pollevent.cpp
pollhandler.cpp
utils.h
utils.cpp
registration.cpp
neochatconnection.cpp
neochatconnection.h
@@ -144,11 +151,42 @@ add_library(neochat STATIC
models/timelinemodel.cpp
models/timelinemodel.h
enums/pushrule.h
models/itinerarymodel.cpp
models/itinerarymodel.h
proxycontroller.cpp
proxycontroller.h
models/linemodel.cpp
models/linemodel.h
events/locationbeaconevent.h
events/serveraclevent.h
events/widgetevent.h
enums/messagecomponenttype.h
models/messagecontentmodel.cpp
models/messagecontentmodel.h
enums/neochatroomtype.h
models/sortfilterroomtreemodel.cpp
models/sortfilterroomtreemodel.h
mediamanager.cpp
mediamanager.h
models/statekeysmodel.cpp
models/statekeysmodel.h
sharehandler.cpp
sharehandler.h
models/roomtreeitem.cpp
models/roomtreeitem.h
foreigntypes.h
models/threepidmodel.cpp
models/threepidmodel.h
)
set_source_files_properties(qml/OsmLocationPlugin.qml PROPERTIES
QT_QML_SINGLETON_TYPE TRUE
)
qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat
QML_FILES
qml/main.qml
qml/Main.qml
qml/AccountMenu.qml
qml/ExploreComponent.qml
qml/ExploreComponentMobile.qml
@@ -160,19 +198,11 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/UserInfo.qml
qml/UserInfoDesktop.qml
qml/RoomPage.qml
qml/RoomWindow.qml
qml/JoinRoomPage.qml
qml/ExploreRoomsPage.qml
qml/ManualRoomDialog.qml
qml/ExplorerDelegate.qml
qml/InviteUserPage.qml
qml/StartChatPage.qml
qml/ImageEditorPage.qml
qml/WelcomePage.qml
qml/General.qml
qml/RoomSecurity.qml
qml/PushNotification.qml
qml/Categories.qml
qml/Permissions.qml
qml/NeochatMaximizeComponent.qml
qml/FancyEffectsContainer.qml
qml/TypingPane.qml
@@ -184,44 +214,7 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/CompletionMenu.qml
qml/PieProgressBar.qml
qml/QuickFormatBar.qml
qml/RoomData.qml
qml/ServerData.qml
qml/EmojiPicker.qml
qml/TimelineDelegate.qml
qml/ReplyComponent.qml
qml/StateDelegate.qml
qml/RichLabel.qml
qml/MessageDelegate.qml
qml/Bubble.qml
qml/SectionDelegate.qml
qml/VideoDelegate.qml
qml/ReactionDelegate.qml
qml/LinkPreviewDelegate.qml
qml/AudioDelegate.qml
qml/FileDelegate.qml
qml/ImageDelegate.qml
qml/EncryptedDelegate.qml
qml/EventDelegate.qml
qml/TextDelegate.qml
qml/ReadMarkerDelegate.qml
qml/PollDelegate.qml
qml/MimeComponent.qml
qml/StateComponent.qml
qml/MessageEditComponent.qml
qml/AvatarFlow.qml
qml/LoginStep.qml
qml/Login.qml
qml/Homeserver.qml
qml/Username.qml
qml/RegisterPassword.qml
qml/Captcha.qml
qml/Terms.qml
qml/Email.qml
qml/Password.qml
qml/LoginRegister.qml
qml/Loading.qml
qml/LoginMethod.qml
qml/Sso.qml
qml/UserDetailDialog.qml
qml/CreateRoomDialog.qml
qml/EmojiDialog.qml
@@ -241,41 +234,19 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/FileDelegateContextMenu.qml
qml/MessageSourceSheet.qml
qml/ReportSheet.qml
qml/SettingsPage.qml
qml/ThemeRadioButton.qml
qml/ColorScheme.qml
qml/GeneralSettingsPage.qml
qml/EmoticonsPage.qml
qml/EmoticonEditorPage.qml
qml/EmoticonFormCard.qml
qml/GlobalNotificationsPage.qml
qml/NotificationRuleItem.qml
qml/AppearanceSettingsPage.qml
qml/AccountsPage.qml
qml/AccountEditorPage.qml
qml/DevicesPage.qml
qml/DeviceDelegate.qml
qml/DevicesCard.qml
qml/About.qml
qml/AboutKDE.qml
qml/SonnetConfigPage.qml
qml/NetworkProxyPage.qml
qml/DevtoolsPage.qml
qml/ConfirmEncryptionDialog.qml
qml/RemoveSheet.qml
qml/BanSheet.qml
qml/EmojiTonesPicker.qml
qml/EmojiDelegate.qml
qml/EmojiGrid.qml
qml/SearchPage.qml
qml/LocationDelegate.qml
qml/RoomSearchPage.qml
qml/LocationChooser.qml
qml/TimelineView.qml
qml/InvitationView.qml
qml/AvatarTabButton.qml
qml/SpaceDrawer.qml
qml/OsmLocationPlugin.qml
qml/LiveLocationDelegate.qml
qml/FullScreenMap.qml
qml/LocationsPage.qml
qml/LocationMapItem.qml
@@ -286,23 +257,52 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/RoomInformation.qml
qml/RoomMedia.qml
qml/ChooseRoomDialog.qml
qml/ShareAction.qml
qml/SpaceHomePage.qml
qml/SpaceHierarchyDelegate.qml
qml/RemoveChildDialog.qml
qml/SelectParentDialog.qml
qml/Security.qml
qml/QrCodeMaximizeComponent.qml
qml/SelectSpacesDialog.qml
qml/AttachDialog.qml
qml/NotificationsView.qml
qml/LoadingDelegate.qml
qml/TimelineEndDelegate.qml
qml/SearchPage.qml
qml/ServerComboBox.qml
qml/UserSearchPage.qml
qml/ManualUserDialog.qml
qml/RecommendedSpaceDialog.qml
qml/RoomTreeSection.qml
qml/DelegateContextMenu.qml
qml/ShareDialog.qml
qml/UnlockSSSSDialog.qml
qml/QrScannerPage.qml
qml/JoinRoomDialog.qml
qml/ConfirmUrlDialog.qml
qml/AccountSwitchDialog.qml
qml/ConfirmLeaveDialog.qml
qml/CodeMaximizeComponent.qml
qml/EditStateDialog.qml
RESOURCES
qml/confetti.png
qml/glowdot.png
)
add_subdirectory(settings)
add_subdirectory(timeline)
add_subdirectory(devtools)
add_subdirectory(login)
if(UNIX)
qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml)
else()
set_source_files_properties(qml/ShareActionStub.qml PROPERTIES
QT_RESOURCE_ALIAS qml/ShareAction.qml
)
qt_target_qml_sources(neochat QML_FILES qml/ShareActionStub.qml)
endif()
configure_file(config-neochat.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-neochat.h)
if(WIN32)
set_target_properties(neochat PROPERTIES OUTPUT_NAME "neochatlib")
endif()
@@ -316,6 +316,15 @@ ecm_qt_declare_logging_category(neochat
EXPORT NEOCHAT
)
ecm_qt_declare_logging_category(neochat
HEADER "publicroomlist_logging.h"
IDENTIFIER "PublicRoomList"
CATEGORY_NAME "org.kde.neochat.publicroomlistmodel"
DESCRIPTION "Neochat: publicroomlistmodel"
DEFAULT_SEVERITY Info
EXPORT NEOCHAT
)
ecm_qt_declare_logging_category(neochat
HEADER "eventhandler_logging.h"
IDENTIFIER "EventHandling"
@@ -365,9 +374,14 @@ if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
target_compile_definitions(neochat PUBLIC -DHAVE_RUNNER)
target_compile_definitions(neochat PUBLIC -DHAVE_X11)
target_sources(neochat PRIVATE runner.cpp)
if (TARGET KUnifiedPush)
target_sources(neochat PRIVATE fakerunner.cpp)
endif()
endif()
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/models ${CMAKE_CURRENT_SOURCE_DIR}/enums)
target_link_libraries(neochat PRIVATE settingsplugin timelineplugin devtoolsplugin loginplugin)
target_link_libraries(neochat PUBLIC
Qt::Core
Qt::Quick
@@ -391,6 +405,10 @@ target_link_libraries(neochat PUBLIC
QCoro::Network
)
if (TARGET KF6::Crash)
target_link_libraries(neochat PUBLIC KF6::Crash)
endif()
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
if(NEOCHAT_FLATPAK)
@@ -493,7 +511,7 @@ if(ANDROID)
)
ecm_add_android_apk(neochat-app ANDROID_DIR ${CMAKE_SOURCE_DIR}/android)
else()
target_link_libraries(neochat PUBLIC Qt::Widgets KF6::KIOWidgets)
target_link_libraries(neochat PUBLIC Qt::Widgets KF6::KIOWidgets KF6::SyntaxHighlighting)
install(FILES neochat.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
endif()
@@ -501,7 +519,7 @@ if(NOT ANDROID)
set_target_properties(neochat-app PROPERTIES OUTPUT_NAME "neochat")
endif()
if(TARGET KF6::DBusAddons)
if(TARGET KF6::DBusAddons AND NOT WIN32)
target_link_libraries(neochat PUBLIC KF6::DBusAddons)
target_compile_definitions(neochat PUBLIC -DHAVE_KDBUSADDONS)
endif()

View File

@@ -80,6 +80,7 @@ QString ActionsHandler::handleMentions(QString handledText, QList<Mention> *ment
void ActionsHandler::handleMessage(const QString &text, QString handledText, ChatBarCache *chatBarCache)
{
Q_ASSERT(m_room);
if (NeoChatConfig::allowQuickEdit()) {
QRegularExpression sed(QStringLiteral("^s/([^/]*)/([^/]*)(/g)?$"));
auto match = sed.match(text);
@@ -90,7 +91,7 @@ void ActionsHandler::handleMessage(const QString &text, QString handledText, Cha
for (auto it = m_room->messageEvents().crbegin(); it != m_room->messageEvents().crend(); it++) {
if (const auto event = eventCast<const RoomMessageEvent>(&**it)) {
if (event->senderId() == m_room->localUser()->id() && event->hasTextContent()) {
if (event->senderId() == m_room->localMember().id() && event->hasTextContent()) {
QString originalString;
if (event->content()) {
originalString = static_cast<const Quotient::EventContent::TextContent *>(event->content())->body;

View File

@@ -58,7 +58,7 @@ public Q_SLOTS:
void handleMessageEvent(ChatBarCache *chatBarCache);
private:
NeoChatRoom *m_room = nullptr;
QPointer<NeoChatRoom> m_room;
void checkEffects(const QString &text);
QString handleMentions(QString handledText, QList<Mention> *mentions);

View File

@@ -3,6 +3,7 @@
#include "chatbarcache.h"
#include "chatdocumenthandler.h"
#include "eventhandler.h"
#include "neochatroom.h"
@@ -43,14 +44,14 @@ void ChatBarCache::setReplyId(const QString &replyId)
if (m_relationType == Reply && m_relationId == replyId) {
return;
}
m_relationId = replyId;
const auto oldEventId = std::exchange(m_relationId, replyId);
if (m_relationId.isEmpty()) {
m_relationType = None;
} else {
m_relationType = Reply;
}
m_attachmentPath = QString();
Q_EMIT relationIdChanged();
Q_EMIT relationIdChanged(oldEventId, m_relationId);
Q_EMIT attachmentPathChanged();
}
@@ -72,14 +73,14 @@ void ChatBarCache::setEditId(const QString &editId)
if (m_relationType == Edit && m_relationId == editId) {
return;
}
m_relationId = editId;
const auto oldEventId = std::exchange(m_relationId, editId);
if (m_relationId.isEmpty()) {
m_relationType = None;
} else {
m_relationType = Edit;
}
m_attachmentPath = QString();
Q_EMIT relationIdChanged();
Q_EMIT relationIdChanged(oldEventId, m_relationId);
Q_EMIT attachmentPathChanged();
}
@@ -114,11 +115,10 @@ QString ChatBarCache::relationMessage() const
qWarning() << "ChatBarCache created with incorrect parent, a NeoChatRoom must be set as the parent on creation.";
return {};
}
EventHandler eventhandler;
eventhandler.setRoom(room);
if (auto event = room->findInTimeline(m_relationId); event != room->historyEdge()) {
eventhandler.setEvent(&**event);
return eventhandler.getPlainBody();
EventHandler eventhandler(room, &**event);
return eventhandler.getMarkdownBody();
}
return {};
}
@@ -154,9 +154,9 @@ void ChatBarCache::setAttachmentPath(const QString &attachmentPath)
}
m_attachmentPath = attachmentPath;
m_relationType = None;
m_relationId = QString();
const auto oldEventId = std::exchange(m_relationId, QString());
Q_EMIT attachmentPathChanged();
Q_EMIT relationIdChanged();
Q_EMIT relationIdChanged(oldEventId, m_relationId);
}
QList<Mention> *ChatBarCache::mentions()
@@ -164,6 +164,54 @@ QList<Mention> *ChatBarCache::mentions()
return &m_mentions;
}
void ChatBarCache::updateMentions(QQuickTextDocument *document, ChatDocumentHandler *documentHandler)
{
documentHandler->setDocument(document);
if (parent() == nullptr) {
qWarning() << "ChatBarCache created with no parent, a NeoChatRoom must be set as the parent on creation.";
return;
}
if (m_relationId.isEmpty()) {
return;
}
auto room = dynamic_cast<NeoChatRoom *>(parent());
if (room == nullptr) {
qWarning() << "ChatBarCache created with incorrect parent, a NeoChatRoom must be set as the parent on creation.";
return;
}
if (auto event = room->findInTimeline(m_relationId); event != room->historyEdge()) {
if (const auto &roomMessageEvent = &*event->viewAs<Quotient::RoomMessageEvent>()) {
// Replaces the mentions that are baked into the HTML but plaintext in the original markdown
const QRegularExpression re(QStringLiteral(R"lit(<a\shref="https:\/\/matrix.to\/#\/([\S]*)"\s?>([\S]*)<\/a>)lit"));
m_mentions.clear();
int linkSize = 0;
auto matches = re.globalMatch(EventHandler::rawMessageBody(*roomMessageEvent));
while (matches.hasNext()) {
const QRegularExpressionMatch match = matches.next();
if (match.hasMatch()) {
const QString id = match.captured(1);
const QString name = match.captured(2);
const int position = match.capturedStart(0) - linkSize;
const int end = position + name.length();
linkSize += match.capturedLength(0) - name.length();
QTextCursor cursor(documentHandler->document()->textDocument());
cursor.setPosition(position);
cursor.setPosition(end, QTextCursor::KeepAnchor);
cursor.setKeepPositionOnInsert(true);
m_mentions.push_back(Mention{.cursor = cursor, .text = name, .start = position, .position = end, .id = id});
}
}
}
}
}
QString ChatBarCache::savedText() const
{
return m_savedText;

View File

@@ -5,8 +5,11 @@
#include <QObject>
#include <QQmlEngine>
#include <QQuickTextDocument>
#include <QTextCursor>
class ChatDocumentHandler;
/**
* @brief Defines a user mention in the current chat or edit text.
*/
@@ -174,6 +177,11 @@ public:
*/
QList<Mention> *mentions();
/**
* @brief Update the mentions in @p document when editing a message.
*/
Q_INVOKABLE void updateMentions(QQuickTextDocument *document, ChatDocumentHandler *documentHandler);
/**
* @brief Get the saved chat bar text.
*/
@@ -186,7 +194,7 @@ public:
Q_SIGNALS:
void textChanged();
void relationIdChanged();
void relationIdChanged(const QString &oldEventId, const QString &newEventId);
void threadIdChanged();
void attachmentPathChanged();

View File

@@ -91,7 +91,7 @@ class ChatDocumentHandler : public QObject
Q_PROPERTY(CompletionModel *completionModel READ completionModel CONSTANT)
/**
* @brief The current room that the the text document is being handled for.
* @brief The current room that the text document is being handled for.
*/
Q_PROPERTY(NeoChatRoom *room READ room WRITE setRoom NOTIFY roomChanged)

8
src/config-neochat.h.in Normal file
View File

@@ -0,0 +1,8 @@
/*
SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
SPDX-License-Identifier: LGPL-2.0-or-later
*/
#pragma once
#define CMAKE_INSTALL_FULL_LIBEXECDIR_KF6 "${KDE_INSTALL_FULL_LIBEXECDIR_KF}"

View File

@@ -23,12 +23,13 @@
#include <Quotient/csapi/logout.h>
#include <Quotient/csapi/notifications.h>
#include <Quotient/eventstats.h>
#include <Quotient/jobs/downloadfilejob.h>
#include <Quotient/qt_connection_util.h>
#include "neochatconfig.h"
#include "neochatconnection.h"
#include "neochatroom.h"
#include "notificationsmanager.h"
#include "proxycontroller.h"
#include "roommanager.h"
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
@@ -37,6 +38,14 @@
#include "trayicon_sni.h"
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
#ifndef Q_OS_ANDROID
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDBusMessage>
#endif
#endif
bool testMode = false;
using namespace Quotient;
@@ -46,7 +55,7 @@ Controller::Controller(QObject *parent)
{
Connection::setRoomType<NeoChatRoom>();
setApplicationProxy();
ProxyController::instance().setApplicationProxy();
#ifndef Q_OS_ANDROID
setQuitOnLastWindowClosed();
@@ -102,7 +111,9 @@ Controller::Controller(QObject *parent)
NotificationsManager::instance().handleNotifications(connection);
});
connectSingleShot(connection, &NeoChatConnection::syncDone, this, [this, connection] {
connection->setupPushNotifications(m_endpoint);
if (!m_endpoint.isEmpty()) {
connection->setupPushNotifications(m_endpoint);
}
});
}
oldAccountCount = m_accountRegistry.size();
@@ -118,7 +129,9 @@ Controller::Controller(QObject *parent)
}
});
connector->registerClient(i18n("Receiving push notifications"));
connector->registerClient(
i18nc("The reason for using push notifications, as in: '[Push notifications are used for] Receiving notifications for new messages'",
"Receiving notifications for new messages"));
m_endpoint = connector->endpoint();
#endif
@@ -143,8 +156,18 @@ void Controller::addConnection(NeoChatConnection *c)
c->saveState();
});
connect(c, &NeoChatConnection::loggedOut, this, [this, c] {
if (accounts().count() > 1) {
// Only set the connection if the account being logged out is currently active
if (c == activeConnection()) {
setActiveConnection(dynamic_cast<NeoChatConnection *>(accounts().accounts()[0]));
}
} else {
setActiveConnection(nullptr);
}
dropConnection(c);
});
connect(c, &NeoChatConnection::badgeNotificationCountChanged, this, &Controller::updateBadgeNotificationCount);
c->sync();
@@ -178,10 +201,12 @@ void Controller::invokeLogin()
}
auto connection = new NeoChatConnection(account.homeserver());
connect(connection, &NeoChatConnection::connected, this, [this, connection] {
m_connectionsLoading[accountId] = connection;
connect(connection, &NeoChatConnection::connected, this, [this, connection, accountId] {
connection->loadState();
addConnection(connection);
m_accountsLoading.removeAll(connection->userId());
m_connectionsLoading.remove(accountId);
Q_EMIT accountsLoadingChanged();
});
connect(connection, &NeoChatConnection::networkError, this, [this](const QString &error, const QString &, int, int) {
@@ -285,26 +310,15 @@ void Controller::setActiveConnection(NeoChatConnection *connection)
if (connection == m_connection) {
return;
}
if (m_connection != nullptr) {
disconnect(m_connection, &NeoChatConnection::syncError, this, nullptr);
disconnect(m_connection, &NeoChatConnection::accountDataChanged, this, nullptr);
}
m_connection = connection;
if (connection != nullptr) {
connect(connection, &NeoChatConnection::requestFailed, this, [](BaseJob *job) {
if (dynamic_cast<DownloadFileJob *>(job) && job->jsonData()["errcode"_ls].toString() == "M_TOO_LARGE"_ls) {
RoomManager::instance().warning(i18n("File too large to download."), i18n("Contact your matrix server administrator for support."));
}
});
}
NeoChatConfig::self()->save();
Q_EMIT activeConnectionChanged();
}
void Controller::forceRefreshTextDocument(QQuickTextDocument *textDocument, QQuickItem *item)
{
// HACK: Workaround bug QTBUG 93281
connect(textDocument->textDocument(), SIGNAL(imagesLoaded()), item, SLOT(updateWholeDocument()));
m_connection = connection;
if (m_connection != nullptr) {
m_connection->refreshBadgeNotificationCount();
updateBadgeNotificationCount(m_connection, m_connection->badgeNotificationCount());
}
Q_EMIT activeConnectionChanged(m_connection);
}
void Controller::listenForNotifications()
@@ -328,34 +342,34 @@ void Controller::listenForNotifications()
#endif
}
void Controller::setApplicationProxy()
void Controller::updateBadgeNotificationCount(NeoChatConnection *connection, int count)
{
NeoChatConfig *cfg = NeoChatConfig::self();
QNetworkProxy proxy;
if (connection == m_connection) {
#if QT_VERSION < QT_VERSION_CHECK(6, 6, 0)
#ifndef Q_OS_ANDROID
// copied from Telegram desktop
const auto launcherUrl = "application://org.kde.neochat.desktop"_ls;
// Gnome requires that count is a 64bit integer
const qint64 counterSlice = std::min(count, 9999);
QVariantMap dbusUnityProperties;
// type match to ProxyType from neochatconfig.kcfg
switch (cfg->proxyType()) {
case 1: // HTTP
proxy.setType(QNetworkProxy::HttpProxy);
proxy.setHostName(cfg->proxyHost());
proxy.setPort(cfg->proxyPort());
proxy.setUser(cfg->proxyUser());
proxy.setPassword(cfg->proxyPassword());
break;
case 2: // SOCKS 5
proxy.setType(QNetworkProxy::Socks5Proxy);
proxy.setHostName(cfg->proxyHost());
proxy.setPort(cfg->proxyPort());
proxy.setUser(cfg->proxyUser());
proxy.setPassword(cfg->proxyPassword());
break;
case 0: // System Default
default:
// do nothing
break;
if (counterSlice > 0) {
dbusUnityProperties["count"_ls] = counterSlice;
dbusUnityProperties["count-visible"_ls] = true;
} else {
dbusUnityProperties["count-visible"_ls] = false;
}
auto signal = QDBusMessage::createSignal("/com/canonical/unity/launcherentry/neochat"_ls, "com.canonical.Unity.LauncherEntry"_ls, "Update"_ls);
signal.setArguments({launcherUrl, dbusUnityProperties});
QDBusConnection::sessionBus().send(signal);
#endif // Q_OS_ANDROID
#else
qGuiApp->setBadgeNumber(count);
#endif // QT_VERSION_CHECK(6, 6, 0)
}
QNetworkProxy::setApplicationProxy(proxy);
}
bool Controller::isFlatpak() const
@@ -372,9 +386,36 @@ AccountRegistry &Controller::accounts()
return m_accountRegistry;
}
QString Controller::loadFileContent(const QString &path) const
{
QUrl url(path);
QFile file(url.isLocalFile() ? url.toLocalFile() : url.toString());
file.open(QFile::ReadOnly);
return QString::fromLatin1(file.readAll());
}
#include "moc_controller.cpp"
void Controller::setTestMode(bool test)
{
testMode = test;
}
void Controller::removeConnection(const QString &userId)
{
if (m_connectionsLoading.contains(userId) && m_connectionsLoading[userId]) {
auto connection = m_connectionsLoading[userId];
m_accountsLoading.removeAll(userId);
Q_EMIT accountsLoadingChanged();
SettingsGroup("Accounts"_ls).remove(userId);
}
}
bool Controller::ssssSupported() const
{
#if __has_include("Quotient/e2ee/sssshandler.h")
return true;
#else
return false;
#endif
}

View File

@@ -56,6 +56,8 @@ class Controller : public QObject
Q_PROPERTY(QStringList accountsLoading MEMBER m_accountsLoading NOTIFY accountsLoadingChanged)
Q_PROPERTY(bool ssssSupported READ ssssSupported CONSTANT)
public:
static Controller &instance();
static Controller *create(QQmlEngine *engine, QJSEngine *)
@@ -84,32 +86,24 @@ public:
[[nodiscard]] bool supportSystemTray() const;
/**
* @brief Sets the QNetworkProxy for the application.
*
* @sa QNetworkProxy::setApplicationProxy
*/
Q_INVOKABLE void setApplicationProxy();
bool isFlatpak() const;
/**
* @brief Force a QQuickTextDocument to refresh when images are loaded.
*
* HACK: This is a workaround for QTBUG 93281.
*/
Q_INVOKABLE void forceRefreshTextDocument(QQuickTextDocument *textDocument, QQuickItem *item);
/**
* @brief Start listening for notifications in dbus-activated mode.
* These notifications will quit the application when closed.
*/
static void listenForNotifications();
Q_INVOKABLE QString loadFileContent(const QString &path) const;
Quotient::AccountRegistry &accounts();
static void setTestMode(bool testMode);
Q_INVOKABLE void removeConnection(const QString &userId);
bool ssssSupported() const;
private:
explicit Controller(QObject *parent = nullptr);
@@ -123,16 +117,18 @@ private:
Quotient::AccountRegistry m_accountRegistry;
QStringList m_accountsLoading;
QMap<QString, QPointer<Quotient::Connection>> m_connectionsLoading;
QString m_endpoint;
private Q_SLOTS:
void invokeLogin();
void setQuitOnLastWindowClosed();
void updateBadgeNotificationCount(NeoChatConnection *connection, int count);
Q_SIGNALS:
void errorOccured(const QString &error, const QString &detail);
void connectionAdded(NeoChatConnection *connection);
void connectionDropped(NeoChatConnection *connection);
void activeConnectionChanged();
void activeConnectionChanged(NeoChatConnection *connection);
void accountsLoadingChanged();
};

View File

@@ -0,0 +1,35 @@
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
import QtQuick
import QtQuick.Controls as QQC2
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.neochat
ColumnLayout {
id: root
required property NeoChatConnection connection
FormCard.FormHeader {
title: i18nc("@title:group", "Account Data")
}
FormCard.FormCard {
Repeater {
model: root.connection.accountDataEventTypes
delegate: FormCard.FormButtonDelegate {
text: modelData
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
sourceText: root.connection.accountDataJsonString(modelData)
}, {
title: i18nc("@title:window", "Event Source"),
width: Kirigami.Units.gridUnit * 25
})
}
}
}
}

View File

@@ -0,0 +1,16 @@
# SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
# SPDX-License-Identifier: BSD-2-Clause
qt_add_library(devtools STATIC)
qt_add_qml_module(devtools
URI org.kde.neochat.devtools
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/devtools
QML_FILES
DevtoolsPage.qml
AccountData.qml
DebugOptions.qml
FeatureFlagPage.qml
RoomData.qml
ServerData.qml
StateKeys.qml
)

View File

@@ -0,0 +1,27 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.neochat
FormCard.FormCardPage {
id: root
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormCheckDelegate {
id: roomAccountDataVisibleCheck
text: i18nc("@option:check Enable the matrix 'threads' feature", "Always allow device verification")
description: i18n("Allow the user to start a verification session with devices that were already verified")
checked: Config.alwaysVerifyDevice
onToggled: Config.alwaysVerifyDevice = checked
}
}
}

View File

@@ -23,11 +23,32 @@ FormCard.FormCardPage {
header: QQC2.TabBar {
id: tabBar
readonly property real tabWidth: tabBar.width / tabBar.count
QQC2.TabButton {
text: i18nc("@title:tab", "Debug Options")
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: qsTr("Room Data")
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: qsTr("Server Info")
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: i18nc("@title:tab", "Account Data")
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: i18nc("@title:tab", "Feature Flags")
implicitWidth: tabBar.tabWidth
}
}
@@ -36,6 +57,7 @@ FormCard.FormCardPage {
currentIndex: tabBar.currentIndex
DebugOptions {}
RoomData {
room: root.room
connection: root.connection
@@ -43,5 +65,9 @@ FormCard.FormCardPage {
ServerData {
connection: root.connection
}
AccountData {
connection: root.connection
}
FeatureFlagPage {}
}
}

View File

@@ -0,0 +1,32 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.neochat
FormCard.FormCardPage {
id: root
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormCheckDelegate {
id: roomAccountDataVisibleCheck
text: i18nc("@option:check Enable the matrix 'threads' feature", "Threads")
checked: Config.threads
onToggled: Config.threads = checked
}
FormCard.FormCheckDelegate {
text: i18nc("@option:check Enable the matrix 'secret backup' feature", "Secret Backup")
checked: Config.secretBackup
onToggled: Config.secretBackup = checked
}
}
}

102
src/devtools/RoomData.qml Normal file
View File

@@ -0,0 +1,102 @@
// SPDX-FileCopyrightText: 2022 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.kitemmodels
import org.kde.neochat
ColumnLayout {
id: root
required property NeoChatRoom room
required property NeoChatConnection connection
FormCard.FormHeader {
title: i18nc("@title", "Choose Room")
}
FormCard.FormCard {
FormCard.FormComboBoxDelegate {
id: roomComboBox
text: i18n("Room")
textRole: "escapedDisplayName"
valueRole: "roomId"
displayText: RoomManager.roomListModel.data(RoomManager.roomListModel.index(currentIndex, 0), RoomListModel.DisplayNameRole)
model: RoomManager.roomListModel
currentIndex: 0
Component.onCompleted: currentIndex = RoomManager.roomListModel.rowForRoom(root.room)
onCurrentValueChanged: root.room = RoomManager.roomListModel.roomByAliasOrId(roomComboBox.currentValue)
}
FormCard.FormTextDelegate {
text: i18n("Room Id: %1", root.room.id)
}
}
FormCard.FormHeader {
title: i18n("Room Account Data")
visible: roomAccountData.count > 0
}
FormCard.FormCard {
visible: roomAccountData.count > 0
Repeater {
id: roomAccountData
model: root.room.accountDataEventTypes
delegate: FormCard.FormButtonDelegate {
text: modelData
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
sourceText: root.room.roomAcountDataJson(text)
}, {
title: i18n("Event Source"),
width: Kirigami.Units.gridUnit * 25
})
}
}
}
FormCard.FormHeader {
id: stateEventListHeader
title: i18n("Room State")
visible: roomState.count > 0
}
FormCard.FormCard {
visible: roomState.count > 0
Repeater {
id: roomState
model: StateModel {
id: stateModel
room: root.room
}
delegate: FormCard.FormButtonDelegate {
text: model.type
description: i18ncp("'Event' being some JSON data, not something physically happening.", "%1 event of this type", "%1 events of this type", model.eventCount)
onClicked: {
if (model.eventCount === 1) {
openEventSource(model.type, model.stateKey);
} else {
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'StateKeys'), {
room: root.room,
eventType: model.type
}, {
title: i18nc("'Event' being some JSON data, not something physically happening.", "Event Information")
});
}
}
}
}
}
function openEventSource(type: string, stateKey: string): void {
onClicked: applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
model: stateModel,
allowEdit: true,
room: root.room,
type: type,
stateKey: stateKey,
}, {
title: i18n("Event Source"),
width: Kirigami.Units.gridUnit * 25
});
}
}

View File

@@ -38,7 +38,7 @@ ColumnLayout {
}
FormCard.FormCard {
Repeater {
model: room.connection.getSupportedRoomVersions()
model: root.connection.getSupportedRoomVersions()
delegate: FormCard.FormTextDelegate {
text: modelData.id

View File

@@ -0,0 +1,51 @@
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
import QtQuick
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.kitemmodels
import org.kde.neochat
FormCard.FormCardPage {
id: root
required property NeoChatRoom room
required property string eventType
title: root.eventType
FormCard.FormHeader {
title: i18nc("The name of one instance of a state of configuration. Unless you really know what you're doing, best leave this untranslated.", "State Keys")
}
FormCard.FormCard {
Repeater {
model: StateKeysModel {
id: stateKeysModel
room: root.room
eventType: root.eventType
}
delegate: FormCard.FormButtonDelegate {
text: model.stateKey
onClicked: openEventSource(model.stateKey)
}
}
}
function openEventSource(stateKey: string): void {
applicationWindow().pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'MessageSourceSheet'), {
model: stateKeysModel,
allowEdit: true,
room: root.room,
type: root.eventType,
stateKey: stateKey
}, {
title: i18nc("@title:window", "Event Source"),
width: Kirigami.Units.gridUnit * 25
});
}
}

View File

@@ -6,6 +6,13 @@
#include <QObject>
#include <QQmlEngine>
#include <Quotient/events/encryptedevent.h>
#include <Quotient/events/roomevent.h>
#include <Quotient/events/roommessageevent.h>
#include <Quotient/events/stickerevent.h>
#include "events/pollevent.h"
/**
* @class DelegateType
*
@@ -26,23 +33,34 @@ public:
* similar to the spec it is not the same.
*/
enum Type {
Emote, /**< A message that begins with /me. */
Notice, /**< A notice event. */
Image, /**< A message that is an image. */
Audio, /**< A message that is an audio recording. */
Video, /**< A message that is a video. */
File, /**< A message that is a file. */
Message, /**< A text message. */
Sticker, /**< A message that is a sticker. */
State, /**< A state event in the room. */
Encrypted, /**< An encrypted message that cannot be decrypted. */
ReadMarker, /**< The local user read marker. */
Poll, /**< The initial event for a poll. */
Location, /**< A location event. */
LiveLocation, /**< The initial event of a shared live location (i.e., the place where this is supposed to be shown in the timeline). */
Loading, /**< A delegate to tell the user more messages are being loaded. */
TimelineEnd, /**< A delegate to inform that all messages are loaded. */
Other, /**< Anything that cannot be classified as another type. */
};
Q_ENUM(Type);
/**
* @brief Return the delegate type for the given event.
*
* @param event the event to return a type for.
*
* @sa Type
*/
static Type typeForEvent(const Quotient::RoomEvent &event)
{
if (event.is<Quotient::RoomMessageEvent>() || event.is<Quotient::StickerEvent>() || event.is<Quotient::EncryptedEvent>()
|| event.is<Quotient::PollStartEvent>()) {
return Message;
}
if (event.isStateEvent()) {
if (event.matrixType() == QStringLiteral("org.matrix.msc3672.beacon_info")) {
return Message;
}
return State;
}
return Other;
}
};

View File

@@ -0,0 +1,130 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <QObject>
#include <QQmlEngine>
#include <Quotient/events/encryptedevent.h>
#include <Quotient/events/roomevent.h>
#include <Quotient/events/roommessageevent.h>
#include <Quotient/events/stickerevent.h>
#include "events/pollevent.h"
/**
* @class MessageComponentType
*
* This class is designed to define the MessageComponentType enumeration.
*/
class MessageComponentType : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
public:
/**
* @brief The type of component that is needed for an event.
*
* @note While similar this is not the matrix event or message type. This is
* to tell a QML Bubble what component to use to visualise all or part of
* a room message.
*/
enum Type {
Text, /**< A text message. */
Image, /**< A message that is an image. */
Audio, /**< A message that is an audio recording. */
Video, /**< A message that is a video. */
Code, /**< A code section. */
Quote, /**< A quote section. */
File, /**< A message that is a file. */
Itinerary, /**< A preview for a file that can integrate with KDE itinerary. */
Pdf, /**< A preview for a PDF file. */
Poll, /**< The initial event for a poll. */
Location, /**< A location event. */
LiveLocation, /**< The initial event of a shared live location (i.e., the place where this is supposed to be shown in the timeline). */
Encrypted, /**< An encrypted message that cannot be decrypted. */
Reply, /**< A component to show a replied-to message. */
ReplyLoad, /**< A loading dialog for a reply. */
LinkPreview, /**< A preview of a URL in the message. */
LinkPreviewLoad, /**< A loading dialog for a link preview. */
Edit, /**< A text edit for editing a message. */
Verification, /**< A user verification session start message. */
Other, /**< Anything that cannot be classified as another type. */
};
Q_ENUM(Type);
/**
* @brief Return the delegate type for the given event.
*
* @param event the event to return a type for.
*
* @sa Type
*/
static Type typeForEvent(const Quotient::RoomEvent &event)
{
using namespace Quotient;
if (const auto e = eventCast<const RoomMessageEvent>(&event)) {
switch (e->msgtype()) {
case MessageEventType::Emote:
return MessageComponentType::Text;
case MessageEventType::Notice:
return MessageComponentType::Text;
case MessageEventType::Image:
return MessageComponentType::Image;
case MessageEventType::Audio:
return MessageComponentType::Audio;
case MessageEventType::Video:
return MessageComponentType::Video;
case MessageEventType::Location:
return MessageComponentType::Location;
case MessageEventType::File:
return MessageComponentType::File;
default:
return MessageComponentType::Text;
}
}
if (is<const StickerEvent>(event)) {
return MessageComponentType::Image;
}
if (event.isStateEvent()) {
if (event.matrixType() == QStringLiteral("org.matrix.msc3672.beacon_info")) {
return MessageComponentType::LiveLocation;
}
return MessageComponentType::Other;
}
if (is<const EncryptedEvent>(event)) {
return MessageComponentType::Encrypted;
}
if (is<PollStartEvent>(event)) {
const auto pollEvent = eventCast<const PollStartEvent>(&event);
if (pollEvent->isRedacted()) {
return MessageComponentType::Text;
}
return MessageComponentType::Poll;
}
return MessageComponentType::Other;
}
/**
* @brief Return MessageComponentType for the given html tag.
*
* @param tag the tag name to return a type for.
*
* @sa Type
*/
static Type typeForTag(const QString &tag)
{
if (tag == QLatin1String("pre") || tag == QLatin1String("pre")) {
return Code;
}
if (tag == QLatin1String("blockquote")) {
return Quote;
}
return Text;
}
};

View File

@@ -0,0 +1,98 @@
// SPDX-FileCopyrightText: 2023 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
#pragma once
#include <QObject>
#include "neochatroom.h"
#include <Quotient/quotient_common.h>
#include <KLocalizedString>
class NeoChatRoomType : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
public:
/**
* @brief Defines the room list categories a room can be assigned.
*/
enum Types {
Search = 0, /**< So we can show a search delegate if needed, e.g. collapsed mode. */
Invited, /**< The user has been invited to the room. */
Favorite, /**< The room is set as a favourite. */
Direct, /**< The room is a direct chat. */
Normal, /**< The default category for a joined room. */
Deprioritized, /**< The room is set as low priority. */
Space, /**< The room is a space. */
AddDirect, /**< So we can show the add friend delegate. */
TypesCount, /**< Number of different types (this should always be last). */
};
Q_ENUM(Types);
static NeoChatRoomType::Types typeForRoom(const NeoChatRoom *room)
{
if (room->isSpace()) {
return NeoChatRoomType::Space;
}
if (room->joinState() == Quotient::JoinState::Invite) {
return NeoChatRoomType::Invited;
}
if (room->isFavourite()) {
return NeoChatRoomType::Favorite;
}
if (room->isLowPriority()) {
return NeoChatRoomType::Deprioritized;
}
if (room->isDirectChat()) {
return NeoChatRoomType::Direct;
}
return NeoChatRoomType::Normal;
}
static QString typeName(int category)
{
switch (category) {
case NeoChatRoomType::Invited:
return i18n("Invited");
case NeoChatRoomType::Favorite:
return i18n("Favorite");
case NeoChatRoomType::Direct:
return i18n("Friends");
case NeoChatRoomType::Normal:
return i18n("Normal");
case NeoChatRoomType::Deprioritized:
return i18n("Low priority");
case NeoChatRoomType::Space:
return i18n("Spaces");
case NeoChatRoomType::Search:
return i18n("Search");
default:
return {};
}
}
static QString typeIconName(int category)
{
switch (category) {
case NeoChatRoomType::Invited:
return QStringLiteral("user-invisible");
case NeoChatRoomType::Favorite:
return QStringLiteral("favorite");
case NeoChatRoomType::Direct:
return QStringLiteral("dialog-messages");
case NeoChatRoomType::Normal:
return QStringLiteral("group");
case NeoChatRoomType::Deprioritized:
return QStringLiteral("object-order-lower");
case NeoChatRoomType::Space:
return QStringLiteral("group");
case NeoChatRoomType::Search:
return QStringLiteral("search");
default:
return QStringLiteral("tools-report-bug");
}
}
};

View File

@@ -14,15 +14,19 @@
#include <Quotient/events/roomavatarevent.h>
#include <Quotient/events/roomcanonicalaliasevent.h>
#include <Quotient/events/roommemberevent.h>
#include <Quotient/events/roommessageevent.h>
#include <Quotient/events/roompowerlevelsevent.h>
#include <Quotient/events/simplestateevents.h>
#include <Quotient/events/stickerevent.h>
#include <Quotient/quotient_common.h>
#include "delegatetype.h"
#include "eventhandler_logging.h"
#include "events/locationbeaconevent.h"
#include "events/pollevent.h"
#include "events/serveraclevent.h"
#include "events/widgetevent.h"
#include "linkpreviewer.h"
#include "messagecomponenttype.h"
#include "models/reactionmodel.h"
#include "neochatconfig.h"
#include "neochatroom.h"
@@ -31,34 +35,10 @@
using namespace Quotient;
const NeoChatRoom *EventHandler::getRoom() const
EventHandler::EventHandler(const NeoChatRoom *room, const RoomEvent *event)
: m_room(room)
, m_event(event)
{
return m_room;
}
void EventHandler::setRoom(const NeoChatRoom *room)
{
if (room == m_room) {
return;
}
m_room = room;
}
const Quotient::Event *EventHandler::getEvent() const
{
return m_event;
}
void EventHandler::setEvent(const Quotient::RoomEvent *event)
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "cannot setEvent when m_room is set to nullptr.";
return;
}
if (event == m_event) {
return;
}
m_event = event;
}
QString EventHandler::getId() const
@@ -71,62 +51,14 @@ QString EventHandler::getId() const
return !m_event->id().isEmpty() ? m_event->id() : m_event->transactionId();
}
DelegateType::Type EventHandler::getDelegateTypeForEvent(const Quotient::RoomEvent *event) const
{
if (auto e = eventCast<const RoomMessageEvent>(event)) {
switch (e->msgtype()) {
case MessageEventType::Emote:
return DelegateType::Emote;
case MessageEventType::Notice:
return DelegateType::Notice;
case MessageEventType::Image:
return DelegateType::Image;
case MessageEventType::Audio:
return DelegateType::Audio;
case MessageEventType::Video:
return DelegateType::Video;
case MessageEventType::Location:
return DelegateType::Location;
default:
break;
}
if (e->hasFileContent()) {
return DelegateType::File;
}
return DelegateType::Message;
}
if (is<const StickerEvent>(*event)) {
return DelegateType::Sticker;
}
if (event->isStateEvent()) {
if (event->matrixType() == QStringLiteral("org.matrix.msc3672.beacon_info")) {
return DelegateType::LiveLocation;
}
return DelegateType::State;
}
if (is<const EncryptedEvent>(*event)) {
return DelegateType::Encrypted;
}
if (is<PollStartEvent>(*event)) {
const auto pollEvent = eventCast<const PollStartEvent>(event);
if (pollEvent->isRedacted()) {
return DelegateType::Message;
}
return DelegateType::Poll;
}
return DelegateType::Other;
}
DelegateType::Type EventHandler::getDelegateType() const
MessageComponentType::Type EventHandler::messageComponentType() const
{
if (m_event == nullptr) {
qCWarning(EventHandling) << "getDelegateType called with m_event set to nullptr.";
return DelegateType::Other;
qCWarning(EventHandling) << "messageComponentType called with m_event set to nullptr.";
return MessageComponentType::Other;
}
return getDelegateTypeForEvent(m_event);
return MessageComponentType::typeForEvent(*m_event);
}
QVariantMap EventHandler::getAuthor(bool isPending) const
@@ -141,7 +73,7 @@ QVariantMap EventHandler::getAuthor(bool isPending) const
return m_room->getUser(nullptr);
}
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
const auto author = isPending ? m_room->localMember() : m_room->user(m_event->senderId());
return m_room->getUser(author);
}
@@ -164,7 +96,7 @@ QString EventHandler::getAuthorDisplayName(bool isPending) const
}
return previousDisplayName;
} else {
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
const auto author = isPending ? m_room->localMember() : m_room->user(m_event->senderId());
return m_room->htmlSafeMemberName(author->id());
}
}
@@ -180,7 +112,7 @@ QString EventHandler::singleLineAuthorDisplayname(bool isPending) const
return {};
}
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
const auto author = isPending ? m_room->localMember() : m_room->user(m_event->senderId());
auto displayName = m_room->safeMemberName(author->id());
displayName.replace(QStringLiteral("<br>\n"), QStringLiteral(" "));
displayName.replace(QStringLiteral("<br>"), QStringLiteral(" "));
@@ -300,6 +232,36 @@ bool EventHandler::isHidden()
return false;
}
Qt::TextFormat EventHandler::messageBodyInputFormat(const Quotient::RoomMessageEvent &event)
{
if (event.mimeType().name() == "text/plain"_ls) {
return Qt::PlainText;
} else {
return Qt::RichText;
}
}
QString EventHandler::rawMessageBody(const Quotient::RoomMessageEvent &event)
{
if (event.hasFileContent()) {
auto fileCaption = event.content()->fileInfo()->originalName;
if (fileCaption.isEmpty()) {
fileCaption = event.plainBody();
} else if (event.content()->fileInfo()->originalName != event.plainBody()) {
fileCaption = event.plainBody() + " | "_ls + fileCaption;
}
return fileCaption;
}
QString body;
if (event.hasTextContent() && event.content()) {
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body;
} else {
body = event.plainBody();
}
return body;
}
QString EventHandler::getRichBody(bool stripNewlines) const
{
if (m_event == nullptr) {
@@ -318,6 +280,22 @@ QString EventHandler::getPlainBody(bool stripNewlines) const
return getBody(m_event, Qt::PlainText, stripNewlines);
}
QString EventHandler::getMarkdownBody() const
{
if (m_event == nullptr) {
qCWarning(EventHandling) << "getMarkdownBody called with m_event set to nullptr.";
return {};
}
if (!m_event->is<RoomMessageEvent>()) {
qCWarning(EventHandling) << "getMarkdownBody called when m_event isn't a RoomMessageEvent.";
return {};
}
const auto roomMessageEvent = eventCast<const RoomMessageEvent>(m_event);
return roomMessageEvent->plainBody();
}
QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat format, bool stripNewlines) const
{
if (event->isRedacted()) {
@@ -345,8 +323,7 @@ QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat f
}
if (prettyPrint) {
subjectName = QStringLiteral("<a href=\"https://matrix.to/#/%1\" style=\"color: %2\">%3</a>")
.arg(e.userId(), Utils::getUserColor(m_room->user(e.userId())->hueF()).name(), subjectName);
subjectName = QStringLiteral("<a href=\"https://matrix.to/#/%1\">%2</a>").arg(e.userId(), subjectName);
}
// The below code assumes senderName output in AuthorRole
@@ -457,22 +434,22 @@ QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat f
[](const RoomPowerLevelsEvent &) {
return i18nc("'power level' means permission level", "changed the power levels for this room");
},
[](const LocationBeaconEvent &e) {
return e.contentJson()["description"_ls].toString();
},
[](const ServerAclEvent &) {
return i18n("changed the server access control lists for this room");
},
[](const WidgetEvent &e) {
if (e.fullJson()["unsigned"_ls]["prev_content"_ls].toObject().isEmpty()) {
return i18nc("[User] added <name> widget", "added %1 widget", e.contentJson()["name"_ls].toString());
}
if (e.contentJson().isEmpty()) {
return i18nc("[User] removed <name> widget", "removed %1 widget", e.fullJson()["unsigned"_ls]["prev_content"_ls]["name"_ls].toString());
}
return i18nc("[User] configured <name> widget", "configured %1 widget", e.contentJson()["name"_ls].toString());
},
[prettyPrint](const StateEvent &e) {
if (e.matrixType() == QLatin1String("m.room.server_acl")) {
return i18n("changed the server access control lists for this room");
}
if (e.matrixType() == QLatin1String("im.vector.modular.widgets")) {
if (e.fullJson()["unsigned"_ls]["prev_content"_ls].toObject().isEmpty()) {
return i18nc("[User] added <name> widget", "added %1 widget", e.contentJson()["name"_ls].toString());
}
if (e.contentJson().isEmpty()) {
return i18nc("[User] removed <name> widget", "removed %1 widget", e.fullJson()["unsigned"_ls]["prev_content"_ls]["name"_ls].toString());
}
return i18nc("[User] configured <name> widget", "configured %1 widget", e.contentJson()["name"_ls].toString());
}
if (e.matrixType() == "org.matrix.msc3672.beacon_info"_ls) {
return e.contentJson()["description"_ls].toString();
}
return e.stateKey().isEmpty() ? i18n("updated %1 state", e.matrixType())
: i18n("updated %1 state for %2", e.matrixType(), prettyPrint ? e.stateKey().toHtmlEscaped() : e.stateKey());
},
@@ -514,7 +491,7 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm
}
if (format == Qt::RichText) {
return textHandler.handleRecieveRichText(inputFormat, m_room, &event, stripNewlines);
return textHandler.handleRecieveRichText(inputFormat, m_room, &event, stripNewlines, event.isReplaced());
} else {
return textHandler.handleRecievePlainText(inputFormat, stripNewlines);
}
@@ -626,19 +603,22 @@ QString EventHandler::getGenericBody() const
[](const RoomPowerLevelsEvent &) {
return i18nc("'power level' means permission level", "changed the power levels for this room");
},
[](const StateEvent &e) {
if (e.matrixType() == QLatin1String("m.room.server_acl")) {
return i18n("changed the server access control lists for this room");
[](const LocationBeaconEvent &) {
return i18n("sent a live location beacon");
},
[](const ServerAclEvent &) {
return i18n("changed the server access control lists for this room");
},
[](const WidgetEvent &e) {
if (e.fullJson()["unsigned"_ls]["prev_content"_ls].toObject().isEmpty()) {
return i18n("added a widget");
}
if (e.matrixType() == QLatin1String("im.vector.modular.widgets")) {
if (e.fullJson()["unsigned"_ls]["prev_content"_ls].toObject().isEmpty()) {
return i18n("added a widget");
}
if (e.contentJson().isEmpty()) {
return i18n("removed a widget");
}
return i18n("configured a widget");
if (e.contentJson().isEmpty()) {
return i18n("removed a widget");
}
return i18n("configured a widget");
},
[](const StateEvent &) {
return i18n("updated the state");
},
[](const PollStartEvent &e) {
@@ -676,6 +656,7 @@ QVariantMap EventHandler::getMediaInfoForEvent(const Quotient::RoomEvent *event)
// Get the file info for the event.
const EventContent::FileInfo *fileInfo;
bool isSticker = false;
if (event->is<RoomMessageEvent>()) {
auto roomMessageEvent = eventCast<const RoomMessageEvent>(event);
if (!roomMessageEvent->hasFileContent()) {
@@ -685,14 +666,15 @@ QVariantMap EventHandler::getMediaInfoForEvent(const Quotient::RoomEvent *event)
} else if (event->is<StickerEvent>()) {
auto stickerEvent = eventCast<const StickerEvent>(event);
fileInfo = &stickerEvent->image();
isSticker = true;
} else {
return {};
}
return getMediaInfoFromFileInfo(fileInfo, eventId);
return getMediaInfoFromFileInfo(fileInfo, eventId, false, isSticker);
}
QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo *fileInfo, const QString &eventId, bool isThumbnail) const
QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo *fileInfo, const QString &eventId, bool isThumbnail, bool isSticker) const
{
QVariantMap mediaInfo;
@@ -719,6 +701,8 @@ QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo
// Add media size if available.
mediaInfo["size"_ls] = fileInfo->payloadSize;
mediaInfo["isSticker"_ls] = isSticker;
// Add parameter depending on media type.
if (mimeType.name().contains(QStringLiteral("image"))) {
if (auto castInfo = static_cast<const EventContent::ImageContent *>(fileInfo)) {
@@ -795,22 +779,22 @@ QString EventHandler::getReplyId() const
return m_event->contentJson()["m.relates_to"_ls].toObject()["m.in_reply_to"_ls].toObject()["event_id"_ls].toString();
}
DelegateType::Type EventHandler::getReplyDelegateType() const
MessageComponentType::Type EventHandler::replyMessageComponentType() const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getReplyDelegateType called with m_room set to nullptr.";
return DelegateType::Other;
qCWarning(EventHandling) << "replyMessageComponentType called with m_room set to nullptr.";
return MessageComponentType::Other;
}
if (m_event == nullptr) {
qCWarning(EventHandling) << "getReplyDelegateType called with m_event set to nullptr.";
return DelegateType::Other;
qCWarning(EventHandling) << "replyMessageComponentType called with m_event set to nullptr.";
return MessageComponentType::Other;
}
auto replyEvent = m_room->getReplyForEvent(*m_event);
if (replyEvent == nullptr) {
return DelegateType::Other;
return MessageComponentType::Other;
}
return getDelegateTypeForEvent(replyEvent);
return MessageComponentType::typeForEvent(*replyEvent);
}
QVariantMap EventHandler::getReplyAuthor() const
@@ -979,7 +963,7 @@ bool EventHandler::hasReadMarkers() const
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
userIds.remove(m_room->localMember().id());
return userIds.size() > 0;
}
@@ -995,7 +979,7 @@ QVariantList EventHandler::getReadMarkers(int maxMarkers) const
}
auto userIds_temp = m_room->userIdsAtEvent(m_event->id());
userIds_temp.remove(m_room->localUser()->id());
userIds_temp.remove(m_room->localMember().id());
auto userIds = userIds_temp.values();
if (userIds.count() > maxMarkers) {
@@ -1024,7 +1008,7 @@ QString EventHandler::getNumberExcessReadMarkers(int maxMarkers) const
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
userIds.remove(m_room->localMember().id());
if (userIds.count() > maxMarkers) {
return QStringLiteral("+ ") + QString::number(userIds.count() - maxMarkers);
@@ -1045,7 +1029,7 @@ QString EventHandler::getReadMarkersString() const
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
userIds.remove(m_room->localMember().id());
/**
* The string ends up in the form

View File

@@ -11,7 +11,7 @@
#include <Quotient/events/roomevent.h>
#include <Quotient/events/roommessageevent.h>
#include "enums/delegatetype.h"
#include "enums/messagecomponenttype.h"
class LinkPreviewer;
class NeoChatRoom;
@@ -31,30 +31,12 @@ class ReactionModel;
* information. This is to minimize warnings from QML especially during startup
* and room changes.
*/
class EventHandler : public QObject
class EventHandler
{
Q_OBJECT
Q_GADGET
public:
/**
* @brief Return the current room the EventHandler is using.
*/
const NeoChatRoom *getRoom() const;
/**
* @brief Set the current room the EventHandler to using.
*/
void setRoom(const NeoChatRoom *room);
/**
* @brief Return the current event the EventHandler is using.
*/
const Quotient::Event *getEvent() const;
/**
* @brief Set the current event the EventHandler to using.
*/
void setEvent(const Quotient::RoomEvent *event);
EventHandler(const NeoChatRoom *room, const Quotient::RoomEvent *event);
/**
* @brief Return the Matrix ID of the event.
@@ -62,13 +44,9 @@ public:
QString getId() const;
/**
* @brief Return the DelegateType of the event.
*
* @note While similar this is not the matrix event or message type. This is
* to tell a QML ListView what delegate to show for each event. So while
* similar to the spec it is not the same.
* @brief The MessageComponentType to use to visualise the main event content.
*/
DelegateType::Type getDelegateType() const;
MessageComponentType::Type messageComponentType() const;
/**
* @brief Get the author of the event in context of the room.
@@ -159,6 +137,22 @@ public:
*/
bool isHidden();
/**
* @brief The input format of the body in the message.
*
* I.e. if the message has only a body the format will be Qt::PlainText, if it
* has a formatted body it will be Qt::RichText.
*/
static Qt::TextFormat messageBodyInputFormat(const Quotient::RoomMessageEvent &event);
/**
* @brief Output a string for the room message content without any formatting.
*
* This is the content of the formatted_body key if present or the body key if
* not.
*/
static QString rawMessageBody(const Quotient::RoomMessageEvent &event);
/**
* @brief Output a string for the message content ready for display in a rich text field.
*
@@ -191,6 +185,13 @@ public:
*/
QString getPlainBody(bool stripNewlines = false) const;
/**
* @brief Output the original body for the message content, useful for editing the original message.
*
* The event type must be a room message event.
*/
QString getMarkdownBody() const;
/**
* @brief Output a generic string for the message content ready for display.
*
@@ -228,6 +229,7 @@ public:
* - width - The width in pixels of the audio media.
* - height - The height in pixels of the audio media.
* - tempInfo - mediaInfo (with the same properties as this except no tempInfo) for a temporary image while the file downloads.
* - isSticker - Whether the image is a sticker or not
*/
QVariantMap getMediaInfo() const;
@@ -242,13 +244,9 @@ public:
QString getReplyId() const;
/**
* @brief Return the DelegateType of the event replied to.
*
* @note While similar this is not the matrix event or message type. This is
* to tell a QML ListView what delegate to show for each event. So while
* similar to the spec it is not the same.
* @brief The MessageComponentType to use to visualise the reply content.
*/
DelegateType::Type getReplyDelegateType() const;
MessageComponentType::Type replyMessageComponentType() const;
/**
* @brief Get the author of the event replied to in context of the room.
@@ -323,6 +321,7 @@ public:
* - width - The width in pixels of the audio media.
* - height - The height in pixels of the audio media.
* - tempInfo - mediaInfo (with the same properties as this except no tempInfo) for a temporary image while the file downloads.
* - isSticker - Whether the image is a sticker or not
*/
QVariantMap getReplyMediaInfo() const;
@@ -404,11 +403,10 @@ private:
KFormat m_format;
DelegateType::Type getDelegateTypeForEvent(const Quotient::RoomEvent *event) const;
QString getBody(const Quotient::RoomEvent *event, Qt::TextFormat format, bool stripNewlines) const;
QString getMessageBody(const Quotient::RoomMessageEvent &event, Qt::TextFormat format, bool stripNewlines) const;
QVariantMap getMediaInfoForEvent(const Quotient::RoomEvent *event) const;
QVariantMap getMediaInfoFromFileInfo(const Quotient::EventContent::FileInfo *fileInfo, const QString &eventId, bool isThumbnail = false) const;
QVariantMap
getMediaInfoFromFileInfo(const Quotient::EventContent::FileInfo *fileInfo, const QString &eventId, bool isThumbnail = false, bool isSticker = false) const;
};

View File

@@ -74,6 +74,9 @@ void ImagePackEventContent::fillJson(QJsonObject *o) const
}
imageJson["usage"_ls] = usageJson;
}
if (image.info.has_value()) {
imageJson["info"_ls] = Quotient::EventContent::toInfoJson(*image.info);
}
imagesJson[image.shortcode] = imageJson;
}
(*o)["images"_ls] = imagesJson;

View File

@@ -89,6 +89,4 @@ public:
QUO_EVENT(ImagePackEvent, "im.ponies.room_emotes")
using KeyedStateEventBase::KeyedStateEventBase;
};
REGISTER_EVENT_TYPE(ImagePackEvent)
}

View File

@@ -40,5 +40,4 @@ public:
*/
QJsonArray allow() const;
};
REGISTER_EVENT_TYPE(JoinRulesEvent)
}

View File

@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <Quotient/events/simplestateevents.h>
namespace Quotient
{
// Defined so we can directly switch on type.
DEFINE_SIMPLE_STATE_EVENT(LocationBeaconEvent, "org.matrix.msc3672.beacon_info", QString, body, "body")
} // namespace Quotient

View File

@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <Quotient/events/simplestateevents.h>
namespace Quotient
{
// Defined so we can directly switch on type.
DEFINE_SIMPLE_STATE_EVENT(ServerAclEvent, "m.room.server_acl", bool, allow_ip_literals, "allow_ip_literals")
} // namespace Quotient

14
src/events/widgetevent.h Normal file
View File

@@ -0,0 +1,14 @@
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <Quotient/events/simplestateevents.h>
namespace Quotient
{
// Defined so we can directly switch on type.
DEFINE_SIMPLE_STATE_EVENT(WidgetEvent, "im.vector.modular.widgets", QString, name, "name")
} // namespace Quotient

36
src/fakerunner.cpp Normal file
View File

@@ -0,0 +1,36 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#include "fakerunner.h"
#include <QCoreApplication>
#include <QDBusMetaType>
Q_SCRIPTABLE RemoteActions FakeRunner::Actions()
{
QCoreApplication::quit();
return {};
}
Q_SCRIPTABLE RemoteMatches FakeRunner::Match(const QString &searchTerm)
{
QCoreApplication::quit();
return {};
}
Q_SCRIPTABLE void FakeRunner::Run(const QString &id, const QString &actionId)
{
QCoreApplication::quit();
}
FakeRunner::FakeRunner()
: QObject()
{
qDBusRegisterMetaType<RemoteMatch>();
qDBusRegisterMetaType<RemoteMatches>();
qDBusRegisterMetaType<RemoteAction>();
qDBusRegisterMetaType<RemoteActions>();
qDBusRegisterMetaType<RemoteImage>();
}
#include "moc_fakerunner.cpp"

31
src/fakerunner.h Normal file
View File

@@ -0,0 +1,31 @@
// SPDX-FileCopyrightText: 2024 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
#pragma once
#include <QDBusContext>
#include "runner.h"
/**
* This is a close-to-identical copy of the regular Runner interface,
* only used when activated for push notifications. This stubs it out so
* Plasma Search and Kickoff doesn't accidentally activate the push notification
* service.
*
* @sa Runner
*/
class FakeRunner : public QObject, protected QDBusContext
{
Q_OBJECT
Q_CLASSINFO("D-Bus Interface", "org.kde.krunner1")
public:
Q_SCRIPTABLE RemoteActions Actions();
Q_SCRIPTABLE RemoteMatches Match(const QString &searchTerm);
Q_SCRIPTABLE void Run(const QString &id, const QString &actionId);
FakeRunner();
};

View File

@@ -41,6 +41,12 @@ FileType::~FileType() noexcept
{
}
FileType &FileType::instance()
{
static FileType _instance;
return _instance;
}
QMimeType FileType::mimeTypeForName(const QString &nameOrAlias) const
{
Q_D(const FileType);
@@ -113,4 +119,10 @@ QStringList FileType::supportedAnimatedImageFormats() const
return d->supportedAnimatedImageFormats;
}
bool FileType::fileHasImage(const QUrl &file) const
{
const auto mimeType = mimeTypeForFile(file.toString());
return mimeType.isValid() && supportedImageFormats().contains(mimeType.preferredSuffix());
}
#include "moc_filetype.cpp"

View File

@@ -41,8 +41,13 @@ class FileType : public QObject
Q_PROPERTY(QStringList supportedAnimatedImageFormats READ supportedAnimatedImageFormats CONSTANT FINAL)
public:
explicit FileType(QObject *parent = nullptr);
~FileType();
static FileType &instance();
static FileType *create(QQmlEngine *engine, QJSEngine *)
{
engine->setObjectOwnership(&instance(), QQmlEngine::CppOwnership);
return &instance();
}
/**
* @brief Returns a MIME type for nameOrAlias or an invalid one if none found.
@@ -120,7 +125,11 @@ public:
QStringList supportedImageFormats() const;
QStringList supportedAnimatedImageFormats() const;
bool fileHasImage(const QUrl &file) const;
private:
explicit FileType(QObject *parent = nullptr);
const QScopedPointer<FileTypePrivate> d_ptr;
Q_DECLARE_PRIVATE(FileType)
Q_DISABLE_COPY(FileType)

56
src/foreigntypes.h Normal file
View File

@@ -0,0 +1,56 @@
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
// SPDX-License-Identifier: LGPL-2.0-or-later
#pragma once
#include <QQmlEngine>
#include <Quotient/accountregistry.h>
#include <Quotient/keyverificationsession.h>
#if __has_include("Quotient/e2ee/sssshandler.h")
#include <Quotient/e2ee/sssshandler.h>
#endif
#include "controller.h"
#include "neochatconfig.h"
struct ForeignConfig {
Q_GADGET
QML_FOREIGN(NeoChatConfig)
QML_NAMED_ELEMENT(Config)
QML_SINGLETON
public:
static NeoChatConfig *create(QQmlEngine *, QJSEngine *)
{
QQmlEngine::setObjectOwnership(NeoChatConfig::self(), QQmlEngine::CppOwnership);
return NeoChatConfig::self();
}
};
struct ForeignAccountRegistry {
Q_GADGET
QML_FOREIGN(Quotient::AccountRegistry)
QML_NAMED_ELEMENT(AccountRegistry)
QML_SINGLETON
public:
static Quotient::AccountRegistry *create(QQmlEngine *, QJSEngine *)
{
QQmlEngine::setObjectOwnership(&Controller::instance().accounts(), QQmlEngine::CppOwnership);
return &Controller::instance().accounts();
}
};
struct ForeignKeyVerificationSession {
Q_GADGET
QML_FOREIGN(Quotient::KeyVerificationSession)
QML_NAMED_ELEMENT(KeyVerificationSession)
QML_UNCREATABLE("")
};
#if __has_include("Quotient/e2ee/sssshandler.h")
struct ForeignSSSSHandler {
Q_GADGET
QML_FOREIGN(Quotient::SSSSHandler)
QML_NAMED_ELEMENT(SSSSHandler)
};
#endif

View File

@@ -8,34 +8,22 @@
#include <Quotient/events/roommessageevent.h>
#include "neochatconfig.h"
#include "neochatroom.h"
#include "neochatconnection.h"
#include "utils.h"
using namespace Quotient;
LinkPreviewer::LinkPreviewer(const NeoChatRoom *room, const Quotient::RoomMessageEvent *event)
: QObject(nullptr)
, m_currentRoom(room)
, m_event(event)
LinkPreviewer::LinkPreviewer(const QUrl &url, QObject *parent)
: QObject(parent)
, m_loaded(false)
, m_url(linkPreview(event))
, m_url(url)
{
connect(this, &LinkPreviewer::urlChanged, this, &LinkPreviewer::emptyChanged);
Q_ASSERT(dynamic_cast<Connection *>(this->parent()));
if (m_event != nullptr && m_currentRoom != nullptr) {
loadUrlPreview();
connect(m_currentRoom, &NeoChatRoom::urlPreviewEnabledChanged, this, &LinkPreviewer::loadUrlPreview);
// Make sure that we react to edits
connect(m_currentRoom, &NeoChatRoom::replacedEvent, this, [this](const Quotient::RoomEvent *newEvent) {
if (m_event->id() == newEvent->id()) {
m_event = eventCast<const Quotient::RoomMessageEvent>(newEvent);
m_url = linkPreview(m_event);
Q_EMIT urlChanged();
loadUrlPreview();
}
});
}
connect(this, &LinkPreviewer::urlChanged, this, &LinkPreviewer::emptyChanged);
connect(NeoChatConfig::self(), &NeoChatConfig::ShowLinkPreviewChanged, this, &LinkPreviewer::loadUrlPreview);
loadUrlPreview();
}
bool LinkPreviewer::loaded() const
@@ -65,14 +53,14 @@ QUrl LinkPreviewer::url() const
void LinkPreviewer::loadUrlPreview()
{
if (!m_currentRoom || !NeoChatConfig::showLinkPreview() || !m_currentRoom->urlPreviewEnabled()) {
return;
}
if (m_url.scheme() == QStringLiteral("https")) {
m_loaded = false;
Q_EMIT loadedChanged();
auto conn = m_currentRoom->connection();
auto conn = dynamic_cast<Connection *>(this->parent());
if (conn == nullptr) {
return;
}
GetUrlPreviewJob *job = conn->callApi<GetUrlPreviewJob>(m_url);
connect(job, &BaseJob::success, this, [this, job, conn]() {

View File

@@ -53,14 +53,15 @@ class LinkPreviewer : public QObject
Q_PROPERTY(QUrl imageSource READ imageSource NOTIFY imageSourceChanged)
/**
* @brief Whether the there is a link to preview.
* @brief Whether there is a link to preview.
*
* A linkPreviwer is empty if the URL is empty.
*/
Q_PROPERTY(bool empty READ empty NOTIFY emptyChanged)
public:
explicit LinkPreviewer(const NeoChatRoom *room = nullptr, const Quotient::RoomMessageEvent *event = nullptr);
LinkPreviewer() = default;
explicit LinkPreviewer(const QUrl &url, QObject *parent = nullptr);
[[nodiscard]] QUrl url() const;
[[nodiscard]] bool loaded() const;
@@ -76,18 +77,6 @@ public:
*/
static bool hasPreviewableLinks(const Quotient::RoomMessageEvent *event);
private:
const NeoChatRoom *m_currentRoom;
const Quotient::RoomMessageEvent *m_event;
bool m_loaded;
QString m_title = QString();
QString m_description = QString();
QUrl m_imageSource = QUrl();
QUrl m_url;
void loadUrlPreview();
/**
* @brief Return the link to be previewed from the given event.
*
@@ -96,6 +85,15 @@ private:
*/
static QUrl linkPreview(const Quotient::RoomMessageEvent *event);
private:
bool m_loaded;
QString m_title = QString();
QString m_description = QString();
QUrl m_imageSource = QUrl();
QUrl m_url;
void loadUrlPreview();
Q_SIGNALS:
void loadedChanged();
void titleChanged();

23
src/login/CMakeLists.txt Normal file
View File

@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
# SPDX-License-Identifier: BSD-2-Clause
qt_add_library(login STATIC)
qt_add_qml_module(login
URI org.kde.neochat.login
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/login
QML_FILES
WelcomePage.qml
LoginStep.qml
Captcha.qml
Email.qml
Homeserver.qml
Loading.qml
Login.qml
LoginMethod.qml
LoginRegister.qml
Password.qml
RegisterPassword.qml
Sso.qml
Terms.qml
Username.qml
)

View File

@@ -20,7 +20,7 @@ LoginStep {
url: "http://localhost:20847"
implicitHeight: 500
onLoadingChanged: {
webview.runJavaScript("document.body.style.background = '" + Kirigami.Theme.backgroundColor + "'")
webview.runJavaScript("document.body.style.background = '" + Kirigami.Theme.backgroundColor + "'");
}
Timer {
@@ -29,20 +29,20 @@ LoginStep {
running: true
interval: 300
onTriggered: {
if(!webview.visible) {
return
if (!webview.visible) {
return;
}
webview.runJavaScript("!!grecaptcha ? grecaptcha.getResponse() : \"\"", function(response){
if(!webview.visible || !response)
return
webview.runJavaScript("!!grecaptcha ? grecaptcha.getResponse() : \"\"", function (response) {
if (!webview.visible || !response)
return;
timer.running = false;
Registration.recaptchaResponse = response;
})
});
}
}
}
}
previousAction: Kirigami.Action {
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
onTriggered: root.processed("Username")
}
}

View File

@@ -12,7 +12,9 @@ import org.kde.neochat
LoginStep {
id: root
onActiveFocusChanged: if (activeFocus) emailField.forceActiveFocus()
onActiveFocusChanged: if (activeFocus) {
emailField.forceActiveFocus();
}
FormCard.FormTextFieldDelegate {
id: emailField
@@ -21,7 +23,7 @@ LoginStep {
onTextChanged: Registration.email = text
Keys.onReturnPressed: {
if (root.nextAction.enabled) {
root.nextAction.trigger()
root.nextAction.trigger();
}
}
}
@@ -44,15 +46,15 @@ LoginStep {
enabled: emailField.text.length > 0
onTriggered: {
if (confirmMessage.visible) {
Registration.registerAccount()
Registration.registerAccount();
} else {
Registration.registerEmail()
confirmMessage.visible = true
resendButton.visible = true
Registration.registerEmail();
confirmMessage.visible = true;
resendButton.visible = true;
}
}
}
previousAction: Kirigami.Action {
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml")
onTriggered: root.processed("Username")
}
}

View File

@@ -12,7 +12,9 @@ import org.kde.neochat
LoginStep {
id: root
onActiveFocusChanged: if (activeFocus) urlField.forceActiveFocus()
onActiveFocusChanged: if (activeFocus) {
urlField.forceActiveFocus();
}
FormCard.FormTextFieldDelegate {
id: urlField
@@ -24,7 +26,7 @@ LoginStep {
statusMessage: Registration.status === Registration.ServerNoRegistration ? i18n("Registration is disabled on this server.") : ""
Keys.onReturnPressed: {
if (root.nextAction.enabled) {
root.nextAction.trigger()
root.nextAction.trigger();
}
}
}
@@ -38,9 +40,9 @@ LoginStep {
nextAction: Kirigami.Action {
text: Registration.testing ? i18n("Loading") : null
enabled: Registration.status > Registration.ServerNoRegistration
onTriggered: root.processed("qrc:/org/kde/neochat/qml/Username.qml");
onTriggered: root.processed("Username")
}
previousAction: Kirigami.Action {
onTriggered: root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml")
onTriggered: root.processed("LoginRegister")
}
}

View File

@@ -23,7 +23,7 @@ LoginStep {
Connections {
target: Controller
function onConnectionAdded(connection) {
connection.syncDone.connect(() => root.closeDialog())
connection.syncDone.connect(() => root.closeDialog());
}
}
}

View File

@@ -13,10 +13,11 @@ import org.kde.neochat
LoginStep {
id: root
onActiveFocusChanged: if (activeFocus) matrixIdField.forceActiveFocus()
onActiveFocusChanged: if (activeFocus)
matrixIdField.forceActiveFocus()
Component.onCompleted: {
LoginHelper.matrixId = ""
LoginHelper.matrixId = "";
}
FormCard.FormTextFieldDelegate {
@@ -25,30 +26,30 @@ LoginStep {
placeholderText: "@user:example.org"
Accessible.name: i18n("Matrix ID")
onTextChanged: {
LoginHelper.matrixId = text
LoginHelper.matrixId = text;
}
Keys.onReturnPressed: {
root.nextAction.trigger()
root.nextAction.trigger();
}
}
nextAction: Kirigami.Action {
text: LoginHelper.isLoggedIn ? i18n("Already logged in") : (LoginHelper.testing && matrixIdField.acceptableInput) ? i18n("Loading…") : i18nc("@action:button", "Continue")
text: LoginHelper.isLoggedIn ? i18n("Already logged in") : (LoginHelper.testing && matrixIdField.acceptableInput) ? i18n("Loading…") : i18nc("@action:button", "Continue")
onTriggered: {
if (LoginHelper.supportsSso && LoginHelper.supportsPassword) {
processed("qrc:/org/kde/neochat/qml/LoginMethod.qml");
processed("LoginMethod");
} else if (LoginHelper.supportsSso) {
processed("qrc:/org/kde/neochat/qml/Sso.qml");
processed("Sso");
} else {
processed("qrc:/org/kde/neochat/qml/Password.qml");
processed("Password");
}
}
enabled: LoginHelper.homeserverReachable
}
previousAction: Kirigami.Action {
onTriggered: {
root.processed("qrc:/org/kde/neochat/qml/LoginRegister.qml")
root.processed("LoginRegister");
}
}
}

View File

@@ -11,17 +11,19 @@ import org.kde.neochat
LoginStep {
id: root
onActiveFocusChanged: if (activeFocus) loginPasswordButton.forceActiveFocus()
onActiveFocusChanged: if (activeFocus) {
loginPasswordButton.forceActiveFocus();
}
FormCard.FormButtonDelegate {
id: loginPasswordButton
text: i18nc("@action:button", "Login with password")
onClicked: processed("qrc:/org/kde/neochat/qml/Password.qml")
onClicked: processed("Password")
}
FormCard.FormButtonDelegate {
id: loginSsoButton
text: i18nc("@action:button", "Login with single sign-on")
onClicked: processed("qrc:/org/kde/neochat/qml/Sso.qml")
onClicked: processed("Sso")
}
}

View File

@@ -11,7 +11,9 @@ import org.kde.neochat
LoginStep {
id: root
onActiveFocusChanged: if (activeFocus) loginButton.forceActiveFocus(Qt.TabFocusReason)
onActiveFocusChanged: if (activeFocus) {
loginButton.forceActiveFocus(Qt.TabFocusReason);
}
Layout.fillWidth: true
@@ -20,13 +22,13 @@ LoginStep {
FormCard.FormButtonDelegate {
id: loginButton
text: i18nc("@action:button", "Login")
onClicked: root.processed("qrc:/org/kde/neochat/qml/Login.qml")
onClicked: root.processed("Login")
}
FormCard.FormDelegateSeparator {}
FormCard.FormButtonDelegate {
text: i18nc("@action:button", "Register")
onClicked: root.processed("qrc:/org/kde/neochat/qml/Homeserver.qml")
onClicked: root.processed("Homeserver")
}
}

Some files were not shown because too many files have changed in this diff Show More