Compare commits

...

414 Commits

Author SHA1 Message Date
l10n daemon script
e82a5c9442 GIT_SILENT Sync po/docbooks with svn 2024-11-02 03:06:39 +00:00
l10n daemon script
896e09bb5b GIT_SILENT Sync po/docbooks with svn 2024-11-01 03:05:02 +00:00
l10n daemon script
52747355a4 GIT_SILENT Sync po/docbooks with svn 2024-10-31 03:06:09 +00:00
l10n daemon script
01f1d655e5 GIT_SILENT made messages (after extraction) 2024-10-31 02:30:41 +00:00
Heiko Becker
4b7011fe14 GIT_SILENT Update Appstream for new release 2024-10-31 01:14:18 +01:00
Heiko Becker
5550091046 GIT_SILENT Upgrade release service version to 24.08.3. 2024-10-31 00:14:30 +01:00
l10n daemon script
fc2e751af9 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-10-30 03:02:21 +00:00
l10n daemon script
36137a036c GIT_SILENT made messages (after extraction) 2024-10-29 02:30:53 +00:00
l10n daemon script
e0f3d544f0 GIT_SILENT Sync po/docbooks with svn 2024-10-27 03:16:17 +00:00
James Graham
eb802ff91f Cherry pick compatability changes for libquotient 0.9
Title
2024-10-26 07:47:15 +00:00
l10n daemon script
0e697fc7e3 GIT_SILENT Sync po/docbooks with svn 2024-10-25 03:08:02 +00:00
Soumyadeep Ghosh
89d546f291 snap: add snap package 2024-10-18 16:40:52 +00:00
l10n daemon script
c0324d53e5 GIT_SILENT Sync po/docbooks with svn 2024-10-15 03:04:07 +00:00
l10n daemon script
25084ed46d GIT_SILENT Sync po/docbooks with svn 2024-10-11 03:18:49 +00:00
l10n daemon script
e274e09bbc 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-10-11 03:14:33 +00:00
l10n daemon script
389016f126 GIT_SILENT made messages (after extraction) 2024-10-11 02:41:20 +00:00
l10n daemon script
e270f553a3 GIT_SILENT Sync po/docbooks with svn 2024-10-10 03:04:09 +00:00
l10n daemon script
a0fef7b397 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-10-10 03:01:02 +00:00
l10n daemon script
588266d7c3 Additional po sync 2024-10-09 11:01:45 +00:00
l10n daemon script
258e799138 GIT_SILENT made messages (after extraction) 2024-10-09 02:29:41 +00:00
l10n daemon script
73cd253e25 GIT_SILENT Sync po/docbooks with svn 2024-10-07 03:04:36 +00:00
l10n daemon script
eee81329a4 GIT_SILENT made messages (after extraction) 2024-10-07 02:28:56 +00:00
Tobias Fella
9b425e5a54 Fix for not rendering html in replies
The proper fix on master branch isn't suitable to be backported
2024-10-06 22:14:22 +02:00
Tobias Fella
fb83d5cff8 Fix compilation
(cherry picked from commit a769b904dc)
2024-10-06 22:14:22 +02:00
Tobias Fella
21cabeb20c Fix compilation against changes in libQuotient
(cherry picked from commit f156551d4f)
2024-10-06 22:14:22 +02:00
Tobias Fella
bed04cc59f Adapt to libQuotient changes
(cherry picked from commit 3e1044b8fd)
2024-10-06 22:14:22 +02:00
Carl Schwan
18db04d073 Unify redaction handling
The code in messageeventmodel was calling to EventHandler::getBody who
already handles reaction handlings

(cherry picked from commit 16b27700f5)
2024-10-06 22:14:22 +02:00
Carl Schwan
0f05c1b921 Escape html from redaction message
(cherry picked from commit 9ee10b6968)
2024-10-06 22:14:14 +02:00
Heiko Becker
765292e0e9 GIT_SILENT Update Appstream for new release 2024-10-06 22:02:21 +02:00
Heiko Becker
7c27308a59 GIT_SILENT Upgrade release service version to 24.08.2. 2024-10-06 20:00:19 +02:00
l10n daemon script
b574e68164 GIT_SILENT Sync po/docbooks with svn 2024-10-06 03:06:57 +00:00
l10n daemon script
66d16dd16b 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-10-06 03:04:21 +00:00
l10n daemon script
b1c810c242 GIT_SILENT Sync po/docbooks with svn 2024-09-26 03:06:29 +00:00
l10n daemon script
8f0b3a16f1 GIT_SILENT Sync po/docbooks with svn 2024-09-24 03:32:05 +00:00
l10n daemon script
043519784b GIT_SILENT Sync po/docbooks with svn 2024-09-23 03:06:07 +00:00
Carl Schwan
aafe42c4cc Ensure floating buttons have correct size on mobile
(cherry picked from commit 42dd2e5413)

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2024-09-22 13:18:36 +00:00
Carl Schwan
d9b9b18872 Make sure that m_components cannot be accessed out of bounds in closeLinkPreview
https://crash-reports.kde.org/organizations/kde/issues/67352/?project=18&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=5


(cherry picked from commit f89cec9c55)

53f949e6 Make sure that m_components cannot be accessed out of bounds in closeLinkPreview
34b847cb Add warning

Co-authored-by: James Graham <james.h.graham@protonmail.com>
2024-09-22 13:16:39 +00:00
Carl Schwan
18e26c9e3a Fix NeoChatRoom::directChatRemoteMember
- Don't access member that's not there
- Use NeoChatRoomMember instead of RoomMember

BUG: 492733


(cherry picked from commit 2a5359e73b)

Co-authored-by: Tobias Fella <fella@posteo.de>
2024-09-22 13:14:59 +00:00
Carl Schwan
19c93e9d82 Fix crash in MessageContentModel
(cherry picked from commit 52ab6f484b)

Co-authored-by: Tobias Fella <fella@posteo.de>
2024-09-22 13:14:37 +00:00
Carl Schwan
af6187706e Fix display name in verification message
Previously this would be undefined and i18n doesn't handle this very
well


(cherry picked from commit fad4e506bc)

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2024-09-21 13:27:00 +00:00
l10n daemon script
bf18fcbbba GIT_SILENT Sync po/docbooks with svn 2024-09-19 03:08:37 +00:00
l10n daemon script
ee5502d7bf GIT_SILENT Sync po/docbooks with svn 2024-09-17 03:16:26 +00:00
l10n daemon script
d8d6a4ef3b GIT_SILENT Sync po/docbooks with svn 2024-09-16 03:30:14 +00:00
Carl Schwan
2803c6fd58 Fix filtering users in the member list
(cherry picked from commit 5c04eb85af)

Co-authored-by: Tobias Fella <fella@posteo.de>
2024-09-15 21:02:05 +00:00
Carl Schwan
f2f6406403 Don't open a room by default on mobile
Since the room window is fullscreen on mobile and you can't see the room list,
the first thing you'll be doing is backing out so you can choose the actual room you want to see


(cherry picked from commit 17da652152)

Co-authored-by: Bart Ribbers <bribbers@disroot.org>
2024-09-15 20:59:12 +00:00
Claire Elford
63dc8a5857 Fix increasing font size of certain emojis
Before this commit, NeoChat has two methods of detecting whether or not a piece
of text was an emoji. One is through a regex, and the other is by using the ICU
library. The two methods are used in different parts of the code.

This commit removes the regex detector and instead uses ICU for all the places
where NeoChat needs to figure out whether or not a string is an emoji. This
fixes increasing the font size for messages that only consist of emoji when
certain emoji are used that the regex did not handle (such as the transgender
symbol and transgender flag emojis).

(cherry picked from commit f7533a454c)
2024-09-15 22:59:54 +02:00
Carl Schwan
3dafc62f04 Use autoTransform on images
closes network/neochat#674


(cherry picked from commit 38cfc915f1)

533130b5 Use autoTransform on images

Co-authored-by: James Graham <james.h.graham@protonmail.com>
2024-09-15 10:22:08 +00:00
l10n daemon script
5be112e0e2 GIT_SILENT Sync po/docbooks with svn 2024-09-12 03:02:17 +00:00
Joshua Goins
b15ee49691 Web Shortcuts: kcmshell5 does not exist anymore on Plasma 6
This is hardcoded, but it's probably a safe assumption to think most
people running modern NeoChat are using Plasma 6 anyway.

(cherry picked from commit aa116a35f5)
2024-09-08 03:53:04 -04:00
l10n daemon script
fa5872ec5a GIT_SILENT Sync po/docbooks with svn 2024-09-08 03:08:01 +00:00
l10n daemon script
54061c744f GIT_SILENT Sync po/docbooks with svn 2024-09-07 03:06:04 +00:00
Heiko Becker
b6dac3bbdf GIT_SILENT Update Appstream for new release 2024-09-07 00:48:45 +02:00
Heiko Becker
3a838596c5 GIT_SILENT Upgrade release service version to 24.08.1. 2024-09-06 23:53:24 +02:00
l10n daemon script
cc22e80adc GIT_SILENT Sync po/docbooks with svn 2024-09-03 03:03:24 +00:00
Joshua Goins
1c0a5edd2e LocationHelper: Move clamp from zoomToFit to QML
The OSM plugin has a different zoom tolerance than what we're hardcoding
here. This fixes the map looking funky from being too zoomed while
trying to fit multiple location points at once.

(cherry picked from commit 15d6287995)
2024-09-02 09:28:15 -04:00
Joshua Goins
47408d536d AuthorDelegate: Don't make empty space clickable
(cherry picked from commit 4b7cbf37d5)
2024-09-02 09:28:15 -04:00
Joshua Goins
fc21eea7e7 AuthorDelegate: Add pointing hand cursor to indicate you can tap
It's not immediately obvious that you can press on this static text to
bring up the user's details. This isn't a problem with the avatar - for
example - because it has a pointing hand cursor. Let's do the same here.

(cherry picked from commit 0ccfe7d991)
2024-09-02 09:28:15 -04:00
Joshua Goins
ca95eb3505 Make the SectionDelegate look just a little bit better
This has insets on it - probably from qqc2-desktop-style - and makes it
look extremely bad when scrolling through messages as the background
size doesn't match. Now the insets are set to zero, except for topInset.
This is done to work around a visual bug where you can see a one-pixel
line right above the SectionDelegate when scrolling.

(cherry picked from commit ab5585cd06)
2024-09-02 09:28:15 -04:00
l10n daemon script
639cbed343 GIT_SILENT Sync po/docbooks with svn 2024-09-02 03:05:11 +00:00
l10n daemon script
be3cffaf3a GIT_SILENT Sync po/docbooks with svn 2024-09-01 03:05:11 +00:00
l10n daemon script
7af520d0ae GIT_SILENT Sync po/docbooks with svn 2024-08-30 03:10:58 +00:00
l10n daemon script
d145177014 GIT_SILENT Sync po/docbooks with svn 2024-08-28 03:30:02 +00:00
l10n daemon script
75aa2c0e8d 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-08-28 03:20:31 +00:00
l10n daemon script
7eda952aa2 GIT_SILENT Sync po/docbooks with svn 2024-08-25 03:09:56 +00:00
Tobias Fella
22d0d84fee Fix pending indicator 2024-08-24 17:42:11 +02:00
Tobias Fella
941a724381 Use plaintext for reply author component
(cherry picked from commit aeb566746a)
2024-08-24 17:33:48 +02:00
Tobias Fella
7e880c6663 Don't run QtKeychain job in a nested event loop
Doing that causes deadlocks and there's no need for it here

(cherry picked from commit 8da567d9fa)
2024-08-24 17:33:44 +02:00
Tobias Fella
22315b810c Adapt to libQuotient API change
(cherry picked from commit d99f69cc24)
2024-08-24 17:33:37 +02:00
Tobias Fella
d0c41d5224 Ensure that room list does not show rooms without title during startup
There's a brief moment during startup where the model knows about the rooms, but their state
is not loaded, which makes them show up in the room list with ugly fallback titles.
To prevent this, we delay closing the welcome page until the basestate is loaded.

(cherry picked from commit bd1d4289c0)
2024-08-24 17:33:30 +02:00
Andreas Sturmlechner
a7e06375fd Include missing ECMQmlModule
Amends bc67033c00 and e0c3a1c143

No idea why this isn't caught by CI, but it fails for me otherwise.

Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
(cherry picked from commit 22743b6d8b)
2024-08-24 12:24:15 +02:00
l10n daemon script
e638f61ff1 GIT_SILENT Sync po/docbooks with svn 2024-08-22 03:20:42 +00:00
l10n daemon script
2218b39a50 GIT_SILENT Sync po/docbooks with svn 2024-08-20 03:27:56 +00:00
Tobias Fella
b34936a017 Re-add pending event indicator
This seems to have been accidentally removed

BUG: 491277
(cherry picked from commit 776807580a)
2024-08-18 15:37:08 +02:00
l10n daemon script
5b3e650854 GIT_SILENT Sync po/docbooks with svn 2024-08-16 03:04:39 +00:00
Heiko Becker
86d85c6ce7 GIT_SILENT Update Appstream for new release 2024-08-16 00:35:00 +02:00
Heiko Becker
863e20394a GIT_SILENT Upgrade release service version to 24.08.0. 2024-08-15 23:34:44 +02:00
l10n daemon script
908dcea75e GIT_SILENT made messages (after extraction) 2024-08-11 02:34:30 +00:00
l10n daemon script
c59d5bc75d 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-08-10 03:12:41 +00:00
l10n daemon script
ff4ba4df9c GIT_SILENT made messages (after extraction) 2024-08-10 02:39:29 +00:00
l10n daemon script
0c1494e74a 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-08-09 03:01:15 +00:00
Albert Astals Cid
18d4da8b42 GIT_SILENT Upgrade release service version to 24.07.90. 2024-08-08 10:00:41 +02:00
l10n daemon script
9680cbbb38 GIT_SILENT Sync po/docbooks with svn 2024-08-06 03:07:30 +00:00
l10n daemon script
3b5ba470b6 GIT_SILENT Sync po/docbooks with svn 2024-08-04 03:12:15 +00:00
l10n daemon script
e1066aede2 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-08-04 03:08:29 +00:00
l10n daemon script
2bf4ed26f0 GIT_SILENT Sync po/docbooks with svn 2024-08-03 03:09:58 +00:00
l10n daemon script
b460b588a8 GIT_SILENT Sync po/docbooks with svn 2024-08-02 03:10:44 +00:00
l10n daemon script
05270c38bf GIT_SILENT Sync po/docbooks with svn 2024-07-31 03:05:10 +00:00
l10n daemon script
18afad83db GIT_SILENT Sync po/docbooks with svn 2024-07-30 03:09:21 +00:00
Tobias Fella
d390433b2b Show time without seconds in timeline
(cherry picked from commit 2df2e39d43)
2024-07-29 18:00:10 +02:00
Tobias Fella
0017be1c0f Show time without timezone in tooltip
Constructing the timezone string is relatively heavy and is done for each delegate, even when the tooltip is never shown

(cherry picked from commit 42cec7d5ba)
2024-07-29 18:00:08 +02:00
l10n daemon script
63eda3796d GIT_SILENT Sync po/docbooks with svn 2024-07-29 03:09:38 +00:00
l10n daemon script
3246076a0b GIT_SILENT Sync po/docbooks with svn 2024-07-28 03:10:41 +00:00
James Graham
e905cdd151 Cherrypick: Create NeochatRoomMember as a shim for RoomMember
The intention is that NeochatRoomMember can be created passed to QML and then be fully managed by it. It effectively just grabs the current RoomMember, calls the correct function then discards it so that we don't end up trying to access an already deleted state event.


(cherry picked from commit 11fd4f88ec)

a2a8ad09 Create NeochatRoomMember as a shim for RoomMember so it can be safely passed to QML
0867eef5 Fix showAuthor
0f72ccd0 Mamange the creation of NeochatRoomMembers and only create one per member rather than event.
dba88fe2 REmove getAuthor as no longer needed
4e3a61d1 Update include
32d4d9f7 Pass NeochatRoomMembers rather than RoomMembers to menus
8e4b2034 Don't leak memory
c2f2bb26 Fix code component regression.
5aee89be Make sure the sender Id is intialised properly for pending events
c10c2677 Tweak intialisation
b3146034 Make sure event objects are created for new pending events
e4fab6d9 Pass an empty NeochatRoomMember when not in the map

Co-authored-by: James Graham <james.h.graham@protonmail.com>
2024-07-27 09:33:14 +00:00
l10n daemon script
0372074beb GIT_SILENT Sync po/docbooks with svn 2024-07-27 03:10:43 +00:00
Joshua Goins
09e97f2bdb Make the "Unignore this user" button work on the Ignored Users page
This function now takes a QString. This should be fine to use since it's
in the 0.8.2 release which we require.

(cherry picked from commit 9a4504ce61)
2024-07-26 19:09:57 +00:00
Joshua Goins
8e324c16f3 Fix the emoji page not doing anything
This is yet more stuff broken due to referencing a implicit pageStack
that no longer exists.


(cherry picked from commit cb8ed02e82)

Co-authored-by: Joshua Goins <josh@redstrate.com>
2024-07-26 19:00:47 +00:00
Joshua Goins
2bb55eece7 Don't flag invite notifications as persistent
These really don't need to be persistent, as they even stick around
when NeoChat is closed. This also spams the user's notification system
usually, if they get lots of invitations at once which don't go away
automatically.

(cherry picked from commit 51197d7c1a)
2024-07-25 16:38:13 -04:00
Joshua Goins
2877e40647 Hint that the user can auto-reject invitations on the invite page
This should help make the new setting more discoverable.

(cherry picked from commit 2a2a2e0c05)
2024-07-25 16:38:13 -04:00
Joshua Goins
768ec242fa Allow blocking invites from people you don't share a room with
Matrix currently has a significant moderation loophole, thanks to
invites. Right now, anyone can invite anyone to a room - and clients
like NeoChat will gladly display these rooms to them and even give you
a notification.

However, this creates a pretty easy attack since room names and avatars
are arbitrary and this is a known vector of harassment in the Matrix
community. There's currently no tools to block this server-side, so
let's try to improve the situation where we can.

This adds a new setting to the Security page, wherein it allows you to
block invites from people you don't share a room with. This prevents the
notification from appearing and NeoChat will attempt to leave the room
immediately.

Since this depends on MSC 2666 - a currently unstable feature - the
server may not support it and NeoChat will disable the setting in this
case.

(cherry picked from commit 07fee30cc0)
2024-07-25 16:38:13 -04:00
Joshua Goins
194751627f Don't display notifications for invite rooms
Sometimes a ghost notification will appear, this is sometimes a stray
m.room.invite notification we didn't handle or some other event. Let's
outright reject all notifications from Invite-type rooms to prevent this
from happening altogether.

(cherry picked from commit 83c6ce0ace)
2024-07-25 16:38:13 -04:00
l10n daemon script
bc701c51d9 GIT_SILENT Sync po/docbooks with svn 2024-07-25 03:13:15 +00:00
l10n daemon script
35939b4af4 GIT_SILENT Sync po/docbooks with svn 2024-07-23 03:14:18 +00:00
l10n daemon script
a178b8b6ca 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-07-23 03:04:52 +00:00
Albert Astals Cid
a6994318de GIT_SILENT Upgrade release service version to 24.07.80. 2024-07-21 12:25:07 +02:00
l10n daemon script
5022ed1a63 GIT_SILENT Sync po/docbooks with svn 2024-07-21 01:27:43 +00:00
James Graham
799ffa18c4 Fix the javascript when using .? 2024-07-20 22:35:41 +00:00
Tobias Fella
6323e27040 Remove customemojimodel_p.h
It's been unused for a long time
2024-07-20 22:49:22 +02:00
Tobias Fella
03acb26109 Fix some clazy warnings 2024-07-20 22:38:45 +02:00
Tobias Fella
34fc1f6a6b Fix text alignment in ReadMarkerDelegate 2024-07-20 21:54:55 +02:00
James Graham
042032ec46 Update user sort
Update the user model so it also sorts by power level and update how we initialize the model to improve performance.

The following is also changed:
- Store a single `UserListModel` in `RoomManager` and use it for everything, this means we don't create extra models (incluiding the long initialisation for each in big rooms)
- By using the single model once it has loaded the users of the new room opening and closing the draw now happens instantly (previously the model would have to be loaded every time the drawer was opened).
- To stop the initial loading and room change of Neochat slowing down (as the `UserListModel` would be loaded before the `TimelineView` is shown) the initialisation of the model is delayed until the `TimelineView` has loaded. This prioritises showing some messages in the timeline over populating the model so in large rooms the user list will initially be blank, but this keeps the initial load snappier.
2024-07-20 18:12:30 +00:00
James Graham
73de99f661 Create a list model for readmarkers
Create a list model for read markers. The primary reason is to stop `RoomMembers` being accessed after their state event is deleted. With this the read marker doesn't pass and `RoomMember` objects to qml.
2024-07-20 18:05:15 +00:00
l10n daemon script
cc068f9ebb GIT_SILENT Sync po/docbooks with svn 2024-07-19 01:26:38 +00:00
l10n daemon script
2bfc2b1944 GIT_SILENT Sync po/docbooks with svn 2024-07-18 01:23:41 +00:00
l10n daemon script
029936112f GIT_SILENT made messages (after extraction) 2024-07-18 00:39:13 +00:00
Andreas Gattringer
d5e400e8a4 stop video on destruction to avoid segfault 2024-07-17 11:08:53 +00:00
Andreas Gattringer
9dbb9c3f3b fix filedownload on maximized view and context menu
- move the logic for remembering local filenames from
  messagecontentmodel to neochatroom
- use it also when maximized and in context menu opening, to stop
  re-downloading
- make onFileTransferCompleted signal connection one-shot (stops memory
  leak)
2024-07-17 08:29:29 +00:00
l10n daemon script
a101e6b0a7 GIT_SILENT Sync po/docbooks with svn 2024-07-17 01:24:34 +00:00
Andreas Gattringer
c525ea55ce fix typo in PollComponent that causes polls to not be checked correctly 2024-07-16 21:41:25 +02:00
Andreas Gattringer
8ca45f298f show thumbail when video is stopped 2024-07-16 12:27:35 +02:00
Andreas Gattringer
cb4c6cb677 Audio filename, caption and seeking
- display caption independent of filename (consistancy to File)
- fix audio seeking not working
- change two comments and a variable name
2024-07-16 12:27:35 +02:00
Andreas Gattringer
d574a97a35 take the correct filename for synthax highlighting in code block 2024-07-16 12:27:35 +02:00
Andreas Gattringer
20f9a86ad9 stop assigning undefined to bool in TimelineView and MessageDelegate 2024-07-16 12:27:35 +02:00
Andreas Gattringer
a4a411cf1f correctly display filename in MimeComponents
(previously it would include the caption text and save with it as
filename)
Don't append filename to the caption.

Relevant spec: https://spec.matrix.org/latest/client-server-api/#mfile
2024-07-16 12:27:35 +02:00
Andreas Gattringer
029bda5734 fix code preview components
- fix them vanishing after "opening" a file (they get downloaded to
  /tmp/ without extension, which caused them to lose preview)
- make all text/plain mimetype files preview
- don't show them in Replies (in consistency with media components)
2024-07-16 12:27:35 +02:00
Andreas Gattringer
0fd578e6aa Refactor MimeComponent
- Fix size and duration not showing in MimeComponents in replies
- Display Itinerary in replies as MimeComponent (in consistency with media
  components)
2024-07-16 12:27:35 +02:00
l10n daemon script
95e1bee5e6 GIT_SILENT Sync po/docbooks with svn 2024-07-16 01:23:40 +00:00
Tobias Fella
c8dc10f311 Don't escape display name for leave events in subtitle 2024-07-15 22:04:32 +02:00
l10n daemon script
a00f4e393b GIT_SILENT Sync po/docbooks with svn 2024-07-15 01:26:14 +00:00
l10n daemon script
5a7dea8857 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-07-15 01:18:59 +00:00
Andreas Gattringer
27e8970fff fix segfault at loadError from message with attached file 2024-07-14 19:46:04 +00:00
Andreas Gattringer
7848274ba1 fix resetting of message content components
and don't reset whole Moessage content when author changes
2024-07-14 18:25:02 +02:00
l10n daemon script
145bf0298b GIT_SILENT Sync po/docbooks with svn 2024-07-14 01:23:33 +00:00
James Graham
0392a33b54 Content Model Author
Make sure that the Author in the content model is only ever updated int he following circumstacnes:
- The member updates their displayname or avatar
- A previously hidden author line is shown

This is done by only doing a full reset on initialisation or when a previously hidden author is shown. The rest of the time we only reset the other content in the message, i.e. everything below the author line.
2024-07-13 16:01:42 +00:00
Andreas Gattringer
b211f46e3e Do heavy things less often on room change event 2024-07-13 15:22:52 +00:00
James Graham
709711c3ca Fix the InlineMessages for the room upgrades in RoomSettings
Fix the InlineMessages for the room upgrades in RoomSettings, they should show even if we aren't currently in the room. Resolve resource can join the predecessor/sucessor if required.

Closes network/neochat#618
2024-07-13 15:14:50 +00:00
l10n daemon script
841607406f GIT_SILENT Sync po/docbooks with svn 2024-07-13 01:25:56 +00:00
Andreas Gattringer
70b726b04d reset currentRoom before opening last room of connection 2024-07-12 07:41:25 +00:00
l10n daemon script
2799248106 GIT_SILENT Sync po/docbooks with svn 2024-07-12 01:24:11 +00:00
Carl Schwan
2321299084 Pass ApplicationWindow to AccountMenu 2024-07-11 20:55:04 +00:00
Andreas Gattringer
aa00773a3b update only position of HoverActions when contentY of TimelineView
changes
2024-07-11 14:06:58 +02:00
l10n daemon script
733de1d0e1 GIT_SILENT Sync po/docbooks with svn 2024-07-11 01:24:16 +00:00
Tobias Fella
c16e4ad412 Fix opening pages from account menu 2024-07-10 21:39:15 +02:00
l10n daemon script
d1cf7a07f1 GIT_SILENT Sync po/docbooks with svn 2024-07-10 01:25:42 +00:00
James Graham
8751f6fea7 Never refresh the author role except when a member updated signal is generated. This should remove a potential source of crashes where a RoomMember object tries to access an already deleted room member state event 2024-07-09 20:21:13 +01:00
Andreas Gattringer
ea1b577ec7 fix room settings not opening from RoomDrawerPage, by launching it according to RoomDrawer 2024-07-09 10:49:18 +02:00
l10n daemon script
a41afa70eb GIT_SILENT Sync po/docbooks with svn 2024-07-08 01:23:33 +00:00
Tobias Fella
e11c97cdc0 Move NeoChatRoom::showMessage to Controller
It doesn't fit into NeoChatRoom conceptually
2024-07-07 13:44:55 +02:00
l10n daemon script
d76e44512e GIT_SILENT Sync po/docbooks with svn 2024-07-07 01:24:08 +00:00
l10n daemon script
fd1931377d 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-07-07 01:17:56 +00:00
James Graham
68ce6c4ed7 It seems like it's possible for contentModel.Author to be accessed before the contentModel is set so make sure this fails nicely 2024-07-06 20:05:16 +00:00
Carl Schwan
a2ee330307 Use new SearchDialog from Kirigami 2024-07-06 18:16:43 +00:00
Tobias Fella
c3a17f951e Only enable taphandler for mouse clicks
BUG: 486545
2024-07-06 20:11:21 +02:00
Nicolas Fella
443c0f34d7 Rework Add Server dialog
Use plain items instead of FormCard delegate items, this isn't a FormCard

Set placeholder text for textfield

Remove redundant subtitle

Use inlinemessage for errors

Before:

![image.png](/uploads/375d3c668271f6bce699cc9462f6deb9/image.png){width=405 height=247}

After:

![image.png](/uploads/b8d79a4fdb0914d1f82ecec0760ad80f/image.png){width=404 height=234}
2024-07-06 18:10:34 +00:00
Tobias Fella
8725600368 Port away from deprecated QDateTime constructor 2024-07-06 20:00:04 +02:00
Tobias Fella
3b83b7f190 Set Qt policy 4 2024-07-06 20:00:04 +02:00
Tobias Fella
e0c3a1c143 Port to ecm_add_qml_module 2024-07-06 19:50:20 +02:00
Tobias Fella
bec1ad7bee Fix crashes when logging out of connection 2024-07-06 19:44:00 +02:00
Tobias Fella
9e6c00f78c Fix logout from account menu 2024-07-06 19:28:54 +02:00
Tobias Fella
abbbd9d705 Use RoomMember object for code component 2024-07-06 16:27:08 +02:00
Tobias Fella
4a5c012f05 Fix avatar in chatbar 2024-07-06 16:22:03 +02:00
Tobias Fella
319862b3d4 Fix avatars in full window image view 2024-07-06 16:20:16 +02:00
Tobias Fella
1fcf58024d Fix avatars in CodeMaximizeComponent 2024-07-06 16:18:49 +02:00
Tobias Fella
9db162d0fc Fix avatar in state delegates 2024-07-06 16:16:44 +02:00
Tobias Fella
13b15390c3 Fix crashes due to event being deleted 2024-07-06 15:54:29 +02:00
l10n daemon script
799b62e9d2 GIT_SILENT Sync po/docbooks with svn 2024-07-06 01:25:14 +00:00
Tobias Fella
d91ed535ad Don't access event after it was deleted
- NeoChat stores pointer to event
- Event is replaced
- libQuotient deletes the event and notifies us that the event changes
- We're accessing the event to check its id
- Boom

Make this not boom by accessing the ID that we're additionally storing anyway.
2024-07-05 16:54:38 +02:00
l10n daemon script
c48b9874bf GIT_SILENT Sync po/docbooks with svn 2024-07-04 01:22:48 +00:00
l10n daemon script
6a788f6c32 GIT_SILENT Sync po/docbooks with svn 2024-07-03 01:26:09 +00:00
Tobias Fella
53519a604e Don't store member objects in userlistmodel 2024-07-02 18:17:27 +02:00
l10n daemon script
2818b87f02 GIT_SILENT Sync po/docbooks with svn 2024-07-02 01:24:50 +00:00
l10n daemon script
50e10133b9 GIT_SILENT Sync po/docbooks with svn 2024-07-01 01:23:04 +00:00
James Graham
068161719e Update author documentation now we've moved to RoomMember 2024-06-30 17:59:40 +01:00
James Graham
c8d5d095e0 REmove unneeded includes 2024-06-30 17:59:40 +01:00
James Graham
52d07320ef Make the author line in the bubble and reply be part of the content model 2024-06-30 17:59:40 +01:00
Tobias Fella
158b9ea2ca Fix opening QR code 2024-06-30 18:06:57 +02:00
James Graham
6a100bfbab When switching rooms first set the room to nullptr to clear any objects in MessageEventModel and UserListModel 2024-06-30 14:24:21 +00:00
Tobias Fella
b3bd6ee176 Fix showing avatar image in HiddenDelegate 2024-06-30 15:53:02 +02:00
Tobias Fella
04696b27eb Use type for member property 2024-06-30 15:53:02 +02:00
Tobias Fella
332937dbc1 Register RoomMember as foreign type 2024-06-30 15:52:45 +02:00
l10n daemon script
92d932ce5c GIT_SILENT Sync po/docbooks with svn 2024-06-30 01:25:04 +00:00
Carl Schwan
af3c4f536a Fix dev tools 2024-06-29 18:03:43 +02:00
Carl Schwan
b98ca5af52 Use SpellcheckingConfigurationModule 2024-06-29 18:03:43 +02:00
Carl Schwan
a15a11f44b Rework config dialog
Use new KirigamiAddons ConfigurationsView as a replacement for
CategorizedSettings. Fix some issues on desktop when running Qt 6.8
and some less recent issues on mobile.

Visually this looks the same.
2024-06-29 18:03:40 +02:00
Tobias Fella
1460132772 Fix typing indicator 2024-06-29 17:30:29 +02:00
Tobias Fella
76d68bb3e4 Fix tests 2024-06-29 17:30:29 +02:00
Tobias Fella
08df0ebbea user details dialog fixes 2024-06-29 17:30:29 +02:00
Tobias Fella
e918db2cc1 Port away from function that we can't use yet 2024-06-29 17:30:29 +02:00
James Graham
2e0dc8db94 Make sure that the member objects get updated for the MessageEventModel and MessageContentModel when the user updates their avatar or name 2024-06-29 17:30:29 +02:00
James Graham
b78a9f2a9c Find users by Id in UserListModel as there may be users with the same display name which will end up with the wrong member replaced 2024-06-29 17:30:28 +02:00
James Graham
832e6b9de0 Make sure that the member object gets switched when a member's avatar or name is updated because the old state event will now be deleted and we need to ref the new one. 2024-06-29 17:30:28 +02:00
James Graham
feec7ca408 Don't store RoomMembers in ReactionModel
Don't store RoomMember objects in the reaction model just grab them everytime incase the state event is replaced.
2024-06-29 17:30:28 +02:00
James Graham
408f0a12e2 Use new libquotient functionality to encrypt direct chats by default
Needs https://github.com/quotient-im/libQuotient/pull/730
2024-06-29 17:30:28 +02:00
James Graham
35ab4e6e09 Use updated membersTyping functions from libquotient 2024-06-29 17:30:28 +02:00
James Graham
430bafafe7 Make use of new RoomMember item from libquotient
Depends on https://github.com/quotient-im/libQuotient/pull/695

Currently basic just to show a working implementation using RoomMember. Currently only the room event and search models are moved over. Will change everything else over once the dependent pr is complete.
2024-06-29 17:30:28 +02:00
James Graham
58d727350d Remove uses of Quotient:Omittable
Note this technically won't build for now because of the lack of RoomMember support but I'll push that at the quotient-next branch next. 

This is needed as well to get a branch that builds on dev.
2024-06-29 17:30:04 +02:00
l10n daemon script
c6a4057659 GIT_SILENT Sync po/docbooks with svn 2024-06-29 01:24:06 +00:00
Heiko Becker
60ac806690 GIT_SILENT Update Appstream for new release
(cherry picked from commit c00debf1c3)
2024-06-28 23:18:10 +02:00
James Graham
e9263fc596 Use the new libquotient version of the serveracl event
Use with https://github.com/quotient-im/libQuotient/pull/729
2024-06-28 15:02:56 +02:00
Tobias Fella
3dd28a0382 Unconditionally use SSSS 2024-06-28 14:33:23 +02:00
l10n daemon script
066cb8184e GIT_SILENT Sync po/docbooks with svn 2024-06-28 01:33:31 +00:00
l10n daemon script
373e22b999 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-06-28 01:20:45 +00:00
Tobias Fella
fd8725f649 Add basic cross-signing support
(cherry picked from commit e1795076c8c41a34b91c31df35d1e344d0b14887)
2024-06-27 18:51:38 +02:00
Tobias Fella
3d433762b1 Fix ifs for ssss 2024-06-27 18:23:29 +02:00
Tobias Fella
ea4cb5bf62 Disable FreeBSD CI 2024-06-27 18:08:47 +02:00
Tobias Fella
a6ca3b8203 Require libQuotient 0.8.2 2024-06-27 18:08:28 +02:00
l10n daemon script
bc4ceb6d52 GIT_SILENT Sync po/docbooks with svn 2024-06-27 01:26:42 +00:00
l10n daemon script
24480229cd GIT_SILENT Sync po/docbooks with svn 2024-06-26 01:25:49 +00:00
l10n daemon script
8b10573197 GIT_SILENT Sync po/docbooks with svn 2024-06-25 01:23:09 +00:00
l10n daemon script
cbc81e8285 GIT_SILENT Sync po/docbooks with svn 2024-06-24 01:22:01 +00:00
Tobias Fella
0b9a978061 Update global menu 2024-06-23 21:09:33 +02:00
l10n daemon script
e974e5d13b GIT_SILENT Sync po/docbooks with svn 2024-06-23 01:25:25 +00:00
l10n daemon script
5a42e86bf6 GIT_SILENT Sync po/docbooks with svn 2024-06-22 01:29:39 +00:00
l10n daemon script
889946e186 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-06-22 01:19:19 +00:00
l10n daemon script
5c47e8044e GIT_SILENT made messages (after extraction) 2024-06-22 00:39:08 +00:00
l10n daemon script
1a974ac305 GIT_SILENT Sync po/docbooks with svn 2024-06-21 01:23:47 +00:00
Tobias Fella
db1bf61805 GlobalMenu: remove shortcut for QuickSwitcher
The shortcut needs to work when there is no Global Menu, so it's also in QuickSwitcher.qml.
It can't be in both places, since that breaks it. So we remove it here.

BUG: 488212
2024-06-20 18:14:36 +02:00
Tobias Fella
5456b4a7ff Fix global menu 2024-06-20 18:03:42 +02:00
l10n daemon script
a08ffaae77 GIT_SILENT Sync po/docbooks with svn 2024-06-20 01:27:52 +00:00
l10n daemon script
18445f55f0 GIT_SILENT Sync po/docbooks with svn 2024-06-19 01:24:36 +00:00
Albert Astals Cid
2daf3b5c4b CI: Disable requiring Windows tests passing
Has been broken for 4 consecutive weeks
2024-06-18 22:42:00 +02:00
l10n daemon script
923b844212 GIT_SILENT Sync po/docbooks with svn 2024-06-18 01:29:17 +00:00
James Lyne
0aec9f8472 Fix search results on room search page
Add missing IsEditable role to search model
2024-06-17 20:15:36 +00:00
l10n daemon script
23b0c8a143 GIT_SILENT Sync po/docbooks with svn 2024-06-17 01:25:34 +00:00
l10n daemon script
3c2c2e2bd8 GIT_SILENT Sync po/docbooks with svn 2024-06-16 01:24:54 +00:00
l10n daemon script
c1465a7368 GIT_SILENT Sync po/docbooks with svn 2024-06-14 01:22:57 +00:00
l10n daemon script
be1dadab74 GIT_SILENT Sync po/docbooks with svn 2024-06-13 01:23:33 +00:00
Derry Tutt
1cba39eae9 Update strings to be more clear for the average user 2024-06-12 19:37:39 +00:00
Tobias Fella
a0c8bdf021 Make notifications more useful
- Refactor and cleanup code
- Don't paginate through notifications - it spams the server with requests and realistically only contains anything relevant on startup after a long time, in which case you're going to lose some notification anyway
- Only show newest notification for the respective room, closing the old notification if one exists
- Only show text of this notification

BUG: 475228
2024-06-12 21:28:09 +02:00
l10n daemon script
6fdb22a5b5 GIT_SILENT Sync po/docbooks with svn 2024-06-12 01:26:41 +00:00
l10n daemon script
19c370a273 GIT_SILENT made messages (after extraction) 2024-06-12 00:38:48 +00:00
Tobias Fella
861336ea97 Remove unnecessary check 2024-06-11 21:48:56 +02:00
l10n daemon script
24219bcb03 GIT_SILENT Sync po/docbooks with svn 2024-06-11 01:29:06 +00:00
Tobias Fella
77ed762e2c Use plaintext for room aliases 2024-06-10 22:20:37 +02:00
l10n daemon script
d45b6cb03d GIT_SILENT Sync po/docbooks with svn 2024-06-10 01:35:39 +00:00
Heiko Becker
9a921b2e0d GIT_SILENT Update Appstream for new release
(cherry picked from commit c5c47d7b67)
2024-06-10 00:48:21 +02:00
l10n daemon script
c17e213e11 GIT_SILENT Sync po/docbooks with svn 2024-06-09 01:23:44 +00:00
Joshua Goins
6275d7afaa Switch from QQC2.ApplicationWindow.overlay to QQC2.Overlay.overlay
Closes #648
2024-06-08 11:47:30 -04:00
Joshua Goins
364eda6400 Fix keyboard navigation on search pages
Some of our search pages (such as the room and user search) has a list
header item. Due to how this works, it's not actually a part of the
list view keyboard navigation and a whole separate item. So in the tab
order, it comes *after* the list view which makes no sense. And it's
part of the list view, so users must expect it to be selectable with the
up and down arrows like other items.

This simple change makes it so it behaves as expected. The first actual
list item is selected by default, but it's possible to navigate to the
list header item via the up arrow key and then return to the list view
using the down arrow. The list header item is also removed from the tab
order and the whole page is much nicer to use now.
2024-06-08 15:44:38 +00:00
Joshua Goins
ccf34cfe20 The "Search Room" action should be called "Search Rooms" 2024-06-08 15:42:10 +00:00
Joshua Goins
7daae6a2d9 Fix the tooltips for the two drawer buttons at the top
One of them didn't even have a tooltip, which is a simple oversight
since it already has accessible text. The tooltips now use the attached
property instead of creating a new QQC2.ToolTip too.
2024-06-08 15:42:10 +00:00
Joshua Goins
277a4ad124 Fix keyboard navigation in space drawer
Some of the items were able to activated via the keyboard, but many were
not like the notifications and "create a space" buttons. This is because
the signals were hooked up to onClicked but the accessible and keyboard
nav were hooked up to onSelected. All of the buttons trigger their
actions with onSelected now.
2024-06-08 15:32:37 +00:00
Joshua Goins
b11d46e34a Add keyboard navigation for server selection in room search dialog
This was previously not keyboard navigable at all, making it
impossible to switch servers in this dialog solely with a keyboard. This
patch makes it possible to do some basic selection but not deletion yet,
but it's a good start.
2024-06-08 15:32:26 +00:00
Joshua Goins
e8ad0a055d Remove room member highlight on click
Previously it was possible to keep clicking and highlighting each member
which doesn't make any sense. We could make this exclusive by having it
highlight only when index == currentIndex, but honestly it doesn't need
to be highlighted at all. Clicking on a room member opens their user
card, there's no persistent state the user needs to keep track of here.
2024-06-08 11:25:49 -04:00
Joshua Goins
8a8c745d77 Use Qt.alpha in ThemeRadioButton
This was newly added in Qt6 and simplifies a Qt.rgba call we used here.
2024-06-08 14:35:09 +00:00
Joshua Goins
a523fe7674 Add focus border for the theme radio button, used on the Appearance page
Otherwise it's impossible to tell which option you're on, if you're
solely using a keyboard.
2024-06-08 14:35:09 +00:00
Joshua Goins
dc9a150929 Fix QR code not showing when tapping the button under account settings 2024-06-08 14:34:58 +00:00
Joshua Goins
be66ffef0f Fix map copyright link activation
The argument was missing, so it wasn't possible to actually click and
visit the copyright notices linked on maps.
2024-06-08 14:34:48 +00:00
Joshua Goins
f278cc0c86 Don't show the map if there's no locations available
It's hard to the read the text when there's a beige map behind it, and
unnecessary anyway.
2024-06-08 14:34:48 +00:00
Nicolas Fella
7f72808a9a Fixup AttachDialog
Use standard spacing values

Use implicit button size
2024-06-08 14:34:40 +00:00
Joshua Goins
1d5297c0f0 Rename the header for room actions "Actions" instead of "Options"
These aren't really configurable options in the usual sense, but rather
actions you can take in the room.
2024-06-08 14:34:21 +00:00
Joshua Goins
e40528ba45 Use a more natural sounding action name for favoriting the room
"Make room favorite" doesn't sound very natural in English, but
"Favorite this room" is and fits in with the rest of the actions here.
2024-06-08 14:34:21 +00:00
Tobias Fella
29972b5867 Port away from commitSingleShot 2024-06-08 15:43:16 +02:00
James Graham
91109ca845 Get 3PID binds on startup
Get binds on startup and update the staus properly after bind/unbinding 3PIDs
2024-06-08 08:42:34 +00:00
l10n daemon script
8e5ccb5461 GIT_SILENT Sync po/docbooks with svn 2024-06-08 01:27:06 +00:00
l10n daemon script
8a75967953 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-06-08 01:19:18 +00:00
l10n daemon script
3f4965b182 GIT_SILENT made messages (after extraction) 2024-06-08 00:39:04 +00:00
l10n daemon script
2ac266029c GIT_SILENT Sync po/docbooks with svn 2024-06-07 01:22:56 +00:00
l10n daemon script
3261231d07 GIT_SILENT made messages (after extraction) 2024-06-07 00:38:46 +00:00
l10n daemon script
95ce6385b0 GIT_SILENT Sync po/docbooks with svn 2024-06-05 01:36:19 +00:00
Volker Krause
64c5894602 Fix notifyrc file location 2024-06-04 15:01:54 +00:00
l10n daemon script
8c4839c300 GIT_SILENT Sync po/docbooks with svn 2024-06-04 01:22:51 +00:00
l10n daemon script
80c2bc1a52 GIT_SILENT Sync po/docbooks with svn 2024-06-03 01:23:01 +00:00
l10n daemon script
bcd417e039 GIT_SILENT Sync po/docbooks with svn 2024-06-02 01:24:06 +00:00
l10n daemon script
ac216f697f GIT_SILENT Sync po/docbooks with svn 2024-06-01 01:24:07 +00:00
l10n daemon script
9893fae27c 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-06-01 01:18:01 +00:00
l10n daemon script
cb183efa66 GIT_SILENT made messages (after extraction) 2024-06-01 00:39:03 +00:00
Carl Schwan
87d707bc21 CreateRoomDialog: Add missing formcard separators 2024-05-31 10:38:47 +00:00
James Graham
227ebd610a Support binding 3PIDs
Closes network/neochat#565
2024-05-31 09:25:42 +00:00
James Graham
ab4af48e52 Integrate NeoChatMaximizeComponent with MediaManger
Needs libraries/kirigami-addons!227

Closes network/neochat#641
2024-05-31 09:01:13 +00:00
l10n daemon script
78a8227219 GIT_SILENT Sync po/docbooks with svn 2024-05-31 01:31:41 +00:00
l10n daemon script
ec73a53101 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-05-31 01:19:16 +00:00
l10n daemon script
3fb1d086b7 GIT_SILENT Sync po/docbooks with svn 2024-05-30 01:24:46 +00:00
l10n daemon script
5d4a12c127 GIT_SILENT Sync po/docbooks with svn 2024-05-29 01:36:10 +00:00
Carl Schwan
d2a79214b5 Fix crash when sending message
Ensure the message has an eventId which only happens after the message
is sent.
2024-05-28 15:21:04 +02:00
Laurent Montel
db57111188 Use 6.7 image 2024-05-28 06:49:38 +02:00
l10n daemon script
b22276bcd5 GIT_SILENT Sync po/docbooks with svn 2024-05-28 01:22:05 +00:00
Tobias Fella
6e2d85f2d2 Add some Q_UNUSEDs 2024-05-27 20:06:28 +02:00
James Graham
efb72652ce Use MessageContentModel for replies
This allows code and other components to be displayed nicely.
2024-05-27 14:54:42 +00:00
l10n daemon script
3615c3e8e5 GIT_SILENT Sync po/docbooks with svn 2024-05-27 01:25:06 +00:00
Nicolas Fella
8186ee0e3f Add missing dependencies to QML modules 2024-05-26 16:15:57 +02:00
Nicolas Fella
74aa14c011 Make org.kde.neochat import all submodules
This way we don't need to explicitly import the various submodules and instead only import org.kde.neochat
2024-05-26 16:15:43 +02:00
l10n daemon script
aa68369f95 GIT_SILENT Sync po/docbooks with svn 2024-05-26 01:22:22 +00:00
Laurent Montel
7837364b86 Add missing include moc 2024-05-25 18:38:20 +00:00
James Graham
31f0e39617 Convert TimelineDelegate to cpp
There are 2 main reason for doing this:
1. Because I can, I wanted to see if I could do it
2. It gets rid of the janky qml re parenting stuff so should be faster.
2024-05-25 17:06:13 +00:00
James Graham
a48151920d Permission model
Add a model for managing permissions (power levels) in rooms. This gets rid of a whole bunch of boiler plate in NeoChat and as a bonus makes it easy to add a feature to allow setting the permission level for any event.
2024-05-25 16:25:39 +00:00
Tobias Fella
8199653ddd Use simpler and less restrictive server url regex
The old regex was too restrictive. The new one will allow invalid urls, but we don't gain anything from preventing that

BUG: 486888
2024-05-25 15:00:12 +02:00
Tobias Fella
9d650519c7 Don't suggest joining the last opened room when neochat is started after the cache was cleared 2024-05-25 14:45:45 +02:00
l10n daemon script
a545eaca97 GIT_SILENT Sync po/docbooks with svn 2024-05-25 01:25:23 +00:00
James Graham
9da9de2d2d Make sure to ask before leaving a room
Make sure to ask before leaving a room

BUG: 486546
2024-05-24 08:12:26 +00:00
James Graham
c9ddd9d513 Improve the behaviour of jump to last unread message.
Improve the behaviour of jump to last unread message. The view will now jump as high as possible if the last unread message isn't loaded. This at least triggers more items to load which will eventually get the user to the last unread message.
2024-05-24 07:55:05 +00:00
Carl Schwan
415cfd57e7 Use standard Dialog background for emoji dialog 2024-05-22 10:00:51 +00:00
l10n daemon script
b1ede93cdb 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-05-22 01:19:14 +00:00
l10n daemon script
32df465c8a GIT_SILENT made messages (after extraction) 2024-05-22 00:39:06 +00:00
l10n daemon script
2f1c5df11d GIT_SILENT Sync po/docbooks with svn 2024-05-21 01:29:24 +00:00
l10n daemon script
f85f6a7fdc GIT_SILENT Sync po/docbooks with svn 2024-05-20 01:24:20 +00:00
l10n daemon script
93cc80a4b3 GIT_SILENT Sync po/docbooks with svn 2024-05-19 01:24:46 +00:00
Heiko Becker
0f3e401d42 GIT_SILENT Update Appstream for new release
(cherry picked from commit c66c035dbb)
2024-05-17 00:50:28 +02:00
l10n daemon script
a9f2c33053 GIT_SILENT Sync po/docbooks with svn 2024-05-16 01:36:22 +00:00
l10n daemon script
c5ef8c3fec 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-05-16 01:17:33 +00:00
l10n daemon script
ad696bd60b GIT_SILENT Sync po/docbooks with svn 2024-05-15 01:23:49 +00:00
Tobias Fella
9da7462f3e Fix compatibility with newer quotient job api 2024-05-14 16:50:38 +02:00
l10n daemon script
0ecdf354c6 GIT_SILENT Sync po/docbooks with svn 2024-05-14 01:25:59 +00:00
l10n daemon script
67f10632fb GIT_SILENT Sync po/docbooks with svn 2024-05-13 01:27:15 +00:00
l10n daemon script
044b910357 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-05-13 01:17:24 +00:00
James Graham
3de943e50f Set Identity server
Part of network/neochat#565
2024-05-12 18:22:27 +00:00
James Graham
1a2272249d Support adding 3 PIDs
Implements part of network/neochat#565

Note the phone number stuff is untested as neither kde.org or matrix.org have them switched on.
2024-05-12 17:02:09 +00:00
James Graham
0dfeec6cae Make sure that the link preview sizes correctly so that there is no bubble overflow 2024-05-12 13:13:11 +00:00
l10n daemon script
8d193021ab GIT_SILENT Sync po/docbooks with svn 2024-05-12 01:30:54 +00:00
Carl Schwan
f45226a680 Port all confirm dialogs to Kirigami.PromptDialog 2024-05-10 12:54:13 +00:00
l10n daemon script
40d55805ff GIT_SILENT Sync po/docbooks with svn 2024-05-10 01:24:43 +00:00
l10n daemon script
7d6d0b012b GIT_SILENT Sync po/docbooks with svn 2024-05-09 01:29:36 +00:00
l10n daemon script
d7d2c6bf01 GIT_SILENT made messages (after extraction) 2024-05-09 00:39:06 +00:00
Akseli Lahtinen
ce1c6096d3 Check for tagToken length
Sometimes this part of the code causes segfault for me.

I don't know what the root cause is though, it's *very* random. I guess the tagToken should always be long enough, but sometimes it's just one character.
2024-05-08 19:41:39 +00:00
l10n daemon script
8c4ea6180a GIT_SILENT Sync po/docbooks with svn 2024-05-08 01:30:36 +00:00
l10n daemon script
95649ba758 GIT_SILENT Sync po/docbooks with svn 2024-05-07 01:25:20 +00:00
l10n daemon script
2b61f2a9e8 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-05-07 01:16:57 +00:00
Tobias Fella
47242aa66c Remove remaining uses of MatrixImageProvider and remove it 2024-05-06 18:18:48 +02:00
Tobias Fella
31a8abe615 Don't use applicationWindow() for loading key verification sessions 2024-05-06 15:54:50 +02:00
Tobias Fella
4dae3c34b4 Move HoverLinkIndicator to separate file 2024-05-06 15:54:49 +02:00
Tobias Fella
65aa8919b9 Port ConfirmUrlDialog away from applicationWindow() 2024-05-06 15:54:49 +02:00
Tobias Fella
acf8eac0d4 Cleanup JoinRoomDialog 2024-05-06 15:54:49 +02:00
Tobias Fella
e8aa29d3c2 Move direct chat confirmation dialog to separate file 2024-05-06 15:54:49 +02:00
Tobias Fella
a36194afe2 Remove unused component 2024-05-06 15:54:49 +02:00
Tobias Fella
8554898e45 Move consent sheet to separate file 2024-05-06 15:54:46 +02:00
l10n daemon script
55b29f645b GIT_SILENT Sync po/docbooks with svn 2024-05-06 01:25:56 +00:00
l10n daemon script
52cc91ba3e GIT_SILENT made messages (after extraction) 2024-05-06 00:38:19 +00:00
Tobias Fella
c9e3a9f8fe Add back include 2024-05-05 21:56:00 +02:00
Tobias Fella
c3de788956 Cleanup includes 2024-05-05 21:49:43 +02:00
Tobias Fella
53e3c36f7e Explicitely include QFont 2024-05-05 21:33:47 +02:00
Tobias Fella
20908107a0 Remove unused includes 2024-05-05 21:21:43 +02:00
l10n daemon script
cbe1a0d6f8 GIT_SILENT Sync po/docbooks with svn 2024-05-05 01:26:11 +00:00
Tobias Fella
7d8c79ec57 Remove unused include 2024-05-04 11:27:30 +02:00
Tobias Fella
9bb89c728f Move KUnifiedPush include to source file 2024-05-04 11:22:00 +02:00
Tobias Fella
be2e28cc53 Cleanup API 2024-05-04 11:17:45 +02:00
Tobias Fella
57be57971d Remove unused include 2024-05-04 11:17:08 +02:00
Tobias Fella
64eed47f04 Port some things away from Omittable 2024-05-04 10:56:12 +02:00
l10n daemon script
7659105fda GIT_SILENT Sync po/docbooks with svn 2024-05-04 01:33:07 +00:00
Carl Schwan
18c9376992 Fix micro spacing inconsistency in SpaceHierarchyDelegate
Exposing index allows RoundedItemDelegate to use a consistent padding
for the first and last item in the listview.
2024-05-04 00:36:34 +02:00
Tobias Fella
3a4aca7fbd Fix module 2024-05-03 22:40:32 +02:00
Tobias Fella
85ff8cdd4a Fix spacing of HiddenDelegate 2024-05-03 14:57:18 +02:00
l10n daemon script
b1048cb84a GIT_SILENT Sync po/docbooks with svn 2024-05-03 01:24:47 +00:00
l10n daemon script
ff9cf9abf6 GIT_SILENT Sync po/docbooks with svn 2024-05-02 01:23:33 +00:00
l10n daemon script
157c84663d GIT_SILENT Sync po/docbooks with svn 2024-05-01 01:23:12 +00:00
Tobias Fella
908e4fb5a4 Add test for room creation 2024-04-30 23:37:33 +02:00
Tobias Fella
fdca7d58e5 Push ImageEditorPage using pushDialogLayer
BUG: 486315
2024-04-30 23:36:17 +02:00
Tobias Fella
2eb26d512b Fix opening room on mobile 2024-04-30 22:05:22 +02:00
Tobias Fella
b7fdf7d60f Port away from qstr 2024-04-30 21:39:13 +02:00
Tobias Fella
2a1e66468d Fix if X11 on apple 2024-04-30 21:28:38 +02:00
Tobias Fella
cd7faf751e Show captions 2024-04-30 20:28:53 +02:00
Bart De Vries
d79d806cda Add "No Proxy" option to proxy settings 2024-04-30 20:19:22 +02:00
Bart De Vries
cae389c04c Make neochat obey the system-wide proxy settings 2024-04-30 20:19:22 +02:00
Tobias Fella
4e6850a60c Adapt to behavior change in libQuotient 2024-04-30 17:37:22 +02:00
l10n daemon script
a71f8cf358 GIT_SILENT Sync po/docbooks with svn 2024-04-30 01:24:36 +00:00
Carl Schwan
fe6ff9b2b6 Cleanup quick switcher
- Make it modal
- Fix spacing
- Use bottom separator instead of frame for search field
2024-04-29 16:54:25 +00:00
l10n daemon script
5a0f3e474d GIT_SILENT Sync po/docbooks with svn 2024-04-29 01:25:09 +00:00
Nate Graham
cd9c4239b1 Revert "Preserve mx-reply in the edited message if it exists"
This reverts commit fa57db8e83, because it
caused the last message you replied to to be shown as a reply in every
subsequent message you send, but they're only visible to people using
clients that aren't NeoChat, so you don't immediately realize that
you're causing pandemonium in your chatrooms.
2024-04-28 08:05:52 -06:00
James Graham
0cf1d87b12 Fix the master show link preview setting and add back the per room setting
Title

BUG: 486126
2024-04-28 10:51:44 +00:00
l10n daemon script
99d91c1e07 GIT_SILENT Sync po/docbooks with svn 2024-04-28 01:21:04 +00:00
l10n daemon script
457f80bc9b GIT_SILENT Sync po/docbooks with svn 2024-04-27 01:20:24 +00:00
Tobias Fella
968e3fc23b Cleanup Main.qml 2024-04-26 22:59:06 +02:00
Tobias Fella
b1e338579d Port UserConsentSheet to Kirigami.Dialog 2024-04-26 22:51:48 +02:00
Tobias Fella
7e4361bb5e Fix AddServerSheet 2024-04-26 19:11:03 +02:00
l10n daemon script
dd35fa3d91 GIT_SILENT Sync po/docbooks with svn 2024-04-26 01:20:19 +00:00
Tobias Fella
affb911d97 Create QML module for chatbar 2024-04-25 23:02:59 +02:00
Tobias Fella
785f9cd1b6 Fix some warnings 2024-04-25 22:57:24 +02:00
Tobias Fella
419056f098 Fix QML warnings 2024-04-25 22:56:28 +02:00
Tobias Fella
396db18de2 Fix unqualified access 2024-04-25 22:53:16 +02:00
Tobias Fella
f124721cd9 Fix qmlls warning 2024-04-25 22:52:38 +02:00
Tobias Fella
52e49b49fb Remove unnecessary parent 2024-04-25 22:51:59 +02:00
Tobias Fella
10e03777e9 Fix qmlls warning 2024-04-25 22:48:55 +02:00
Tobias Fella
27538b72e9 Remove unused imports 2024-04-25 22:48:20 +02:00
Tobias Fella
19ace37a75 Fix HoverLinkIndicator warnings 2024-04-25 22:47:55 +02:00
Tobias Fella
90c5377ef0 Port direct chat confirmation dialog away from OverlaySheet 2024-04-25 22:47:17 +02:00
Tobias Fella
f0e3d3e474 Fix some dialog parenting 2024-04-25 22:46:03 +02:00
Tobias Fella
26064ebf8c Remove stray log statement 2024-04-25 22:34:40 +02:00
Tobias Fella
1d92b74131 Use escaped room name in ConfirmLeaveDialog 2024-04-25 22:30:53 +02:00
l10n daemon script
5f83c137d2 GIT_SILENT Sync po/docbooks with svn 2024-04-25 01:21:47 +00:00
Joshua Goins
fa57db8e83 Preserve mx-reply in the edited message if it exists 2024-04-24 19:03:28 +00:00
Joshua Goins
9d3c2e19f5 Strip replies when calling EventHandler::getMarkdownBody()
This matches previous behavior before
e2eb6ab33c and including the markdown
blockquote breaks edits. This also adds a test to ensure it does indeed
get stripped.
2024-04-24 19:03:28 +00:00
l10n daemon script
46a9600d55 GIT_SILENT Sync po/docbooks with svn 2024-04-24 01:29:43 +00:00
James Graham
de40701cf6 Multiple Link Previews
- Show a preview for each link in the text below the block in which it appears.
- Allow link previews to be dismissed
2024-04-23 19:45:33 +00:00
Tobias Fella
307536c6b6 Use escaped title in devtools 2024-04-23 13:27:15 +02:00
Tobias Fella
203be8bd35 Work around QML opening dialog in wrong window 2024-04-23 13:24:00 +02:00
Tobias Fella
1e644587b3 Replace Quotient::Connection with NeoChatConnection where possible 2024-04-23 12:35:15 +02:00
James Graham
66a60f09e3 Refactor the MessageComponentModel component update 2024-04-23 11:39:18 +02:00
Tobias Fella
69b6f16ec1 Remove search bar; Use QuickSwitcher instead 2024-04-23 10:19:43 +02:00
l10n daemon script
10b4274a3d GIT_SILENT Sync po/docbooks with svn 2024-04-23 01:29:16 +00:00
James Graham
28c9d94457 Fix Roomlist Shortcuts
Fix the ctrl + pgup/pgdwn shortcuts for the room list so that they work with tree model

BUG: 485949
2024-04-22 22:01:46 +00:00
Tobias Fella
d74fd1a560 Force author display name in HiddenDelegate to PlainText 2024-04-22 23:14:31 +02:00
James Graham
624b1b06c5 Make the SpaceDrawer navigable with the keyboard. 2024-04-22 18:18:15 +02:00
Carl Schwan
95376c2ccc Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: Carl Schwan <carl@carlschwan.eu>
2024-04-22 14:58:44 +00:00
James Graham
1eb622165b Use AvatarButton in UserInfo instead of a custom button. This has the advantage of showing keyboard focus properly 2024-04-22 16:50:56 +02:00
Nate Graham
9d6ba324fb Use more appropriate icons and tooltips for the room info drawer handles
Right now they use the standard text but left and right arrow icons,
which is a bit odd, and I think fails to convey what will happen when
clicked especially whern the drawer is closed.

Instead, let's use descriptive tooltip text for both, and a descriptive
icon for the the "this will open the drawer" handle button. For the one
to close the drawer, the default icon seems better, so let's stop
overriding it.
2024-04-22 08:10:39 +00:00
l10n daemon script
d462852ab9 GIT_SILENT Sync po/docbooks with svn 2024-04-22 01:28:36 +00:00
l10n daemon script
eeec81898b 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-22 01:15:14 +00:00
James Graham
ab0c8b8170 Use new cornerRadius Kirigami unit across the app 2024-04-21 19:19:57 +02:00
James Graham
91d295e0bb Make sure that tab can be used to navigate away from the chatbar 2024-04-21 17:18:12 +00:00
James Graham
125974dd7a Add Carl's focus title hack as a devtool option 2024-04-21 17:02:26 +00:00
Tobias Fella
92895a7d00 Improve CodeComponent background 2024-04-21 18:21:54 +02:00
Nate Graham
d9308440e6 Make the "add new" menu button a hamburger menu
I know hamburger menus sometimes aren't amazing, but the current icon is
misleading. It's a plus button which generally means "create new".
However the menu is full of actions not related to creating new things,
including:

- Explore Rooms
- Find your Friends
- Scan a QR Code

These actions may technically result in a new room appearing in the
sidebar, but that's not a user's definition of creating a new thing;
these are *joining* a thing, and the fact that a new entry appears in
the sidebar is an implementation detail.

As a result the existing icon is inaccurate, and also holds back the
menu from adding additional items in the future that are even less
related to creating new rooms. An example would be the quick room
switcher, which is not exposed visibly in the UI anywhere, and could not
logically live in the current menu without changing its icon and text.
2024-04-21 15:07:29 +00:00
James Graham
5340142c06 Change actionChanged to notificationActionChanged
Change actionChanged to notificationActionChanged to avoid any clashes with ItemDelegate action property signals
2024-04-21 14:37:02 +00:00
James Graham
012d30ee9f Elide the Hidden delegate text 2024-04-21 13:33:00 +02:00
James Graham
031d69d996 Only override the DelegateType when showing hidden messages 2024-04-21 13:25:49 +02:00
James Graham
8b63c18f65 Implement devtoool to show hidden timeline messages 2024-04-21 10:50:59 +00:00
James Graham
dc2f11eb2b Fancy Effects 2021-2024 gone but never forgotten
Remove fancy effects as it's busted and causing CPU spikes.
2024-04-21 10:50:45 +00:00
James Graham
13e64a9487 Use 0.8.x for libQuotient flatpak 2024-04-21 12:41:21 +02:00
Albert Astals Cid
6a3c88ae5b GIT_SILENT Upgrade release service version to 24.07.70. 2024-04-21 12:28:32 +02:00
l10n daemon script
08a7e324aa GIT_SILENT Sync po/docbooks with svn 2024-04-21 01:23:23 +00:00
James Graham
9202a4525f Make sure the user can get to the navigationtabbar 2024-04-20 17:21:21 +00:00
Carl Schwan
bfc756fb35 rejrejore 2024-04-20 17:21:21 +00:00
Carl Schwan
2a735ff1cc jreojreojr 2024-04-20 17:21:21 +00:00
James Graham
551092a1b4 Make sure the drawer get active focus on open 2024-04-20 17:21:21 +00:00
Carl Schwan
ddd12688aa RoomInformation: allow tabbing on actions 2024-04-20 17:21:21 +00:00
l10n daemon script
71767c4172 GIT_SILENT Sync po/docbooks with svn 2024-04-20 01:23:40 +00:00
327 changed files with 77364 additions and 48349 deletions

View File

@@ -2,7 +2,7 @@
"id": "org.kde.neochat",
"branch": "master",
"runtime": "org.kde.Platform",
"runtime-version": "6.6",
"runtime-version": "6.7",
"sdk": "org.kde.Sdk",
"command": "neochat",
"tags": [
@@ -110,7 +110,7 @@
{
"type": "git",
"url": "https://github.com/quotient-im/libQuotient.git",
"branch": "dev",
"branch": "0.8.x",
"disable-submodules": true
}
],

View File

@@ -8,7 +8,7 @@ include:
- /gitlab-templates/android-qt6.yml
- /gitlab-templates/linux-qt6.yml
- /gitlab-templates/windows-qt6.yml
- /gitlab-templates/freebsd-qt6.yml
# - /gitlab-templates/freebsd-qt6.yml
- /gitlab-templates/flatpak.yml
- /gitlab-templates/craft-android-qt6-apks.yml
- /gitlab-templates/craft-appimage-qt6.yml

View File

@@ -40,4 +40,4 @@ Dependencies:
Options:
per-test-timeout: 90
require-passing-tests-on: [ '@all' ]
require-passing-tests-on: [ 'Linux', 'Android', 'FreeBSD' ]

View File

@@ -8,8 +8,8 @@ cmake_minimum_required(VERSION 3.16)
# KDE Applications version, managed by release script.
set(RELEASE_SERVICE_VERSION_MAJOR "24")
set(RELEASE_SERVICE_VERSION_MINOR "04")
set(RELEASE_SERVICE_VERSION_MICRO "70")
set(RELEASE_SERVICE_VERSION_MINOR "08")
set(RELEASE_SERVICE_VERSION_MICRO "3")
set(RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(NeoChat VERSION ${RELEASE_SERVICE_VERSION})
@@ -38,6 +38,7 @@ include(KDEGitCommitHooks)
include(ECMCheckOutboundLicense)
include(ECMQtDeclareLoggingCategory)
include(ECMAddAndroidApk)
include(ECMQmlModule)
if (NOT ANDROID)
include(KDEClangFormat)
endif()
@@ -59,7 +60,9 @@ set_package_properties(Qt6 PROPERTIES
PURPOSE "Basic application components"
)
qt_policy(SET QTP0001 NEW)
if (QT_KNOWN_POLICY_QTP0004)
qt_policy(SET QTP0004 NEW)
endif ()
find_package(KF6 ${KF_MIN_VERSION} COMPONENTS Kirigami I18n Notifications Config CoreAddons Sonnet ItemModels ColorScheme)
set_package_properties(KF6 PROPERTIES
@@ -102,7 +105,7 @@ if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
find_package(KF6DBusAddons ${KF_MIN_VERSION} REQUIRED)
endif()
find_package(QuotientQt6 0.7)
find_package(QuotientQt6 0.8.2)
set_package_properties(QuotientQt6 PROPERTIES
TYPE REQUIRED
DESCRIPTION "Qt wrapper around Matrix API"

View File

@@ -38,8 +38,8 @@ 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).
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 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

56
appiumtests/createroomtest.py Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env python3
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
import os
import subprocess
import sys
import unittest
import time
from appium import webdriver
from appium.options.common.base import AppiumOptions
from appium.webdriver.common.appiumby import AppiumBy
class CreateRoomTest(unittest.TestCase):
mockServerProcess: subprocess.Popen
@classmethod
def setUpClass(cls):
cls.mockServerProcess = subprocess.Popen([sys.executable, os.path.join(os.path.dirname(__file__), "login-server.py")])
options = AppiumOptions()
options.set_capability("app", "neochat --ignore-ssl-errors --test")
cls.driver = webdriver.Remote(command_executor='http://127.0.0.1:4723', options=options)
def setUp(self):
pass
def tearDown(self):
if not self._outcome.result.wasSuccessful():
self.driver.get_screenshot_as_file("failed_test_shot_{}.png".format(self.id()))
@classmethod
def tearDownClass(self):
self.mockServerProcess.terminate()
self.driver.quit()
def test_create_room(self):
self.driver.find_element(by=AppiumBy.NAME, value="@user:localhost:1234").click()
self.driver.find_element(by=AppiumBy.NAME, value="Show Menu").click()
self.driver.find_element(by=AppiumBy.NAME, value="Create a Room").click()
self.driver.find_element(by=AppiumBy.NAME, value="Name:").send_keys("Super awesome room name")#
time.sleep(0.1) # without this, the second half of the text is sent to the topic field?!
self.driver.find_element(by=AppiumBy.NAME, value="Topic:").send_keys("There are not enough raccoons here")
time.sleep(0.1)
self.driver.find_element(by=AppiumBy.NAME, value="Create Room").click()
time.sleep(0.1)
self.driver.find_element(by=AppiumBy.NAME, value="Super awesome room name").click()
self.driver.find_element(by=AppiumBy.NAME, value="Show Room Information").click()
self.driver.find_element(by=AppiumBy.NAME, value="There are not enough raccoons here")
if __name__ == '__main__':
unittest.main()

View File

@@ -0,0 +1,78 @@
{
"next_batch": "batch1234",
"rooms": {
"join": {
"!newroom123321:localhost:1234": {
"state": {
"events": [
{
"type": "m.room.member",
"state_key": "@user:localhost:1234",
"sender": "@user:localhost:1234",
"origin_server_ts": 1432735824653,
"event_id": "$event_id_1234_0:localhost:1234",
"room_id": "!newroom123321:localhost:1234",
"content": {
"avatar_url": "",
"displayname": "A Display Name",
"membership": "join",
"reason": "Nothing"
},
"unsigned": {
"age": 1234
}
},
{
"type": "m.room.name",
"state_key": "",
"sender": "@user:localhost:1234",
"origin_server_ts": 1432735824653,
"event_id": "$event_id_1234_1:localhost:1234",
"room_id": "!newroom123321:localhost:1234",
"content": {
"name": "Super awesome room name"
},
"unsigned": {
"age": 1234
}
},
{
"type": "m.room.topic",
"state_key": "",
"sender": "@user:localhost:1234",
"origin_server_ts": 1432735824653,
"event_id": "$event_id_1234_2:localhost:1234",
"room_id": "!newroom123321:localhost:1234",
"content": {
"topic": "There are not enough raccoons here"
},
"unsigned": {
"age": 1234
}
}
]
},
"timeline": {
"events": [
{
"type": "m.room.message",
"sender": "@user:localhost:1234",
"origin_server_ts": 1432735824653,
"event_id": "$event_id_1234_1:localhost:1234",
"room_id": "!newroom123321:localhost:1234",
"content": {
"body": "This is a message",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://matrix.to/#/@user:localhost:1234\">User</a>:",
"msgtype": "m.text"
},
"unsigned": {
"age": 1234
}
}
]
}
}
}
}
}

View File

@@ -6,6 +6,8 @@ from flask import Flask, request, abort
import os
app = Flask(__name__)
next_sync_payload = ""
@app.route("/_matrix/client/v3/login", methods=["GET"])
def login_get():
@@ -42,8 +44,13 @@ def load_json(name):
@app.route("/_matrix/client/r0/sync")
def sync():
result = load_json("sync_response_no_rooms") if ("login" in request.headers.get("Authorization")) else load_json("sync_response_rooms")
global next_sync_payload
result = dict()
if len(next_sync_payload) > 0:
result = load_json(next_sync_payload)
next_sync_payload = ""
else:
result = load_json("sync_response_no_rooms") if ("login" in request.headers.get("Authorization")) else load_json("sync_response_rooms")
return result
@app.route("/.well-known/matrix/client")
@@ -65,6 +72,18 @@ def upload_keys():
reply = dict()
return reply
@app.route("/_matrix/client/v3/createRoom", methods=["POST"])
def create_room():
global next_sync_payload
data = request.get_json()
if data["name"] != "Super awesome room name" or data["topic"] != "There are not enough raccoons here":
return dict(), 400
response = dict()
response["room_id"] = "!newroom123321:localhost:1234"
next_sync_payload = "sync_response_new_room"
return response
if __name__ == "__main__":
app.run(ssl_context='adhoc', port=1234)

View File

@@ -6,6 +6,7 @@
#include <QObject>
#include <QTest>
#include <Quotient/roommember.h>
#include <Quotient/syncdata.h>
#include <qtestcase.h>
@@ -50,7 +51,7 @@ void ChatBarCacheTest::empty()
QCOMPARE(chatBarCache->replyId(), QString());
QCOMPARE(chatBarCache->isEditing(), false);
QCOMPARE(chatBarCache->editId(), QString());
QCOMPARE(chatBarCache->relationUser(), room->getUser(nullptr));
QCOMPARE(chatBarCache->relationUser(), room->member(QString()));
QCOMPARE(chatBarCache->relationMessage(), QString());
QCOMPARE(chatBarCache->attachmentPath(), QString());
}
@@ -64,7 +65,7 @@ void ChatBarCacheTest::noRoom()
// ChatBarCache has no parent.
QTest::ignoreMessage(QtWarningMsg, "ChatBarCache created with no parent, a NeoChatRoom must be set as the parent on creation.");
QCOMPARE(chatBarCache->relationUser(), QVariantMap());
QCOMPARE(chatBarCache->relationUser(), Quotient::RoomMember());
QTest::ignoreMessage(QtWarningMsg, "ChatBarCache created with no parent, a NeoChatRoom must be set as the parent on creation.");
QCOMPARE(chatBarCache->relationMessage(), QString());
@@ -80,7 +81,7 @@ void ChatBarCacheTest::badParent()
// ChatBarCache has no parent.
QTest::ignoreMessage(QtWarningMsg, "ChatBarCache created with incorrect parent, a NeoChatRoom must be set as the parent on creation.");
QCOMPARE(chatBarCache->relationUser(), QVariantMap());
QCOMPARE(chatBarCache->relationUser(), Quotient::RoomMember());
QTest::ignoreMessage(QtWarningMsg, "ChatBarCache created with incorrect parent, a NeoChatRoom must be set as the parent on creation.");
QCOMPARE(chatBarCache->relationMessage(), QString());
@@ -98,7 +99,7 @@ void ChatBarCacheTest::reply()
QCOMPARE(chatBarCache->replyId(), QLatin1String("$153456789:example.org"));
QCOMPARE(chatBarCache->isEditing(), false);
QCOMPARE(chatBarCache->editId(), QString());
QCOMPARE(chatBarCache->relationUser(), room->getUser(room->user(QLatin1String("@example:example.org"))));
QCOMPARE(chatBarCache->relationUser(), room->member(QLatin1String("@example:example.org")));
QCOMPARE(chatBarCache->relationMessage(), QLatin1String("This is an example\ntext message"));
QCOMPARE(chatBarCache->attachmentPath(), QString());
}
@@ -115,7 +116,7 @@ void ChatBarCacheTest::edit()
QCOMPARE(chatBarCache->replyId(), QString());
QCOMPARE(chatBarCache->isEditing(), true);
QCOMPARE(chatBarCache->editId(), QLatin1String("$153456789:example.org"));
QCOMPARE(chatBarCache->relationUser(), room->getUser(room->user(QLatin1String("@example:example.org"))));
QCOMPARE(chatBarCache->relationUser(), room->member(QLatin1String("@example:example.org")));
QCOMPARE(chatBarCache->relationMessage(), QLatin1String("This is an example\ntext message"));
QCOMPARE(chatBarCache->attachmentPath(), QString());
}
@@ -132,7 +133,7 @@ void ChatBarCacheTest::attachment()
QCOMPARE(chatBarCache->replyId(), QString());
QCOMPARE(chatBarCache->isEditing(), false);
QCOMPARE(chatBarCache->editId(), QString());
QCOMPARE(chatBarCache->relationUser(), room->getUser(nullptr));
QCOMPARE(chatBarCache->relationUser(), room->member(QString()));
QCOMPARE(chatBarCache->relationMessage(), QString());
QCOMPARE(chatBarCache->attachmentPath(), QLatin1String("some/path"));
}

View File

@@ -25,7 +25,7 @@
"content": {
"user_ids": [
"@alice:matrix.org",
"@bob:example.com"
"@bob:kde.org"
]
},
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
@@ -35,7 +35,7 @@
"content": {
"$153456789:example.org": {
"m.read": {
"@alice:matrix.org": {
"@alice:example.org": {
"ts": 1436451550453
}
}
@@ -47,7 +47,7 @@
"content": {
"$1532735824654:example.org": {
"m.read": {
"@bob:example.com": {
"@bob:kde.org": {
"ts": 1436451550453
}
}
@@ -67,6 +67,18 @@
},
"type": "m.receipt"
},
{
"content": {
"$1532735824654:example.org": {
"m.read": {
"@tim2:example.com": {
"ts": 1436451550454
}
}
}
},
"type": "m.receipt"
},
{
"content": {
"$1532735824654:example.org": {
@@ -136,6 +148,22 @@
"age": 1234
}
},
{
"content": {
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
"displayname": "Bob",
"membership": "join"
},
"event_id": "$143273582443PhrSn:example.org",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "bob:kde.org",
"state_key": "@bob:kde.org",
"type": "m.room.member",
"unsigned": {
"age": 1234
}
},
{
"content": {
"displayname": "Look\nat\nme\nI\nput\nnewlines\nin\nmy\ndisplay name",
@@ -156,7 +184,7 @@
"summary": {
"m.heroes": [
"@alice:example.com",
"@bob:example.com"
"@bob:kde.org"
],
"m.invited_member_count": 0,
"m.joined_member_count": 2

View File

@@ -1,14 +0,0 @@
{
"content": {
"body": "https://matrix.to/#/@alice:example.org",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -1,14 +0,0 @@
{
"content": {
"body": "mxc://example.org/SEsfnsuifSDFSSEF",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -1,14 +0,0 @@
{
"content": {
"body": "testhttps://kde.org",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -37,16 +37,14 @@
"events": [
{
"content": {
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
"displayname": "Alice Margatroid",
"membership": "join",
"reason": "Looking for support"
"displayname": "Example",
"membership": "join"
},
"event_id": "$143273582443PhrSn:example.org",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "@alice:example.org",
"state_key": "@example:example.org",
"type": "m.room.member",
"unsigned": {
"age": 1234

View File

@@ -130,7 +130,23 @@
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "@alice:example.org",
"state_key": "@alice:matrix.org",
"type": "m.room.member",
"unsigned": {
"age": 1234
}
},
{
"content": {
"avatar_url": "mxc://example.org/SEsfnsuifSDFSSEF",
"displayname": "Bob",
"membership": "join"
},
"event_id": "$143273582443PhrSn:example.org",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "bob:example.org",
"state_key": "@bob:example.org",
"type": "m.room.member",
"unsigned": {
"age": 1234

View File

@@ -51,6 +51,21 @@
"unsigned": {
"age": 1234
}
},
{
"content": {
"displayname": "Example",
"membership": "join"
},
"event_id": "$143273582443PhrSn:example.org",
"origin_server_ts": 1432735824653,
"room_id": "!jEsUZKDJdhlrceRyVU:example.org",
"sender": "@example:example.org",
"state_key": "@example:example.org",
"type": "m.room.member",
"unsigned": {
"age": 1234
}
}
]
},

View File

@@ -1,14 +0,0 @@
{
"content": {
"body": "https://kde.org",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -1,14 +0,0 @@
{
"content": {
"body": "www.example.org",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -1,16 +0,0 @@
{
"content": {
"body": "[Rich Link](https://kde.org)",
"format": "org.matrix.custom.html",
"formatted_body": "<a href=\"https://kde.org\">Rich Link</a>",
"msgtype": "m.text"
},
"event_id": "$validlink1:example.org",
"origin_server_ts": 1432735824654,
"room_id": "!test:example.org",
"sender": "@example:example.org",
"type": "m.room.message",
"unsigned": {
"age": 1234
}
}

View File

@@ -36,8 +36,6 @@ private Q_SLOTS:
void eventId();
void nullEventId();
void author();
void nullAuthor();
void authorDisplayName();
void nullAuthorDisplayName();
void singleLineSidplayName();
@@ -56,6 +54,7 @@ private Q_SLOTS:
void genericBody();
void nullGenericBody();
void markdownBody();
void markdownBodyReply();
void subtitle();
void nullSubtitle();
void mediaInfo();
@@ -74,8 +73,6 @@ private Q_SLOTS:
void nullThread();
void location();
void nullLocation();
void readMarkers();
void nullReadMarkers();
};
void EventHandlerTest::initTestCase()
@@ -97,33 +94,6 @@ void EventHandlerTest::nullEventId()
QCOMPARE(noEventHandler.getId(), QString());
}
void EventHandlerTest::author()
{
auto event = room->messageEvents().at(0).get();
auto author = room->user(event->senderId());
EventHandler eventHandler(room, event);
auto eventHandlerAuthor = eventHandler.getAuthor();
QCOMPARE(eventHandlerAuthor["isLocalUser"_ls], author->id() == room->localUser()->id());
QCOMPARE(eventHandlerAuthor["id"_ls], author->id());
QCOMPARE(eventHandlerAuthor["displayName"_ls], author->displayname(room));
QCOMPARE(eventHandlerAuthor["avatarSource"_ls], room->avatarForMember(author));
QCOMPARE(eventHandlerAuthor["avatarMediaId"_ls], author->avatarMediaId(room));
QCOMPARE(eventHandlerAuthor["color"_ls], Utils::getUserColor(author->hueF()));
QCOMPARE(eventHandlerAuthor["object"_ls], QVariant::fromValue(author));
}
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()
{
EventHandler eventHandler(room, room->messageEvents().at(1).get());
@@ -193,6 +163,7 @@ void EventHandlerTest::timeString()
QLocale().toString(QDateTime::fromMSecsSinceEpoch(1690699214545, Qt::UTC).toLocalTime().time(), QLocale::LongFormat));
QCOMPARE(eventHandler.getTimeString(true, QLocale::LongFormat, true, QDateTime::fromMSecsSinceEpoch(1690699214545, Qt::UTC)),
format.formatRelativeDate(QDateTime::fromMSecsSinceEpoch(1690699214545, Qt::UTC).toLocalTime().date(), QLocale::LongFormat));
QCOMPARE(eventHandler.getTimeString(QStringLiteral("hh:mm")), QDateTime::fromMSecsSinceEpoch(1432735824654, Qt::UTC).toString(QStringLiteral("hh:mm")));
}
void EventHandlerTest::nullTimeString()
@@ -301,6 +272,13 @@ void EventHandlerTest::markdownBody()
QCOMPARE(eventHandler.getMarkdownBody(), QStringLiteral("This is an example\ntext message"));
}
void EventHandlerTest::markdownBodyReply()
{
EventHandler eventHandler(room, room->messageEvents().at(5).get());
QCOMPARE(eventHandler.getMarkdownBody(), QStringLiteral("reply"));
}
void EventHandlerTest::subtitle()
{
EventHandler eventHandler(room, room->messageEvents().at(0).get());
@@ -385,31 +363,30 @@ void EventHandlerTest::nullReplyId()
void EventHandlerTest::replyAuthor()
{
auto replyEvent = room->messageEvents().at(0).get();
auto replyAuthor = room->user(replyEvent->senderId());
auto replyAuthor = room->member(replyEvent->senderId());
EventHandler eventHandler(room, room->messageEvents().at(5).get());
auto eventHandlerReplyAuthor = eventHandler.getReplyAuthor();
QCOMPARE(eventHandlerReplyAuthor["isLocalUser"_ls], replyAuthor->id() == room->localUser()->id());
QCOMPARE(eventHandlerReplyAuthor["id"_ls], replyAuthor->id());
QCOMPARE(eventHandlerReplyAuthor["displayName"_ls], replyAuthor->displayname(room));
QCOMPARE(eventHandlerReplyAuthor["avatarSource"_ls], room->avatarForMember(replyAuthor));
QCOMPARE(eventHandlerReplyAuthor["avatarMediaId"_ls], replyAuthor->avatarMediaId(room));
QCOMPARE(eventHandlerReplyAuthor["color"_ls], Utils::getUserColor(replyAuthor->hueF()));
QCOMPARE(eventHandlerReplyAuthor["object"_ls], QVariant::fromValue(replyAuthor));
QCOMPARE(eventHandlerReplyAuthor.isLocalMember(), replyAuthor.id() == room->localMember().id());
QCOMPARE(eventHandlerReplyAuthor.id(), replyAuthor.id());
QCOMPARE(eventHandlerReplyAuthor.displayName(), replyAuthor.displayName());
QCOMPARE(eventHandlerReplyAuthor.avatarUrl(), replyAuthor.avatarUrl());
QCOMPARE(eventHandlerReplyAuthor.avatarMediaId(), replyAuthor.avatarMediaId());
QCOMPARE(eventHandlerReplyAuthor.color(), replyAuthor.color());
EventHandler eventHandlerNoAuthor(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandlerNoAuthor.getReplyAuthor(), room->getUser(nullptr));
QCOMPARE(eventHandlerNoAuthor.getReplyAuthor(), RoomMember());
}
void EventHandlerTest::nullReplyAuthor()
{
QTest::ignoreMessage(QtWarningMsg, "getReplyAuthor called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReplyAuthor(), QVariantMap());
QCOMPARE(emptyHandler.getReplyAuthor(), RoomMember());
EventHandler noEventHandler(room, nullptr);
QTest::ignoreMessage(QtWarningMsg, "getReplyAuthor called with m_event set to nullptr. Returning empty user.");
QCOMPARE(noEventHandler.getReplyAuthor(), room->getUser(nullptr));
QCOMPARE(noEventHandler.getReplyAuthor(), RoomMember());
}
void EventHandlerTest::replyBody()
@@ -515,59 +492,5 @@ void EventHandlerTest::nullLocation()
QCOMPARE(emptyHandler.getLocationAssetType(), QString());
}
void EventHandlerTest::readMarkers()
{
EventHandler eventHandler(room, room->messageEvents().at(0).get());
QCOMPARE(eventHandler.hasReadMarkers(), true);
auto readMarkers = eventHandler.getReadMarkers();
QCOMPARE(readMarkers.size(), 1);
QCOMPARE(readMarkers[0].toMap()["id"_ls], QStringLiteral("@alice:matrix.org"));
QCOMPARE(eventHandler.getNumberExcessReadMarkers(), QString());
QCOMPARE(eventHandler.getReadMarkersString(), QStringLiteral("1 user: @alice:matrix.org"));
EventHandler eventHandler2(room, room->messageEvents().at(2).get());
QCOMPARE(eventHandler2.hasReadMarkers(), true);
readMarkers = eventHandler2.getReadMarkers();
QCOMPARE(readMarkers.size(), 5);
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(eventHandler2.getReadMarkersString().startsWith(QStringLiteral("6 users:")), true);
}
void EventHandlerTest::nullReadMarkers()
{
QTest::ignoreMessage(QtWarningMsg, "hasReadMarkers called with m_room set to nullptr.");
QCOMPARE(emptyHandler.hasReadMarkers(), false);
QTest::ignoreMessage(QtWarningMsg, "getReadMarkers called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getReadMarkers(), QVariantList());
QTest::ignoreMessage(QtWarningMsg, "getNumberExcessReadMarkers called with m_room set to nullptr.");
QCOMPARE(emptyHandler.getNumberExcessReadMarkers(), QString());
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);
QTest::ignoreMessage(QtWarningMsg, "getReadMarkers called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReadMarkers(), QVariantList());
QTest::ignoreMessage(QtWarningMsg, "getNumberExcessReadMarkers called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getNumberExcessReadMarkers(), QString());
QTest::ignoreMessage(QtWarningMsg, "getReadMarkersString called with m_event set to nullptr.");
QCOMPARE(noEventHandler.getReadMarkersString(), QString());
}
QTEST_MAIN(EventHandlerTest)
#include "eventhandlertest.moc"

View File

@@ -6,12 +6,11 @@
#include "linkpreviewer.h"
#include "utils.h"
#include <Quotient/events/roommessageevent.h>
#include <Quotient/quotient_common.h>
#include <Quotient/syncdata.h>
#include "utils.h"
#include "testutils.h"
using namespace Quotient;
@@ -30,6 +29,9 @@ private Q_SLOTS:
void linkPreviewsMatch_data();
void linkPreviewsMatch();
void multipleLinkPreviewsMatch_data();
void multipleLinkPreviewsMatch();
void linkPreviewsReject_data();
void linkPreviewsReject();
};
@@ -42,45 +44,59 @@ void LinkPreviewerTest::initTestCase()
void LinkPreviewerTest::linkPreviewsMatch_data()
{
QTest::addColumn<QString>("eventSource");
QTest::addColumn<QString>("inputString");
QTest::addColumn<QUrl>("testOutputLink");
QTest::newRow("plainHttps") << QStringLiteral("test-validplainlink-event.json") << QUrl("https://kde.org"_ls);
QTest::newRow("richHttps") << QStringLiteral("test-validrichlink-event.json") << QUrl("https://kde.org"_ls);
QTest::newRow("plainWww") << QStringLiteral("test-validplainwwwlink-event.json") << QUrl("www.example.org"_ls);
QTest::newRow("multipleHttps") << QStringLiteral("test-multiplelink-event.json") << QUrl("www.example.org"_ls);
QTest::newRow("plainHttps") << QStringLiteral("https://kde.org") << QUrl("https://kde.org"_ls);
QTest::newRow("richHttps") << QStringLiteral("<a href=\"https://kde.org\">Rich Link</a>") << QUrl("https://kde.org"_ls);
QTest::newRow("richHttpsLinkDescription") << QStringLiteral("<a href=\"https://kde.org\">https://kde.org</a>") << QUrl("https://kde.org"_ls);
}
void LinkPreviewerTest::linkPreviewsMatch()
{
QFETCH(QString, eventSource);
QFETCH(QString, inputString);
QFETCH(QUrl, testOutputLink);
auto event = TestUtils::loadEventFromFile<RoomMessageEvent>(eventSource);
auto linkPreviewer = LinkPreviewer(LinkPreviewer::linkPreview(event.get()), connection);
auto link = LinkPreviewer::linkPreviews(inputString)[0];
QCOMPARE(linkPreviewer.empty(), false);
QCOMPARE(linkPreviewer.url(), testOutputLink);
QCOMPARE(link, testOutputLink);
}
void LinkPreviewerTest::multipleLinkPreviewsMatch_data()
{
QTest::addColumn<QString>("inputString");
QTest::addColumn<QList<QUrl>>("testOutputLinks");
QTest::newRow("multipleHttps") << QStringLiteral("www.example.org https://kde.org") << QList{QUrl("www.example.org"_ls), QUrl("https://kde.org"_ls)};
QTest::newRow("multipleHttps1Invalid") << QStringLiteral("www.example.org mxc://example.org/SEsfnsuifSDFSSEF") << QList{QUrl("www.example.org"_ls)};
}
void LinkPreviewerTest::multipleLinkPreviewsMatch()
{
QFETCH(QString, inputString);
QFETCH(QList<QUrl>, testOutputLinks);
auto links = LinkPreviewer::linkPreviews(inputString);
QCOMPARE(links, testOutputLinks);
}
void LinkPreviewerTest::linkPreviewsReject_data()
{
QTest::addColumn<QString>("eventSource");
QTest::addColumn<QString>("inputString");
QTest::newRow("mxc") << QStringLiteral("test-invalidmxclink-event.json");
QTest::newRow("matrixTo") << QStringLiteral("test-invalidmatrixtolink-event.json");
QTest::newRow("noSpace") << QStringLiteral("test-invalidnospacelink-event.json");
QTest::newRow("mxc") << QStringLiteral("mxc://example.org/SEsfnsuifSDFSSEF");
QTest::newRow("matrixTo") << QStringLiteral("https://matrix.to/#/@alice:example.org");
QTest::newRow("noSpace") << QStringLiteral("testhttps://kde.org");
}
void LinkPreviewerTest::linkPreviewsReject()
{
QFETCH(QString, eventSource);
QFETCH(QString, inputString);
auto event = TestUtils::loadEventFromFile<RoomMessageEvent>(eventSource);
auto linkPreviewer = LinkPreviewer(LinkPreviewer::linkPreview(event.get()), connection);
auto links = LinkPreviewer::linkPreviews(inputString);
QCOMPARE(linkPreviewer.empty(), true);
QCOMPARE(linkPreviewer.url(), QUrl());
QCOMPARE(links.empty(), true);
}
QTEST_MAIN(LinkPreviewerTest)

View File

@@ -52,10 +52,8 @@ void ReactionModelTest::basicReaction()
QCOMPARE(model.data(model.index(0), ReactionModel::TextContentRole), QStringLiteral("<span style=\"font-family: 'emoji';\">👍</span>"));
QCOMPARE(model.data(model.index(0), ReactionModel::ReactionRole), QStringLiteral("👍"));
QCOMPARE(model.data(model.index(0), ReactionModel::ToolTipRole),
QStringLiteral("@alice:matrix.org reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
auto authorList = QVariantList{room->getUser(room->user(QStringLiteral("@alice:matrix.org")))};
QCOMPARE(model.data(model.index(0), ReactionModel::AuthorsRole), authorList);
QCOMPARE(model.data(model.index(0), ReactionModel::HasLocalUser), false);
QStringLiteral("Alice Margatroid reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
QCOMPARE(model.data(model.index(0), ReactionModel::HasLocalMember), false);
}
void ReactionModelTest::newReaction()
@@ -65,7 +63,7 @@ void ReactionModelTest::newReaction()
QCOMPARE(model->rowCount(), 1);
QCOMPARE(model->data(model->index(0), ReactionModel::ToolTipRole),
QStringLiteral("@alice:matrix.org reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
QStringLiteral("Alice Margatroid reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
QSignalSpy spy(model, SIGNAL(modelReset()));
@@ -74,7 +72,7 @@ void ReactionModelTest::newReaction()
QCOMPARE(spy.count(), 2); // Once for each of the 2 new reactions.
QCOMPARE(model->data(model->index(1), ReactionModel::ReactionRole), QStringLiteral("😆"));
QCOMPARE(model->data(model->index(0), ReactionModel::ToolTipRole),
QStringLiteral("@alice:matrix.org and @bob:example.org reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
QStringLiteral("Alice Margatroid and Bob reacted with <span style=\"font-family: 'emoji';\">👍</span>"));
delete model;
}

View File

@@ -22,9 +22,11 @@
<name xml:lang="eo">NeoChat</name>
<name xml:lang="es">NeoChat</name>
<name xml:lang="eu">NeoChat</name>
<name xml:lang="fa">نئوچت</name>
<name xml:lang="fi">NeoChat</name>
<name xml:lang="fr">NeoChat</name>
<name xml:lang="gl">NeoChat</name>
<name xml:lang="he">NeoChat</name>
<name xml:lang="hu">NeoChat</name>
<name xml:lang="ia">Neochat</name>
<name xml:lang="id">NeoChat</name>
@@ -54,12 +56,15 @@
<summary xml:lang="ca">Xategeu amb els vostres amics a Matrix</summary>
<summary xml:lang="ca-valencia">Xategeu amb els vostres amics a Matrix</summary>
<summary xml:lang="cs">Mluvte se svými přáteli na Matrixu</summary>
<summary xml:lang="de">Mit den Freunden auf Matrix unterhalten</summary>
<summary xml:lang="en-GB">Chat with your friends on matrix</summary>
<summary xml:lang="eo">Babilu kun viaj amikoj sur matrix</summary>
<summary xml:lang="es">Charle con sus amigos en matrix</summary>
<summary xml:lang="eu">Berriketan jardun zure lagunekin «Matrix»en</summary>
<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="he">התכתבות עם החברים שלך ב־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>
@@ -69,6 +74,7 @@
<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="ru">Общение с друзьями в Matrix</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>
@@ -79,20 +85,29 @@
<summary xml:lang="zh-TW">在 Matrix 上與您的朋友聊天</summary>
<description>
<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="ar">نيوتشات هو تطبيق دردشة يتيح لك الاستفادة الكاملة من شبكة Matrix. فهو يوفر لك طريقة آمنة لإرسال الرسائل النصية ومقاطع الفيديو والملفات الصوتية إلى عائلتك وزملائك وأصدقائك.</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="de">NeoChat ist eine Anwendung für Unterhaltungen mit allen Vorteilen des Matrix-Netzwerkes. Sie bietet eine sichere Möglichkeit zum Versenden von Nachrichten, Videos und Audiodateien and die Familienmitglieder.</p>
<p xml:lang="en-GB">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="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="fi">NeoChat on keskustelusovellus, jolla Matrix-verkosta saa täyden hyödyn. Se tarjoaa salatun kanavan lähettää perheelle, työkavereille ja ystäville tekstiviestejä sekä video- ja äänitiedostoja.</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é d'envoyer 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="gl">NeoChat é unha aplicación de conversa que lle permite usar todas as funcionalidades da rede Matrix. Fornece unha forma segura de enviar mensaxes de texto e ficheiros de vídeo e son a familiares, amizades ou no traballo.</p>
<p xml:lang="he">NeoChat הוא יישום התכתבות שמאפשר לך לנצל את רשת Matrix במלואה. הוא מספק דרך מאובטחת לשליחת הודעות כתובות, סרטונים וקובצי שמע למשפחה, לעמיתים לעבודה ולחברים.</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="nn">NeoChat er ein prateapp som lèt deg bruka all funksjonalitet i Matrix-nettverket. Du kan utveksla tekst, lyd og videoar med vennar, familie og kollegaar på ein trygg måte.</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="ru">NeoChat — приложение для общения, предоставляющее все преимущества сети Matrix. С его помощью можно безопасно отправлять текстовые сообщения, видеозаписи и звуковые файлы родственникам, коллегам и друзьям.</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="sv">NeoChat är ett chattprogram som låter dig dra full nytta av Matrix-nätverket. Det ger dig ett säkert sätt att skicka textmeddelanden, videor och ljudfiler till din familj, kollegor och vänner.</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>
@@ -101,6 +116,7 @@
<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>
<p xml:lang="ca-valencia">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'encriptació d'extrem a extrem. Hi ha algunes altres omissions més xicotetes a causa del fet que l'especificació de Matrix està evolucionant constantment, però l'objectiu seguix sent proporcionar suport eventual per a tota l'especificació.</p>
<p xml:lang="de">NeoChat versucht eine vollumfängliche Anwendung für die Spezifikation von Matrix zu sein. Damit wird alles der aktuellen stabilen Spezifikation mit den erwähnenswerten Ausnahmen von VoIP, Diskussionsfäden und ein paar Teilen der Ende-zu-Ende-Verschlüsselung unterstützt. Zudem sind andere kleinere Auslassungen vorhanden, da sich die Matrixspezifikation ständig weiterentwickelt. Nichtsdestotrotz soll letztendlich die gesamte Spezifikation unterstützt werden.</p>
<p xml:lang="en-GB">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="eo">NeoChat celas esti plene kapabla aplikaĵo por la Matrix-specifo. Kiel tia, ĉio en la nuna stabila specifo kun la rimarkindaj esceptoj de VoIP, fadenoj kaj kelkaj aspektoj de Fin-al-Fina Ĉifrado estas subtenataj. Estas kelkaj aliaj pli malgrandaj preterlasoj pro la fakto, ke la Matrix-speco konstante evoluas, sed la celo restas provizi finfine subtenon por la tuta specifaĵo.</p>
<p xml:lang="es">NeoChat pretende ser una aplicación con todas las funciones para la especificación de Matrix. Como tal, admite todo en la especificación estable actual, con las notables excepciones de VoIP, subprocesos y algunas funciones de cifrado de extremo a extremo. Existen algunas omisiones menos importantes debido al hecho de que la especificación de Matrix está en constante evolución, pero el objetivo sigue siendo brindar compatibilidad final con toda la especificación.</p>
@@ -108,8 +124,9 @@
<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="he">NeoChat מתיימר להיות יישום עתיר יכולות לפי מפרט Matrix. כיוון שזה ייעודו, כל מה שבמפרט היציב עם חריגות משמעותיות כגון VoIP, שרשורים ועוד מגוון היבטים של הצפנה מקצה לקצה נתמכים גם הם. יש מספר השמטות קטן עקב העובדה שהמפרט של Matrix ממשיך להתפתח אך המטרה היא להמשיך לספק תמיכה בסופו של דבר לכל המפרט.</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="ia">NeoChat aspira a esser un application plenmente 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="ko">NeoChat은 Matrix 표준을 따르는 프로그램을 목표로 합니다. 현재 안정 버전의 표준에서 제공하는 기능의 대부분을 지원하며, VoIP, 스레드, 일부 종단간 암호화와 같은 기능은 아직 지원하지 않습니다. Matrix 표준은 계속하여 진화 중이기 때문에 일부 기능이 빠져 있을 수도 있지만 장기적으로는 전체 표준을 지원하는 것이 목표입니다.</p>
@@ -118,6 +135,7 @@
<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="ru">Целью создания NeoChat является полноценная реализация программы для спецификации Matrix. Как следствие, реализовано всё в текущей стабильной спецификации (за исключением голосовой интернет-связи, потоков и некоторых аспектов сквозного шифрования). Есть также несколько других незначительных пробелов, обусловленных постоянными изменениями спецификации Matrix. Тем не менее, стоит задача в итоге предоставить полную поддержку спецификации.</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 Ş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>
@@ -128,6 +146,7 @@
<p xml:lang="ar">نظرًا لطبيعة تطوير مواصفات ماتركس، يدعم نيوتشات أيضًا العديد من الميزات غير المستقرة وهي:</p>
<p xml:lang="ca">A causa de la naturalesa del desenvolupament de l'especificació de Matrix, el NeoChat també implementa nombroses característiques inestables. Actualment són:</p>
<p xml:lang="ca-valencia">A causa de la naturalea del desenvolupament de l'especificació de Matrix, NeoChat també implementa nombroses característiques inestables. Actualment són:</p>
<p xml:lang="de">Durch die Weiterentwicklung der Matrix-Spezifikation unterstützt auch NeoChat einige als noch instabil gekennzeichnete Funktionen. Derzeit sind das:</p>
<p xml:lang="en-GB">Due to the nature of the Matrix specification development NeoChat also supports numerous unstable features. Currently these are:</p>
<p xml:lang="eo">Pro la naturo de la Matrix-specifevoluo NeoChat ankaŭ subtenas multajn malstabilajn funkciojn. Nuntempe ĉi tiuj estas:</p>
<p xml:lang="es">Debido a la naturaleza del desarrollo de la especificación de Matrix, NeoChat también permite numerosas funciones no estables, como:</p>
@@ -135,6 +154,7 @@
<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="he">מטבע הדברים, הפיתוח של NeoChat תומך במגוון יכולות מפוקפקות כתלות בהתפתחות המפרט הטכני של Matrix. היכולות האלה הן:</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>
@@ -145,6 +165,7 @@
<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>
<p xml:lang="pt">Devido à natureza do desenvolvimento da especificação do Matrix, o NeoChat também suporta diversas funcionalidades instáveis. De momento são:</p>
<p xml:lang="ru">В силу природы разработки спецификации Matrix в NeoChat тоже предусмотрена поддержка многочисленных нестабильных возможностей. В текущей версии это следующие возможности:</p>
<p xml:lang="sl">Zaradi narave razvoja specifikacije Matrixa NeoChat podpira tudi številne nestabilne zmožnosti. Trenutno so to:</p>
<p xml:lang="sv">På grund av sättet Matrix-specifikationens utvecklas, stöder NeoChat också ett stor antal instabila funktioner. För närvarande är de:</p>
<p xml:lang="ta">மேட்ரிக்ஸு நெறிமுறை வரையறுக்கப்படும் வித‍த்தின் காரணமாக, பல நிலையற்ற அம்சங்களையும் நியோச்சாட் ஆதரிக்கிறது. தற்போது ஆதரிக்கப்படுபவை:</p>
@@ -164,6 +185,7 @@
<li xml:lang="fi">Kyselyt MSC3381</li>
<li xml:lang="fr">Sondages - MSC3381</li>
<li xml:lang="gl">Enquisas — MSC3381</li>
<li xml:lang="he">סקרים - MSC3381</li>
<li xml:lang="hu">Szavazások - MSC3381</li>
<li xml:lang="ia">Inquestas - MSC3381</li>
<li xml:lang="it">Sondaggi - MSC3381</li>
@@ -174,6 +196,7 @@
<li xml:lang="nn">Avstemmingar  MSC3381</li>
<li xml:lang="pl">Ankiety - MSC3381</li>
<li xml:lang="pt">Inquéritos - MSC3381</li>
<li xml:lang="ru">Голосования — MSC3381</li>
<li xml:lang="sl">Polls - MSC3381</li>
<li xml:lang="sv">Polls - MSC3381</li>
<li xml:lang="ta">வாக்கெடுப்புகள் - MSC3381</li>
@@ -192,6 +215,7 @@
<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="he">חבילות מדבקות - 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>
@@ -202,10 +226,11 @@
<li xml:lang="nn">Klistremerke-pakkar  MSC2545</li>
<li xml:lang="pl">Paczki naklejek - MSC2545</li>
<li xml:lang="pt">Pacotes de Autocolantes - MSC2545</li>
<li xml:lang="ru">Наборы стикеров — MSC2545</li>
<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">Çıkartma 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>
@@ -220,6 +245,7 @@
<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="he">אירועי מקום - 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>
@@ -230,6 +256,7 @@
<li xml:lang="nn">Posisjonshendingar  MSC3488</li>
<li xml:lang="pl">Wydarzenia w miejscach - MSC3488</li>
<li xml:lang="pt">Eventos com Localizações - MSC3488</li>
<li xml:lang="ru">События местоположения — MSC3488</li>
<li xml:lang="sl">Location Events - MSC3488</li>
<li xml:lang="sv">Location Events - MSC3488</li>
<li xml:lang="ta">இட நிகழ்வுகள் - MSC3488</li>
@@ -275,12 +302,15 @@
<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="de">Hauptansicht mit Raumliste, Unterhaltung und Raum-Informationen</caption>
<caption xml:lang="en-GB">Main view with room list, chat, and room information</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="he">תצוגה ראשית עם רשימת חדרים, צ׳אט ופרטי חדר</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>
@@ -291,6 +321,7 @@
<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="ru">Главное окно со списком комнат, чатом и информацией о комнате</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>
@@ -302,20 +333,30 @@
<screenshot type="default">
<image>https://cdn.kde.org/screenshots/neochat/spaces.png</image>
<caption>Discover new communities with Matrix Spaces</caption>
<caption xml:lang="ar">اكتشف مجتمعات جديدة مع فضاءات ماتركس</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="de">Neue Gemeinschaften mit den Umgebungen von Matrix erkunden</caption>
<caption xml:lang="en-GB">Discover new communities with Matrix Spaces</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="fi">Löydä uusia yhteisöjä Matrix Spacesillä</caption>
<caption xml:lang="fr">Découvrez de nouvelles communautés avec les espaces sous Matrix</caption>
<caption xml:lang="gl">Descubra novas comunidades dos espazos de Matrix.</caption>
<caption xml:lang="he">אפשר להיחשף לקהילות חדשות דרך Matrix Spaces</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="nn">Oppdag nye fellesskap med Matrix Spaces</caption>
<caption xml:lang="pl">Odkrywaj nowe społeczności w Przestrzeniach Matriksa</caption>
<caption xml:lang="ru">Поиск новых сообществ с помощью Matrix Spaces</caption>
<caption xml:lang="sl">Odkrijte nove skupnosti z Matrix Spaces</caption>
<caption xml:lang="sv">Upptäck nya gemenskaper med Matrix Spaces</caption>
<caption xml:lang="ta">மேட்ரிக்ஸு இடங்களின் மூலம் புதிய சமூகங்களைக் கண்டுபிடிக்கலாம்</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>
@@ -334,12 +375,15 @@
<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="de">Hauptansicht mit Raumliste, Unterhaltung und Raum-Informationen</caption>
<caption xml:lang="en-GB">Main view with room list, chat, and room information</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="he">תצוגה ראשית עם רשימת חדרים, צ׳אט ופרטי חדר</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>
@@ -350,6 +394,7 @@
<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="ru">Главное окно со списком комнат, чатом и информацией о комнате</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>
@@ -365,12 +410,15 @@
<caption xml:lang="ca">Pantalla d'inici de sessió</caption>
<caption xml:lang="ca-valencia">Pantalla d'inici de sessió</caption>
<caption xml:lang="cs">Přihlašovací obrazovka</caption>
<caption xml:lang="de">Anmeldebildschirm</caption>
<caption xml:lang="en-GB">Login screen</caption>
<caption xml:lang="eo">Ensaluta ekrano</caption>
<caption xml:lang="es">Pantalla de inicio de sesión</caption>
<caption xml:lang="eu">Saio-hasteko pantaila</caption>
<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="he">מסך כניסה</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>
@@ -381,6 +429,7 @@
<caption xml:lang="nn">Innloggingsbilete</caption>
<caption xml:lang="pl">Ekran logowania</caption>
<caption xml:lang="pt">Ecrã de autenticação</caption>
<caption xml:lang="ru">Окно входа</caption>
<caption xml:lang="sl">Prijavni zaslon</caption>
<caption xml:lang="sv">Inloggningsfönster</caption>
<caption xml:lang="ta">நுழைவுத் திரை</caption>
@@ -394,6 +443,13 @@
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
<releases>
<release version="24.08.3" date="2024-11-07"/>
<release version="24.08.2" date="2024-10-10"/>
<release version="24.08.1" date="2024-09-12"/>
<release version="24.08.0" date="2024-08-22"/>
<release version="24.05.2" date="2024-07-04"/>
<release version="24.05.1" date="2024-06-13"/>
<release version="24.05.0" date="2024-05-23"/>
<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">

View File

@@ -15,9 +15,11 @@ Name[en_GB]=NeoChat
Name[eo]=NeoChat
Name[es]=NeoChat
Name[eu]=NeoChat
Name[fa]=نئوچت
Name[fi]=NeoChat
Name[fr]=NeoChat
Name[gl]=NeoChat
Name[he]=NeoChat
Name[hu]=NeoChat
Name[ia]=Neochat
Name[id]=NeoChat
@@ -59,6 +61,7 @@ GenericName[eu]=Matrix bezeroa
GenericName[fi]=Matrix-asiakas
GenericName[fr]=Client « Matrix »
GenericName[gl]=Cliente de Matrix
GenericName[he]=לקוח Matrix
GenericName[hu]=Matrix kliens
GenericName[ia]=Cliente de Matrice
GenericName[id]=Klien Matrix
@@ -99,6 +102,7 @@ Comment[eu]=Matrix protokolorako bezeroa
Comment[fi]=Asiakas Matrix-yhteyskäytännölle
Comment[fr]=Client pour le protocole « Matrix »
Comment[gl]=Cliente para o protocolo Matrix.
Comment[he]=לקוח לפרוטוקול Matrix
Comment[hu]=Kliens a Matrix protokollhoz
Comment[ia]=Cliente per le protocollo de Matrix
Comment[id]=Klien untuk protokol Matrix

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
>L'URI de Matrix per a un usuari o una sala. P. ex. matrix:u/usuari:exemple.org o matrix:r/root:exemple.org. Això farà que el NeoChat intenti obrir la sala o conversa indicada. </para>
>L'URI de Matrix per a un usuari o una sala. P. ex. matrix:u/usuari:example.org o matrix:r/root:example.org. Això farà que el NeoChat intenti obrir la sala o conversa indicada. </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

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

5383
po/fa/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

5478
po/gl/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

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

158
snapcraft.yaml Normal file
View File

@@ -0,0 +1,158 @@
# SPDX-FileCopyrightText: 2024 Scarlett Moore <sgmoore@kde.org>
#
# SPDX-License-Identifier: CC0-1.0
---
name: neochat
base: core22
adopt-info: neochat
grade: stable
confinement: strict
apps:
neochat:
extensions:
- kde-neon-6
command: usr/bin/neochat
common-id: org.kde.neochat
desktop: usr/share/applications/org.kde.neochat.desktop
plugs:
- home
- removable-media
- audio-playback
- unity7
- network
- network-bind
- network-manager-observe
- password-manager-service
- accounts-service
compression: lzo
slots:
session-dbus-interface:
interface: dbus
name: org.kde.neochat
bus: session
parts:
olm:
source: https://gitlab.matrix.org/matrix-org/olm.git
source-depth: 1
source-tag: '3.2.12'
plugin: cmake
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
prime:
- -usr/include
- -usr/lib/*/pkgconfig
- -usr/lib/*/cmake
libsecret:
source: https://gitlab.gnome.org/GNOME/libsecret.git
source-tag: '0.21.4'
source-depth: 1
plugin: meson
meson-parameters:
- --prefix=/usr
- -Doptimization=3
- -Ddebug=true
- -Dmanpage=false
- -Dvapi=false
- -Dintrospection=false
- -Dcrypto=disabled
- -Dgtk_doc=false
build-packages:
- meson
- libglib2.0-dev
- libgcrypt20-dev
prime:
- -usr/include
- -usr/lib/*/pkgconfig
qtkeychain:
after: [libsecret]
source: https://github.com/frankosterfeld/qtkeychain.git
source-tag: 0.14.3
source-depth: 1
plugin: cmake
build-environment:
- PKG_CONFIG_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig:$PKG_CONFIG_PATH
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_TRANSLATIONS=NO
- -DBUILD_WITH_QT6=ON
prime:
- -usr/include
- -usr/lib/*/pkgconfig
- -usr/lib/*/cmake
libquotient:
after:
- olm
- qtkeychain
source: https://github.com/quotient-im/libQuotient.git
source-tag: 0.8.2
source-depth: 1
plugin: cmake
build-packages:
- libssl-dev
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_TESTING=OFF
- -DQuotient_ENABLE_E2EE=ON
- -DBUILD_WITH_QT6=ON
prime:
- -usr/include
- -usr/lib/*/pkgconfig
- -usr/lib/*/cmake
kquickimageeditor:
source: https://invent.kde.org/libraries/kquickimageeditor.git
source-tag: 'v0.3.0'
source-depth: 1
plugin: cmake
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_WITH_QT6=ON
- -DBUILD_TESTING=OFF
prime:
- -usr/include
- -usr/lib/*/pkgconfig
- -usr/lib/*/cmake
neochat:
after:
- qtkeychain
- libquotient
- kquickimageeditor
parse-info:
- usr/share/metainfo/org.kde.neochat.appdata.xml
source: .
source-type: local
plugin: cmake
build-packages:
- cmark
- libcmark-dev
- libsqlite3-dev
- libvulkan-dev
- libxkbcommon-dev
- libicu-dev
- libpulse0
cmake-parameters:
- -DCMAKE_INSTALL_PREFIX=/usr
- -DCMAKE_BUILD_TYPE=Release
- -DBUILD_TESTING=OFF
prime:
- -usr/share/man
deps:
after: [neochat]
plugin: nil
stage-packages:
- libcmark0.30.2
prime:
- usr/lib/*/libcmark.so*

View File

@@ -20,8 +20,6 @@ add_library(neochat STATIC
models/customemojimodel.h
clipboard.cpp
clipboard.h
matriximageprovider.cpp
matriximageprovider.h
models/messageeventmodel.cpp
models/messageeventmodel.h
models/messagefiltermodel.cpp
@@ -136,6 +134,8 @@ add_library(neochat STATIC
jobs/neochatdeletedevicejob.h
jobs/neochatchangepasswordjob.cpp
jobs/neochatchangepasswordjob.h
jobs/neochatgetcommonroomsjob.cpp
jobs/neochatgetcommonroomsjob.h
mediasizehelper.cpp
mediasizehelper.h
eventhandler.cpp
@@ -158,7 +158,6 @@ add_library(neochat STATIC
models/linemodel.cpp
models/linemodel.h
events/locationbeaconevent.h
events/serveraclevent.h
events/widgetevent.h
enums/messagecomponenttype.h
models/messagecontentmodel.cpp
@@ -177,13 +176,29 @@ add_library(neochat STATIC
foreigntypes.h
models/threepidmodel.cpp
models/threepidmodel.h
threepidaddhelper.cpp
threepidaddhelper.h
jobs/neochatadd3pidjob.cpp
jobs/neochatadd3pidjob.h
identityserverhelper.cpp
identityserverhelper.h
enums/powerlevel.cpp
enums/powerlevel.h
models/permissionsmodel.cpp
models/permissionsmodel.h
threepidbindhelper.cpp
threepidbindhelper.h
models/readmarkermodel.cpp
models/readmarkermodel.h
neochatroommember.cpp
neochatroommember.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
ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat
QML_FILES
qml/Main.qml
@@ -204,20 +219,13 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/InviteUserPage.qml
qml/ImageEditorPage.qml
qml/NeochatMaximizeComponent.qml
qml/FancyEffectsContainer.qml
qml/TypingPane.qml
qml/QuickSwitcher.qml
qml/HoverActions.qml
qml/ChatBar.qml
qml/AttachmentPane.qml
qml/ReplyPane.qml
qml/CompletionMenu.qml
qml/PieProgressBar.qml
qml/QuickFormatBar.qml
qml/EmojiPicker.qml
qml/UserDetailDialog.qml
qml/CreateRoomDialog.qml
qml/EmojiDialog.qml
qml/OpenFileDialog.qml
qml/KeyVerificationDialog.qml
qml/ConfirmLogoutDialog.qml
@@ -237,9 +245,6 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/ConfirmEncryptionDialog.qml
qml/RemoveSheet.qml
qml/BanSheet.qml
qml/EmojiTonesPicker.qml
qml/EmojiDelegate.qml
qml/EmojiGrid.qml
qml/RoomSearchPage.qml
qml/LocationChooser.qml
qml/TimelineView.qml
@@ -263,7 +268,6 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/SelectParentDialog.qml
qml/QrCodeMaximizeComponent.qml
qml/SelectSpacesDialog.qml
qml/AttachDialog.qml
qml/NotificationsView.qml
qml/SearchPage.qml
qml/ServerComboBox.qml
@@ -281,15 +285,25 @@ qt_add_qml_module(neochat URI org.kde.neochat NO_PLUGIN
qml/ConfirmLeaveDialog.qml
qml/CodeMaximizeComponent.qml
qml/EditStateDialog.qml
RESOURCES
qml/confetti.png
qml/glowdot.png
qml/ConsentDialog.qml
qml/AskDirectChatConfirmation.qml
qml/HoverLinkIndicator.qml
DEPENDENCIES
QtCore
QtQuick
IMPORTS
org.kde.neochat.timeline
org.kde.neochat.settings
org.kde.neochat.devtools
org.kde.neochat.login
org.kde.neochat.chatbar
)
add_subdirectory(settings)
add_subdirectory(timeline)
add_subdirectory(devtools)
add_subdirectory(login)
add_subdirectory(chatbar)
if(UNIX)
qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml)
@@ -372,16 +386,18 @@ endif()
if (NOT ANDROID AND NOT WIN32 AND NOT APPLE)
target_compile_definitions(neochat PUBLIC -DHAVE_RUNNER)
target_compile_definitions(neochat PUBLIC -DHAVE_X11)
target_compile_definitions(neochat PUBLIC -DHAVE_X11=1)
target_sources(neochat PRIVATE runner.cpp)
if (TARGET KUnifiedPush)
target_sources(neochat PRIVATE fakerunner.cpp)
endif()
else()
target_compile_definitions(neochat PUBLIC -DHAVE_X11=0)
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 PRIVATE settingsplugin timelineplugin devtoolsplugin loginplugin chatbarplugin)
target_link_libraries(neochat PUBLIC
Qt::Core
Qt::Quick

View File

@@ -91,10 +91,18 @@ 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 Quotient_VERSION_MINOR > 8
if (event->senderId() == m_room->localMember().id() && event->has<EventContent::TextContent>()) {
#else
if (event->senderId() == m_room->localMember().id() && event->hasTextContent()) {
#endif
QString originalString;
if (event->content()) {
#if Quotient_VERSION_MINOR > 8
originalString = event->get<EventContent::TextContent>()->body;
#else
originalString = static_cast<const Quotient::EventContent::TextContent *>(event->content())->body;
#endif
} else {
originalString = event->plainBody();
}

View File

@@ -13,13 +13,15 @@ import org.kde.neochat
QQC2.Popup {
id: root
padding: 16
padding: Kirigami.Units.largeSpacing
signal chosen(string path)
contentItem: RowLayout {
spacing: Kirigami.Units.smallSpacing
QQC2.ToolButton {
Layout.preferredWidth: 160
Layout.fillHeight: true
icon.name: 'mail-attachment'
@@ -28,7 +30,7 @@ QQC2.Popup {
onClicked: {
root.close();
var fileDialog = openFileDialog.createObject(QQC2.ApplicationWindow.overlay);
var fileDialog = openFileDialog.createObject(QQC2.Overlay.overlay);
fileDialog.chosen.connect(path => root.chosen(path));
fileDialog.open();
}
@@ -37,11 +39,8 @@ QQC2.Popup {
Kirigami.Separator {}
QQC2.ToolButton {
Layout.preferredWidth: 160
Layout.fillHeight: true
padding: 16
icon.name: 'insert-image'
text: i18n("Clipboard image")
onClicked: {

View File

@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
# SPDX-License-Identifier: BSD-2-Clause
qt_add_library(chatbar STATIC)
ecm_add_qml_module(chatbar GENERATE_PLUGIN_SOURCE
URI org.kde.neochat.chatbar
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/chatbar
QML_FILES
AttachDialog.qml
ChatBar.qml
CompletionMenu.qml
EmojiDelegate.qml
EmojiGrid.qml
ReplyPane.qml
PieProgressBar.qml
EmojiPicker.qml
EmojiDialog.qml
EmojiTonesPicker.qml
)

View File

@@ -115,7 +115,7 @@ QQC2.Control {
displayHint: QQC2.AbstractButton.IconOnly
onTriggered: {
locationChooser.createObject(QQC2.ApplicationWindow.overlay, {
locationChooser.createObject(QQC2.Overlay.overlay, {
room: root.currentRoom
}).open();
}
@@ -278,6 +278,8 @@ QQC2.Control {
Keys.onTabPressed: {
if (completionMenu.visible) {
completionMenu.complete();
} else {
contextDrawer.handle.children[0].forceActiveFocus()
}
}
Keys.onPressed: event => {
@@ -362,7 +364,7 @@ QQC2.Control {
ReplyPane {
userName: _private.chatBarCache.relationUser.displayName
userColor: _private.chatBarCache.relationUser.color
userAvatar: _private.chatBarCache.relationUser.avatarSource
userAvatar: _private.chatBarCache.relationUser.avatarUrl
text: _private.chatBarCache.relationMessage
onCancel: {

View File

@@ -24,7 +24,7 @@ QQC2.ItemDelegate {
contentItem: Item {
Kirigami.Heading {
anchors.fill: parent
visible: !root.emoji.startsWith("image") && !root.isImage
visible: !root.emoji.startsWith("mxc") && !root.isImage
text: root.emoji
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
@@ -41,17 +41,17 @@ QQC2.ItemDelegate {
}
Image {
anchors.fill: parent
visible: root.emoji.startsWith("image") || root.isImage
visible: root.emoji.startsWith("mxc") || root.isImage
source: visible ? root.emoji : ""
}
}
background: Rectangle {
color: root.checked ? Kirigami.Theme.highlightColor : Kirigami.Theme.backgroundColor
radius: Kirigami.Units.smallSpacing
radius: Kirigami.Units.cornerRadius
Rectangle {
radius: Kirigami.Units.smallSpacing
radius: Kirigami.Units.cornerRadius
anchors.fill: parent
color: Kirigami.Theme.highlightColor
opacity: root.hovered && !root.pressed ? 0.2 : 0

View File

@@ -38,18 +38,22 @@ QQC2.Popup {
}
background: Kirigami.ShadowedRectangle {
Kirigami.Theme.colorSet: Kirigami.Theme.View
radius: Kirigami.Units.cornerRadius
color: Kirigami.Theme.backgroundColor
radius: Kirigami.Units.mediumSpacing
shadow {
size: Kirigami.Units.largeSpacing
color: Qt.rgba(0.0, 0.0, 0.0, 0.3)
yOffset: 2
}
border {
color: Kirigami.ColorUtils.tintWithAlpha(color, Kirigami.Theme.textColor, 0.15)
width: 2
width: 1
color: Kirigami.ColorUtils.linearInterpolation(Kirigami.Theme.backgroundColor, Kirigami.Theme.textColor, Kirigami.Theme.frameContrast)
}
shadow {
size: Kirigami.Units.gridUnit
yOffset: 0
color: Qt.rgba(0, 0, 0, 0.2)
}
Kirigami.Theme.inherit: false
Kirigami.Theme.colorSet: Kirigami.Theme.View
}
modal: true

View File

@@ -30,7 +30,7 @@ QQC2.Popup {
onOpened: x = Math.min(parent.mapFromGlobal(QQC2.Overlay.overlay.width - root.width, 0).x, -(width - parent.width) / 2)
background: Kirigami.ShadowedRectangle {
color: Kirigami.Theme.backgroundColor
radius: Kirigami.Units.mediumSpacing
radius: Kirigami.Units.cornerRadius
shadow {
size: Kirigami.Units.largeSpacing
color: Qt.rgba(0.0, 0.0, 0.0, 0.3)

View File

@@ -3,6 +3,8 @@
#include "chatbarcache.h"
#include <Quotient/roommember.h>
#include "chatdocumenthandler.h"
#include "eventhandler.h"
#include "neochatroom.h"
@@ -84,7 +86,7 @@ void ChatBarCache::setEditId(const QString &editId)
Q_EMIT attachmentPathChanged();
}
QVariantMap ChatBarCache::relationUser() const
Quotient::RoomMember ChatBarCache::relationUser() const
{
if (parent() == nullptr) {
qWarning() << "ChatBarCache created with no parent, a NeoChatRoom must be set as the parent on creation.";
@@ -96,9 +98,9 @@ QVariantMap ChatBarCache::relationUser() const
return {};
}
if (m_relationId.isEmpty()) {
return room->getUser(nullptr);
return room->member(QString());
}
return room->getUser(room->user((*room->findInTimeline(m_relationId))->senderId()));
return room->member((*room->findInTimeline(m_relationId))->senderId());
}
QString ChatBarCache::relationMessage() const
@@ -118,7 +120,11 @@ QString ChatBarCache::relationMessage() const
if (auto event = room->findInTimeline(m_relationId); event != room->historyEdge()) {
EventHandler eventhandler(room, &**event);
return eventhandler.getMarkdownBody();
if (isEditing()) {
return eventhandler.getMarkdownBody();
} else {
return eventhandler.getMarkdownBody().toHtmlEscaped();
}
}
return {};
}

View File

@@ -10,6 +10,12 @@
class ChatDocumentHandler;
namespace Quotient
{
class RoomMember;
}
/**
* @brief Defines a user mention in the current chat or edit text.
*/
@@ -88,26 +94,13 @@ class ChatBarCache : public QObject
Q_PROPERTY(QString editId READ editId WRITE setEditId NOTIFY relationIdChanged)
/**
* @brief Get the user for the message being replied to.
* @brief Get the RoomMember object for the message being replied to.
*
* This is different to getting a Quotient::User object
* as neither of those can provide details like the displayName or avatarMediaId
* without the room context as these can vary from room to room.
* Returns an empty RoomMember if not replying to a message.
*
* Returns an empty user if not replying to a message.
*
* The user QVariantMap has the following properties:
* - isLocalUser - Whether the user is the local user.
* - id - The matrix ID of the user.
* - displayName - Display name in the context of this room.
* - avatarSource - The mxc URL for the user's avatar in the current room.
* - avatarMediaId - Avatar id in the context of this room.
* - color - Color for the user.
* - object - The Quotient::User object for the user.
*
* @sa getUser, Quotient::User
* @sa Quotient::RoomMember
*/
Q_PROPERTY(QVariantMap relationUser READ relationUser NOTIFY relationIdChanged)
Q_PROPERTY(Quotient::RoomMember relationUser READ relationUser NOTIFY relationIdChanged)
/**
* @brief The content of the related message.
@@ -161,7 +154,7 @@ public:
QString editId() const;
void setEditId(const QString &editId);
QVariantMap relationUser() const;
Quotient::RoomMember relationUser() const;
QString relationMessage() const;

View File

@@ -9,28 +9,20 @@
#include <KLocalizedString>
#include <QGuiApplication>
#include <QNetworkProxy>
#include <QQuickTextDocument>
#include <QQuickWindow>
#include <QStandardPaths>
#include <QStringBuilder>
#include <QTimer>
#include <signal.h>
#include <Quotient/accountregistry.h>
#include <Quotient/connection.h>
#include <Quotient/csapi/logout.h>
#include <Quotient/csapi/notifications.h>
#include <Quotient/eventstats.h>
#include <Quotient/qt_connection_util.h>
#include <Quotient/settings.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)
#include "trayicon.h"
@@ -46,6 +38,10 @@
#endif
#endif
#ifdef HAVE_KUNIFIEDPUSH
#include <kunifiedpush/connector.h>
#endif
bool testMode = false;
using namespace Quotient;
@@ -68,7 +64,11 @@ Controller::Controller(QObject *parent)
});
} else {
auto c = new NeoChatConnection(this);
#if Quotient_VERSION_MINOR > 8
c->assumeIdentity(QStringLiteral("@user:localhost:1234"), QStringLiteral("device_1234"), QStringLiteral("token_1234"));
#else
c->assumeIdentity(QStringLiteral("@user:localhost:1234"), QStringLiteral("token_1234"));
#endif
connect(c, &Connection::connected, this, [c, this]() {
m_accountRegistry.add(c);
c->syncLoop();
@@ -107,14 +107,16 @@ Controller::Controller(QObject *parent)
connect(&m_accountRegistry, &AccountRegistry::accountCountChanged, this, [this]() {
if (m_accountRegistry.size() > oldAccountCount) {
auto connection = dynamic_cast<NeoChatConnection *>(m_accountRegistry.accounts()[m_accountRegistry.size() - 1]);
connect(connection, &NeoChatConnection::syncDone, this, [connection]() {
NotificationsManager::instance().handleNotifications(connection);
});
connectSingleShot(connection, &NeoChatConnection::syncDone, this, [this, connection] {
if (!m_endpoint.isEmpty()) {
connection->setupPushNotifications(m_endpoint);
}
});
connect(
connection,
&NeoChatConnection::syncDone,
this,
[this, connection] {
if (!m_endpoint.isEmpty()) {
connection->setupPushNotifications(m_endpoint);
}
},
Qt::SingleShotConnection);
}
oldAccountCount = m_accountRegistry.size();
});
@@ -190,7 +192,7 @@ void Controller::invokeLogin()
m_accountsLoading += accountId;
Q_EMIT accountsLoadingChanged();
if (!account.homeserver().isEmpty()) {
auto accessTokenLoadingJob = loadAccessTokenFromKeyChain(account);
auto accessTokenLoadingJob = loadAccessTokenFromKeyChain(account.userId());
connect(accessTokenLoadingJob, &QKeychain::Job::finished, this, [accountId, this, accessTokenLoadingJob](QKeychain::Job *) {
AccountSettings account{accountId};
QString accessToken;
@@ -204,25 +206,43 @@ void Controller::invokeLogin()
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();
if (connection->allRooms().size() == 0 || connection->allRooms()[0]->currentState().get<RoomCreateEvent>()) {
addConnection(connection);
m_accountsLoading.removeAll(connection->userId());
m_connectionsLoading.remove(accountId);
Q_EMIT accountsLoadingChanged();
} else {
connect(
connection->allRooms()[0],
&Room::baseStateLoaded,
this,
[this, connection, accountId]() {
addConnection(connection);
m_accountsLoading.removeAll(connection->userId());
m_connectionsLoading.remove(accountId);
Q_EMIT accountsLoadingChanged();
},
Qt::SingleShotConnection);
}
});
connect(connection, &NeoChatConnection::networkError, this, [this](const QString &error, const QString &, int, int) {
Q_EMIT errorOccured(i18n("Network Error: %1", error), {});
});
#if Quotient_VERSION_MINOR > 8
connection->assumeIdentity(account.userId(), account.deviceId(), accessToken);
#else
connection->assumeIdentity(account.userId(), accessToken);
#endif
});
}
}
}
QKeychain::ReadPasswordJob *Controller::loadAccessTokenFromKeyChain(const AccountSettings &account)
QKeychain::ReadPasswordJob *Controller::loadAccessTokenFromKeyChain(const QString &userId)
{
qDebug() << "Reading access token from the keychain for" << account.userId();
qDebug() << "Reading access token from the keychain for" << userId;
auto job = new QKeychain::ReadPasswordJob(qAppName(), this);
job->setKey(account.userId());
job->setKey(userId);
// Handling of errors
connect(job, &QKeychain::Job::finished, this, [this, job]() {
@@ -253,23 +273,19 @@ QKeychain::ReadPasswordJob *Controller::loadAccessTokenFromKeyChain(const Accoun
return job;
}
bool Controller::saveAccessTokenToKeyChain(const AccountSettings &account, const QByteArray &accessToken)
void Controller::saveAccessTokenToKeyChain(const QString &userId, const QByteArray &accessToken)
{
qDebug() << "Save the access token to the keychain for " << account.userId();
QKeychain::WritePasswordJob job(qAppName());
job.setAutoDelete(false);
job.setKey(account.userId());
job.setBinaryData(accessToken);
QEventLoop loop;
QKeychain::WritePasswordJob::connect(&job, &QKeychain::Job::finished, &loop, &QEventLoop::quit);
job.start();
loop.exec();
if (job.error()) {
qWarning() << "Could not save access token to the keychain: " << qPrintable(job.errorString());
return false;
}
return true;
qDebug() << "Save the access token to the keychain for " << userId;
auto job = new QKeychain::WritePasswordJob(qAppName());
job->setAutoDelete(true);
job->setKey(userId);
job->setBinaryData(accessToken);
connect(job, &QKeychain::WritePasswordJob::finished, this, [job]() {
if (job->error()) {
qWarning() << "Could not save access token to the keychain: " << qPrintable(job->errorString());
}
});
job->start();
}
bool Controller::supportSystemTray() const
@@ -394,8 +410,6 @@ QString Controller::loadFileContent(const QString &path) const
return QString::fromLatin1(file.readAll());
}
#include "moc_controller.cpp"
void Controller::setTestMode(bool test)
{
testMode = test;
@@ -411,11 +425,13 @@ void Controller::removeConnection(const QString &userId)
}
}
bool Controller::ssssSupported() const
bool Controller::csSupported() const
{
#if __has_include("Quotient/e2ee/sssshandler.h")
#if Quotient_VERSION_MINOR > 9
return true;
#else
return false;
#endif
}
#include "moc_controller.cpp"

View File

@@ -5,15 +5,9 @@
#include <QObject>
#include <QQmlEngine>
#include <QQuickItem>
#include "neochatconnection.h"
#include <Quotient/accountregistry.h>
#include <Quotient/settings.h>
#ifdef HAVE_KUNIFIEDPUSH
#include <kunifiedpush/connector.h>
#endif
class TrayIcon;
class QQuickTextDocument;
@@ -56,9 +50,19 @@ class Controller : public QObject
Q_PROPERTY(QStringList accountsLoading MEMBER m_accountsLoading NOTIFY accountsLoadingChanged)
Q_PROPERTY(bool ssssSupported READ ssssSupported CONSTANT)
Q_PROPERTY(bool csSupported READ csSupported CONSTANT)
public:
/**
* @brief Define the types on inline messages that can be shown.
*/
enum MessageType {
Positive, /**< Positive message, typically green. */
Info, /**< Info message, typically highlight color. */
Error, /**< Error message, typically red. */
};
Q_ENUM(MessageType)
static Controller &instance();
static Controller *create(QQmlEngine *engine, QJSEngine *)
{
@@ -82,7 +86,7 @@ public:
/**
* @brief Save an access token to the keychain for the given account.
*/
bool saveAccessTokenToKeyChain(const Quotient::AccountSettings &account, const QByteArray &accessToken);
void saveAccessTokenToKeyChain(const QString &userId, const QByteArray &accessToken);
[[nodiscard]] bool supportSystemTray() const;
@@ -102,7 +106,7 @@ public:
Q_INVOKABLE void removeConnection(const QString &userId);
bool ssssSupported() const;
bool csSupported() const;
private:
explicit Controller(QObject *parent = nullptr);
@@ -110,14 +114,14 @@ private:
QPointer<NeoChatConnection> m_connection;
TrayIcon *m_trayIcon = nullptr;
QKeychain::ReadPasswordJob *loadAccessTokenFromKeyChain(const Quotient::AccountSettings &account);
QKeychain::ReadPasswordJob *loadAccessTokenFromKeyChain(const QString &account);
void loadSettings();
void saveSettings() const;
Quotient::AccountRegistry m_accountRegistry;
QStringList m_accountsLoading;
QMap<QString, QPointer<Quotient::Connection>> m_connectionsLoading;
QMap<QString, QPointer<NeoChatConnection>> m_connectionsLoading;
QString m_endpoint;
private Q_SLOTS:
@@ -131,4 +135,5 @@ Q_SIGNALS:
void connectionDropped(NeoChatConnection *connection);
void activeConnectionChanged(NeoChatConnection *connection);
void accountsLoadingChanged();
void showMessage(MessageType messageType, const QString &message);
};

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: BSD-2-Clause
qt_add_library(devtools STATIC)
qt_add_qml_module(devtools
ecm_add_qml_module(devtools GENERATE_PLUGIN_SOURCE
URI org.kde.neochat.devtools
OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/src/org/kde/neochat/devtools
QML_FILES

View File

@@ -15,6 +15,12 @@ FormCard.FormCardPage {
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormCheckDelegate {
text: i18nc("@option:check", "Show hidden events in the timeline")
checked: Config.showAllEvents
onToggled: Config.showAllEvents = checked
}
FormCard.FormCheckDelegate {
id: roomAccountDataVisibleCheck
text: i18nc("@option:check Enable the matrix 'threads' feature", "Always allow device verification")
@@ -23,5 +29,14 @@ FormCard.FormCardPage {
onToggled: Config.alwaysVerifyDevice = checked
}
FormCard.FormCheckDelegate {
text: i18nc("@option:check", "Show focus in window header")
checked: Config.windowTitleFocus
onToggled: {
Config.windowTitleFocus = checked;
Config.save();
}
}
}
}

View File

@@ -31,12 +31,12 @@ FormCard.FormCardPage {
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: qsTr("Room Data")
text: i18nc("@title:tab", "Room Data")
implicitWidth: tabBar.tabWidth
}
QQC2.TabButton {
text: qsTr("Server Info")
text: i18nc("@title:tab", "Server Info")
implicitWidth: tabBar.tabWidth
}

View File

@@ -28,5 +28,14 @@ FormCard.FormCardPage {
onToggled: Config.secretBackup = checked
}
FormCard.FormCheckDelegate {
text: i18nc("@option:check Enable the matrix feature to add a phone number as a third party ID", "Add phone numbers as 3PIDs")
checked: Config.phone3PId
onToggled: {
Config.phone3PId = checked
Config.save();
}
}
}
}

View File

@@ -25,9 +25,10 @@ ColumnLayout {
text: i18n("Room")
textRole: "escapedDisplayName"
valueRole: "roomId"
displayText: RoomManager.roomListModel.data(RoomManager.roomListModel.index(currentIndex, 0), RoomListModel.DisplayNameRole)
displayText: RoomManager.roomListModel.data(RoomManager.roomListModel.index(currentIndex, 0), RoomListModel.EscapedDisplayNameRole)
model: RoomManager.roomListModel
currentIndex: 0
displayMode: FormCard.FormComboBoxDelegate.Page
Component.onCompleted: currentIndex = RoomManager.roomListModel.rowForRoom(root.room)
onCurrentValueChanged: root.room = RoomManager.roomListModel.roomByAliasOrId(roomComboBox.currentValue)
}

View File

@@ -33,6 +33,7 @@ public:
* a room message.
*/
enum Type {
Author, /**< The message sender and time. */
Text, /**< A text message. */
Image, /**< A message that is an image. */
Audio, /**< A message that is an audio recording. */
@@ -47,11 +48,11 @@ public:
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. */
Loading, /**< The component is loading. */
Other, /**< Anything that cannot be classified as another type. */
};
Q_ENUM(Type);

View File

@@ -21,7 +21,6 @@ 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. */
@@ -68,8 +67,6 @@ public:
return i18n("Low priority");
case NeoChatRoomType::Space:
return i18n("Spaces");
case NeoChatRoomType::Search:
return i18n("Search");
default:
return {};
}
@@ -89,8 +86,6 @@ public:
return QStringLiteral("object-order-lower");
case NeoChatRoomType::Space:
return QStringLiteral("group");
case NeoChatRoomType::Search:
return QStringLiteral("search");
default:
return QStringLiteral("tools-report-bug");
}

109
src/enums/powerlevel.cpp Normal file
View File

@@ -0,0 +1,109 @@
// 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
#include "powerlevel.h"
QString PowerLevel::nameForLevel(Level level)
{
switch (level) {
case PowerLevel::Member:
return i18n("Member");
case PowerLevel::Moderator:
return i18n("Moderator");
case PowerLevel::Admin:
return i18n("Admin");
case PowerLevel::Mute:
return i18n("Mute");
case PowerLevel::Custom:
return i18n("Custom");
default:
return {};
}
}
int PowerLevel::valueForLevel(Level level)
{
switch (level) {
case PowerLevel::Member:
return 0;
case PowerLevel::Moderator:
return 50;
case PowerLevel::Admin:
return 100;
case PowerLevel::Mute:
return -1;
default:
return {};
}
}
PowerLevel::Level PowerLevel::levelForValue(int value)
{
switch (value) {
case 0:
return PowerLevel::Member;
case 50:
return PowerLevel::Moderator;
case 100:
return PowerLevel::Admin;
case -1:
return PowerLevel::Mute;
default:
return PowerLevel::Custom;
}
}
PowerLevelModel::PowerLevelModel(QObject *parent)
: QAbstractListModel(parent)
{
}
bool PowerLevelModel::showMute() const
{
return m_showMute;
}
void PowerLevelModel::setShowMute(bool showMute)
{
if (showMute == m_showMute) {
return;
}
m_showMute = showMute;
Q_EMIT showMuteChanged();
}
QVariant PowerLevelModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid()) {
return {};
}
if (index.row() >= rowCount()) {
qDebug() << "PowerLevelModel, something's wrong: index.row() >= m_rules.count()";
return {};
}
const auto level = static_cast<PowerLevel::Level>(index.row());
if (role == NameRole) {
return i18nc("%1 is the name of the power level, e.g. admin and %2 is the value that represents.",
"%1 (%2)",
PowerLevel::nameForLevel(level),
PowerLevel::valueForLevel(level));
}
if (role == ValueRole) {
return PowerLevel::valueForLevel(level);
}
return {};
}
int PowerLevelModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
return PowerLevel::NUMLevels - (m_showMute ? 0 : 1);
}
QHash<int, QByteArray> PowerLevelModel::roleNames() const
{
return {{NameRole, "name"}, {ValueRole, "value"}};
}
#include "moc_powerlevel.cpp"

110
src/enums/powerlevel.h Normal file
View File

@@ -0,0 +1,110 @@
// 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 <QAbstractListModel>
#include <QObject>
#include <QQmlEngine>
#include <KLocalizedString>
/**
* @class PowerLevel
*
* This class is designed to define the PowerLevel enumeration.
*/
class PowerLevel : public QObject
{
Q_OBJECT
QML_ELEMENT
QML_UNCREATABLE("")
public:
/**
* @brief The type of delegate that is needed for 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.
*/
enum Level {
Member, /**< A basic member. */
Moderator, /**< A moderator with enhanced powers. */
Admin, /**< The highest power level in the room. */
Mute, /**< The level to remove posting privileges. */
NUMLevels,
Custom, /**< A non-standard value. Intentionally after NUMLevels so it doesn't appear in the model. */
};
Q_ENUM(Level);
/**
* @brief Return a string representation of the enum value.
*/
static QString nameForLevel(Level level);
/**
* @brief Return the integer representation of the enum value.
*/
static int valueForLevel(Level level);
/**
* @brief Return the enum value for the given integer power level.
*/
static Level levelForValue(int value);
};
/**
* @class PowerLevelModel
*
* A model visualize the allowed power levels.
*/
class PowerLevelModel : public QAbstractListModel
{
Q_OBJECT
QML_ELEMENT
Q_PROPERTY(bool showMute READ showMute WRITE setShowMute NOTIFY showMuteChanged)
public:
/**
* @brief Defines the model roles.
*/
enum Roles {
NameRole = Qt::DisplayRole, /**< The power level name. */
ValueRole, /**< The power level value. */
};
Q_ENUM(Roles)
explicit PowerLevelModel(QObject *parent = nullptr);
[[nodiscard]] bool showMute() const;
void setShowMute(bool showMute);
/**
* @brief Get the given role value at the given index.
*
* @sa QAbstractItemModel::data
*/
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
/**
* @brief Number of rows in the model.
*
* @sa QAbstractItemModel::rowCount
*/
[[nodiscard]] int rowCount(const QModelIndex &parent = QModelIndex()) const override;
/**
* @brief Returns a mapping from Role enum values to role names.
*
* @sa Roles, QAbstractItemModel::roleNames()
*/
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
Q_SIGNALS:
void showMuteChanged();
private:
bool m_showMute = true;
};

View File

@@ -9,6 +9,8 @@
#include <Quotient/eventitem.h>
#include <Quotient/events/encryptionevent.h>
#include <Quotient/events/event.h>
#include <Quotient/events/eventcontent.h>
#include <Quotient/events/reactionevent.h>
#include <Quotient/events/redactionevent.h>
#include <Quotient/events/roomavatarevent.h>
@@ -19,11 +21,11 @@
#include <Quotient/events/simplestateevents.h>
#include <Quotient/events/stickerevent.h>
#include <Quotient/quotient_common.h>
#include <Quotient/roommember.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"
@@ -61,22 +63,6 @@ MessageComponentType::Type EventHandler::messageComponentType() const
return MessageComponentType::typeForEvent(*m_event);
}
QVariantMap EventHandler::getAuthor(bool isPending) const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getAuthor called with m_room set to nullptr.";
return {};
}
// If we have a room we can return an empty user by handing nullptr to m_room->getUser.
if (m_event == nullptr) {
qCWarning(EventHandling) << "getAuthor called with m_event set to nullptr. Returning empty user.";
return m_room->getUser(nullptr);
}
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
return m_room->getUser(author);
}
QString EventHandler::getAuthorDisplayName(bool isPending) const
{
if (m_room == nullptr) {
@@ -96,8 +82,8 @@ QString EventHandler::getAuthorDisplayName(bool isPending) const
}
return previousDisplayName;
} else {
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
return m_room->htmlSafeMemberName(author->id());
const auto author = isPending ? m_room->localMember() : m_room->member(m_event->senderId());
return author.htmlSafeDisplayName();
}
}
@@ -112,8 +98,8 @@ QString EventHandler::singleLineAuthorDisplayname(bool isPending) const
return {};
}
const auto author = isPending ? m_room->localUser() : m_room->user(m_event->senderId());
auto displayName = m_room->safeMemberName(author->id());
const auto author = isPending ? m_room->localMember() : m_room->member(m_event->senderId());
auto displayName = author.displayName();
displayName.replace(QStringLiteral("<br>\n"), QStringLiteral(" "));
displayName.replace(QStringLiteral("<br>"), QStringLiteral(" "));
displayName.replace(QStringLiteral("<br />\n"), QStringLiteral(" "));
@@ -159,6 +145,11 @@ QString EventHandler::getTimeString(bool relative, QLocale::FormatType format, b
return {};
}
QString EventHandler::getTimeString(const QString &format, bool isPending, const QDateTime &lastUpdated)
{
return getTime(isPending, lastUpdated).toLocalTime().toString(format);
}
bool EventHandler::isHighlighted()
{
if (m_room == nullptr) {
@@ -220,7 +211,7 @@ bool EventHandler::isHidden()
}
}
if (m_room->connection()->isIgnored(m_room->user(m_event->senderId()))) {
if (m_room->connection()->isIgnored(m_event->senderId())) {
return true;
}
@@ -243,19 +234,34 @@ Qt::TextFormat EventHandler::messageBodyInputFormat(const Quotient::RoomMessageE
QString EventHandler::rawMessageBody(const Quotient::RoomMessageEvent &event)
{
QString body;
#if Quotient_VERSION_MINOR > 8
if (event.has<EventContent::FileContent>()) {
#else
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;
#endif
// if filename is given or body is equal to filename,
// then body is a caption
#if Quotient_VERSION_MINOR > 8
QString filename = event.get<EventContent::FileContent>()->originalName;
#else
QString filename = event.content()->fileInfo()->originalName;
#endif
QString body = event.plainBody();
if (filename.isEmpty() || filename == body) {
return QString();
}
return fileCaption;
return body;
}
QString body;
#if Quotient_VERSION_MINOR > 8
if (event.has<EventContent::TextContent>() && event.content()) {
body = event.get<EventContent::TextContent>()->body;
#else
if (event.hasTextContent() && event.content()) {
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body;
body = static_cast<const EventContent::TextContent *>(event.content())->body;
#endif
} else {
body = event.plainBody();
}
@@ -293,14 +299,17 @@ QString EventHandler::getMarkdownBody() const
}
const auto roomMessageEvent = eventCast<const RoomMessageEvent>(m_event);
return roomMessageEvent->plainBody();
QString plainBody = roomMessageEvent->plainBody();
plainBody.remove(TextRegex::removeReply);
return plainBody;
}
QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat format, bool stripNewlines) const
{
if (event->isRedacted()) {
auto reason = event->redactedBecause()->reason();
return (reason.isEmpty()) ? i18n("<i>[This message was deleted]</i>") : i18n("<i>[This message was deleted: %1]</i>", reason);
return (reason.isEmpty()) ? i18n("<i>[This message was deleted]</i>") : i18n("<i>[This message was deleted: %1]</i>", reason.toHtmlEscaped());
}
const bool prettyPrint = (format == Qt::RichText);
@@ -315,15 +324,19 @@ QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat f
},
[this, prettyPrint](const RoomMemberEvent &e) {
// FIXME: Rewind to the name that was at the time of this event
auto subjectName = m_room->htmlSafeMemberName(e.userId());
auto subjectName = m_room->member(e.userId()).htmlSafeDisplayName();
if (e.membership() == Membership::Leave) {
if (e.prevContent() && e.prevContent()->displayName) {
subjectName = sanitized(*e.prevContent()->displayName).toHtmlEscaped();
subjectName = sanitized(*e.prevContent()->displayName);
if (prettyPrint) {
subjectName = subjectName.toHtmlEscaped();
}
}
}
if (prettyPrint) {
subjectName = QStringLiteral("<a href=\"https://matrix.to/#/%1\">%2</a>").arg(e.userId(), subjectName);
subjectName = QStringLiteral("<a href=\"https://matrix.to/#/%1\" style=\"color: %2\">%3</a>")
.arg(e.userId(), m_room->member(e.userId()).color().name(), subjectName);
}
// The below code assumes senderName output in AuthorRole
@@ -437,7 +450,7 @@ QString EventHandler::getBody(const Quotient::RoomEvent *event, Qt::TextFormat f
[](const LocationBeaconEvent &e) {
return e.contentJson()["description"_ls].toString();
},
[](const ServerAclEvent &) {
[](const RoomServerAclEvent &) {
return i18n("changed the server access control lists for this room");
},
[](const WidgetEvent &e) {
@@ -463,11 +476,16 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm
{
TextHandler textHandler;
#if Quotient_VERSION_MINOR > 8
if (event.has<EventContent::FileContent>()) {
QString fileCaption = event.get<EventContent::FileContent>()->originalName;
#else
if (event.hasFileContent()) {
auto fileCaption = event.content()->fileInfo()->originalName;
#endif
if (fileCaption.isEmpty()) {
fileCaption = event.plainBody();
} else if (event.content()->fileInfo()->originalName != event.plainBody()) {
} else if (fileCaption != event.plainBody()) {
fileCaption = event.plainBody() + " | "_ls + fileCaption;
}
textHandler.setData(fileCaption);
@@ -475,8 +493,13 @@ QString EventHandler::getMessageBody(const RoomMessageEvent &event, Qt::TextForm
}
QString body;
#if Quotient_VERSION_MINOR > 8
if (event.has<EventContent::TextContent>() && event.content()) {
body = event.get<EventContent::TextContent>()->body;
#else
if (event.hasTextContent() && event.content()) {
body = static_cast<const MessageEventContent::TextContent *>(event.content())->body;
body = static_cast<const EventContent::TextContent *>(event.content())->body;
#endif
} else {
body = event.plainBody();
}
@@ -606,7 +629,7 @@ QString EventHandler::getGenericBody() const
[](const LocationBeaconEvent &) {
return i18n("sent a live location beacon");
},
[](const ServerAclEvent &) {
[](const RoomServerAclEvent &) {
return i18n("changed the server access control lists for this room");
},
[](const WidgetEvent &e) {
@@ -655,34 +678,67 @@ QVariantMap EventHandler::getMediaInfoForEvent(const Quotient::RoomEvent *event)
QString eventId = event->id();
// 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 Quotient_VERSION_MINOR > 8
if (!roomMessageEvent->has<EventContent::FileContentBase>()) {
#else
if (!roomMessageEvent->hasFileContent()) {
#endif
return {};
}
fileInfo = roomMessageEvent->content()->fileInfo();
#if Quotient_VERSION_MINOR > 8
const auto content = roomMessageEvent->get<EventContent::FileContentBase>();
QVariantMap mediaInfo = getMediaInfoFromFileInfo(content.get(), eventId, false, false);
#else
const auto content = static_cast<const EventContent::FileContent *>(roomMessageEvent->content());
QVariantMap mediaInfo = getMediaInfoFromFileInfo(content, eventId, false, false);
#endif
// if filename isn't specifically given, it is in body
// https://spec.matrix.org/latest/client-server-api/#mfile
#if Quotient_VERSION_MINOR > 8
mediaInfo["filename"_ls] = content->commonInfo().originalName.isEmpty() ? roomMessageEvent->plainBody() : content->commonInfo().originalName;
#else
mediaInfo["filename"_ls] = (content->fileInfo()->originalName.isEmpty()) ? roomMessageEvent->plainBody() : content->fileInfo()->originalName;
#endif
return mediaInfo;
} else if (event->is<StickerEvent>()) {
auto stickerEvent = eventCast<const StickerEvent>(event);
fileInfo = &stickerEvent->image();
isSticker = true;
auto content = &stickerEvent->image();
return getMediaInfoFromFileInfo(content, eventId, false, true);
} else {
return {};
}
return getMediaInfoFromFileInfo(fileInfo, eventId, false, isSticker);
}
QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo *fileInfo, const QString &eventId, bool isThumbnail, bool isSticker) const
QVariantMap EventHandler::getMediaInfoFromFileInfo(
#if Quotient_VERSION_MINOR > 8
const Quotient::EventContent::FileContentBase *fileContent,
#else
const Quotient::EventContent::TypedBase *fileContent,
#endif
const QString &eventId,
bool isThumbnail,
bool isSticker) const
{
QVariantMap mediaInfo;
// Get the mxc URL for the media.
if (!fileInfo->url().isValid() || fileInfo->url().scheme() != QStringLiteral("mxc") || eventId.isEmpty()) {
#if Quotient_VERSION_MINOR > 8
if (!fileContent->url().isValid() || fileContent->url().scheme() != QStringLiteral("mxc") || eventId.isEmpty()) {
#else
if (!fileContent->fileInfo()->url().isValid() || fileContent->fileInfo()->url().scheme() != QStringLiteral("mxc") || eventId.isEmpty()) {
#endif
mediaInfo["source"_ls] = QUrl();
} else {
QUrl source = m_room->makeMediaUrl(eventId, fileInfo->url());
#if Quotient_VERSION_MINOR > 8
QUrl source = m_room->makeMediaUrl(eventId, fileContent->url());
#else
QUrl source = m_room->makeMediaUrl(eventId, fileContent->fileInfo()->url());
#endif
if (source.isValid()) {
mediaInfo["source"_ls] = source;
@@ -691,7 +747,7 @@ QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo
}
}
auto mimeType = fileInfo->mimeType;
auto mimeType = fileContent->type();
// Add the MIME type for the media if available.
mediaInfo["mimeType"_ls] = mimeType.name();
@@ -699,45 +755,53 @@ QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo
mediaInfo["mimeIcon"_ls] = mimeType.iconName();
// Add media size if available.
mediaInfo["size"_ls] = fileInfo->payloadSize;
#if Quotient_VERSION_MINOR > 8
mediaInfo["size"_ls] = fileContent->commonInfo().payloadSize;
#else
mediaInfo["size"_ls] = static_cast<const EventContent::FileContent *>(fileContent)->fileInfo()->payloadSize;
#endif
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)) {
if (auto castInfo = static_cast<const EventContent::ImageContent *>(fileContent)) {
#if Quotient_VERSION_MINOR > 8
mediaInfo["width"_ls] = castInfo->imageSize.width();
mediaInfo["height"_ls] = castInfo->imageSize.height();
#else
const auto imageInfo = static_cast<const EventContent::ImageInfo *>(castInfo->fileInfo());
mediaInfo["width"_ls] = imageInfo->imageSize.width();
mediaInfo["height"_ls] = imageInfo->imageSize.height();
#endif
// TODO: Images in certain formats (e.g. WebP) will be erroneously marked as animated, even if they are static.
mediaInfo["animated"_ls] = QMovie::supportedFormats().contains(mimeType.preferredSuffix().toUtf8());
if (!isThumbnail) {
QVariantMap tempInfo;
auto thumbnailInfo = getMediaInfoFromFileInfo(castInfo->thumbnailInfo(), eventId, true);
if (thumbnailInfo["source"_ls].toUrl().scheme() == "mxc"_ls) {
tempInfo = thumbnailInfo;
QVariantMap tempInfo;
auto thumbnailInfo = getMediaInfoFromTumbnail(castInfo->thumbnail, eventId);
if (thumbnailInfo["source"_ls].toUrl().scheme() == "mxc"_ls) {
tempInfo = thumbnailInfo;
} else {
QString blurhash = castInfo->originalInfoJson["xyz.amorgan.blurhash"_ls].toString();
if (blurhash.isEmpty()) {
tempInfo["source"_ls] = QUrl();
} else {
QString blurhash = castInfo->originalInfoJson["xyz.amorgan.blurhash"_ls].toString();
if (blurhash.isEmpty()) {
tempInfo["source"_ls] = QUrl();
} else {
tempInfo["source"_ls] = QUrl("image://blurhash/"_ls + blurhash);
}
tempInfo["source"_ls] = QUrl("image://blurhash/"_ls + blurhash);
}
mediaInfo["tempInfo"_ls] = tempInfo;
}
mediaInfo["tempInfo"_ls] = tempInfo;
}
}
if (mimeType.name().contains(QStringLiteral("video"))) {
if (auto castInfo = static_cast<const EventContent::VideoContent *>(fileInfo)) {
if (auto castInfo = static_cast<const EventContent::VideoContent *>(fileContent)) {
mediaInfo["width"_ls] = castInfo->imageSize.width();
mediaInfo["height"_ls] = castInfo->imageSize.height();
mediaInfo["duration"_ls] = castInfo->duration;
if (!isThumbnail) {
QVariantMap tempInfo;
auto thumbnailInfo = getMediaInfoFromFileInfo(castInfo->thumbnailInfo(), eventId, true);
auto thumbnailInfo = getMediaInfoFromTumbnail(castInfo->thumbnail, eventId);
if (thumbnailInfo["source"_ls].toUrl().scheme() == "mxc"_ls) {
tempInfo = thumbnailInfo;
} else {
@@ -753,7 +817,7 @@ QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo
}
}
if (mimeType.name().contains(QStringLiteral("audio"))) {
if (auto castInfo = static_cast<const EventContent::AudioContent *>(fileInfo)) {
if (auto castInfo = static_cast<const EventContent::AudioContent *>(fileContent)) {
mediaInfo["duration"_ls] = castInfo->duration;
}
}
@@ -761,6 +825,38 @@ QVariantMap EventHandler::getMediaInfoFromFileInfo(const EventContent::FileInfo
return mediaInfo;
}
QVariantMap EventHandler::getMediaInfoFromTumbnail(const Quotient::EventContent::Thumbnail &thumbnail, const QString &eventId) const
{
QVariantMap thumbnailInfo;
if (!thumbnail.url().isValid() || thumbnail.url().scheme() != QStringLiteral("mxc") || eventId.isEmpty()) {
thumbnailInfo["source"_ls] = QUrl();
} else {
QUrl source = m_room->makeMediaUrl(eventId, thumbnail.url());
if (source.isValid()) {
thumbnailInfo["source"_ls] = source;
} else {
thumbnailInfo["source"_ls] = QUrl();
}
}
auto mimeType = thumbnail.mimeType;
// Add the MIME type for the media if available.
thumbnailInfo["mimeType"_ls] = mimeType.name();
// Add the MIME type icon if available.
thumbnailInfo["mimeIcon"_ls] = mimeType.iconName();
// Add media size if available.
thumbnailInfo["size"_ls] = thumbnail.payloadSize;
thumbnailInfo["width"_ls] = thumbnail.imageSize.width();
thumbnailInfo["height"_ls] = thumbnail.imageSize.height();
return thumbnailInfo;
}
bool EventHandler::hasReply() const
{
if (m_event == nullptr) {
@@ -797,25 +893,21 @@ MessageComponentType::Type EventHandler::replyMessageComponentType() const
return MessageComponentType::typeForEvent(*replyEvent);
}
QVariantMap EventHandler::getReplyAuthor() const
Quotient::RoomMember EventHandler::getReplyAuthor() const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getReplyAuthor called with m_room set to nullptr.";
return {};
}
// If we have a room we can return an empty user by handing nullptr to m_room->getUser.
if (m_event == nullptr) {
qCWarning(EventHandling) << "getReplyAuthor called with m_event set to nullptr. Returning empty user.";
return m_room->getUser(nullptr);
return {};
}
auto replyPtr = m_room->getReplyForEvent(*m_event);
if (replyPtr) {
auto replyUser = m_room->user(replyPtr->senderId());
return m_room->getUser(replyUser);
if (auto replyPtr = m_room->getReplyForEvent(*m_event)) {
return m_room->member(replyPtr->senderId());
} else {
return m_room->getUser(nullptr);
return m_room->member(QString());
}
}
@@ -951,97 +1043,4 @@ QString EventHandler::getLocationAssetType() const
return assetType;
}
bool EventHandler::hasReadMarkers() const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "hasReadMarkers called with m_room set to nullptr.";
return false;
}
if (m_event == nullptr) {
qCWarning(EventHandling) << "hasReadMarkers called with m_event set to nullptr.";
return false;
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
return userIds.size() > 0;
}
QVariantList EventHandler::getReadMarkers(int maxMarkers) const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getReadMarkers called with m_room set to nullptr.";
return {};
}
if (m_event == nullptr) {
qCWarning(EventHandling) << "getReadMarkers called with m_event set to nullptr.";
return {};
}
auto userIds_temp = m_room->userIdsAtEvent(m_event->id());
userIds_temp.remove(m_room->localUser()->id());
auto userIds = userIds_temp.values();
if (userIds.count() > maxMarkers) {
userIds = userIds.mid(0, maxMarkers);
}
QVariantList users;
users.reserve(userIds.size());
for (const auto &userId : userIds) {
auto user = m_room->user(userId);
users += m_room->getUser(user);
}
return users;
}
QString EventHandler::getNumberExcessReadMarkers(int maxMarkers) const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getNumberExcessReadMarkers called with m_room set to nullptr.";
return {};
}
if (m_event == nullptr) {
qCWarning(EventHandling) << "getNumberExcessReadMarkers called with m_event set to nullptr.";
return {};
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
if (userIds.count() > maxMarkers) {
return QStringLiteral("+ ") + QString::number(userIds.count() - maxMarkers);
} else {
return QString();
}
}
QString EventHandler::getReadMarkersString() const
{
if (m_room == nullptr) {
qCWarning(EventHandling) << "getReadMarkersString called with m_room set to nullptr.";
return {};
}
if (m_event == nullptr) {
qCWarning(EventHandling) << "getReadMarkersString called with m_event set to nullptr.";
return {};
}
auto userIds = m_room->userIdsAtEvent(m_event->id());
userIds.remove(m_room->localUser()->id());
/**
* The string ends up in the form
* "x users: user1DisplayName, user2DisplayName, etc."
*/
QString readMarkersString = i18np("1 user: ", "%1 users: ", userIds.size());
for (const auto &userId : userIds) {
auto user = m_room->user(userId);
readMarkersString += user->displayname(m_room) + i18nc("list separator", ", ");
}
readMarkersString.chop(2);
return readMarkersString;
}
#include "moc_eventhandler.cpp"

View File

@@ -13,6 +13,11 @@
#include "enums/messagecomponenttype.h"
namespace Quotient
{
class RoomMember;
}
class LinkPreviewer;
class NeoChatRoom;
class ReactionModel;
@@ -48,38 +53,10 @@ public:
*/
MessageComponentType::Type messageComponentType() const;
/**
* @brief Get the author of the event in context of the room.
*
* This is different to getting a Quotient::User object
* as neither of those can provide details like the displayName or avatarMediaId
* without the room context as these can vary from room to room. This function
* uses the room context and outputs the result as QVariantMap.
*
* An empty QVariantMap will be returned if the EventHandler hasn't had the room
* intialised. An empty user (i.e. a QVariantMap with all the correct keys
* but empty values) will be returned if the room has been set but not an event.
*
* @param isPending if the event is pending, i.e. has not been confirmed by
* the server.
*
* @return a QVariantMap for the user with the following properties:
* - isLocalUser - Whether the user is the local user.
* - id - The matrix ID of the user.
* - displayName - Display name in the context of this room.
* - avatarSource - The mxc URL for the user's avatar in the current room.
* - avatarMediaId - Avatar id in the context of this room.
* - color - Color for the user.
* - object - The Quotient::User object for the user.
*
* @sa Quotient::User
*/
QVariantMap getAuthor(bool isPending = false) const;
/**
* @brief Get the display name of the event author.
*
* This method is separate from getAuthor() and special in that it will return
* This method is special in that it will return
* the old display name of the author if the current event is one that caused it
* to change. This allows for scenarios where the UI wishes to notify that a
* user's display name has changed and what it changed from.
@@ -121,6 +98,8 @@ public:
*/
QString getTimeString(bool relative, QLocale::FormatType format = QLocale::ShortFormat, bool isPending = false, QDateTime lastUpdated = {}) const;
QString getTimeString(const QString &format, bool isPending = false, const QDateTime &lastUpdated = {});
/**
* @brief Whether the event should be highlighted in the timeline.
*
@@ -251,27 +230,17 @@ public:
/**
* @brief Get the author of the event replied to in context of the room.
*
* This is different to getting a Quotient::User object
* as neither of those can provide details like the displayName or avatarMediaId
* without the room context as these can vary from room to room. This function
* uses the room context and outputs the result as QVariantMap.
* An empty Quotient::RoomMember will be returned if the EventHandler hasn't had
* the room or event initialised.
*
* An empty QVariantMap will be returned if the EventHandler hasn't had the room
* intialised. An empty user (i.e. a QVariantMap with all the correct keys
* but empty values) will be returned if the room has been set but not an event.
* @param isPending if the event is pending, i.e. has not been confirmed by
* the server.
*
* @return a QVariantMap for the user with the following properties:
* - isLocalUser - Whether the user is the local user.
* - id - The matrix ID of the user.
* - displayName - Display name in the context of this room.
* - avatarSource - The mxc URL for the user's avatar in the current room.
* - avatarMediaId - Avatar id in the context of this room.
* - color - Color for the user.
* - object - The Quotient::User object for the user.
* @return a Quotient::RoomMember object for the user.
*
* @sa Quotient::User
* @sa Quotient::RoomMember
*/
QVariantMap getReplyAuthor() const;
Quotient::RoomMember getReplyAuthor() const;
/**
* @brief Output a string for the message content of the event replied to ready
@@ -360,43 +329,6 @@ public:
*/
QString getLocationAssetType() const;
/**
* @brief Whether the event has any read marker for other users.
*/
bool hasReadMarkers() const;
/**
* @brief Returns a list of user read marker for the event.
*
* @param maxMarkers the maximum number of users to return. Usually the number
* of user read makers shown is limited to not clutter the UI.
* This needs to be the same as used in getNumberExcessReadMarkers
* so that the markers line up with the number displayed, i.e.
* the number of users shown plus the excess number will be
* the total number of other user read markers at an event.
*/
QVariantList getReadMarkers(int maxMarkers = 5) const;
/**
* @brief Returns the number of excess user read markers for the event.
*
* This returns a string in the form "+ x" ready for use in the UI.
*
* @param maxMarkers the maximum number of markers shown in the UI. This needs to
* be the same as used in getReadMarkers so that the value lines
* up with the number displayed, i.e. the number of users shown
* plus the excess number will be the total number of other user
* read markers at an event.
*/
QString getNumberExcessReadMarkers(int maxMarkers = 5) const;
/**
* @brief Returns a string with the names of the read markers at the event.
*
* This is in the form "x users: name 1, name 2, ...".
*/
QString getReadMarkersString() const;
private:
const NeoChatRoom *m_room = nullptr;
const Quotient::RoomEvent *m_event = nullptr;
@@ -407,6 +339,14 @@ private:
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, bool isSticker = false) const;
QVariantMap getMediaInfoFromFileInfo(
#if Quotient_VERSION_MINOR > 8
const Quotient::EventContent::FileContentBase *fileContent,
#else
const Quotient::EventContent::TypedBase *fileContent,
#endif
const QString &eventId,
bool isThumbnail = false,
bool isSticker = false) const;
QVariantMap getMediaInfoFromTumbnail(const Quotient::EventContent::Thumbnail &thumbnail, const QString &eventId) const;
};

View File

@@ -3,6 +3,7 @@
#include "imagepackevent.h"
#include <QJsonObject>
#include <Quotient/omittable.h>
using namespace Quotient;
@@ -16,16 +17,16 @@ ImagePackEventContent::ImagePackEventContent(const QJsonObject &json)
fromJson<Omittable<QString>>(json["pack"_ls].toObject()["attribution"_ls]),
};
} else {
pack = none;
pack = std::nullopt;
}
const auto &keys = json["images"_ls].toObject().keys();
for (const auto &k : keys) {
Omittable<EventContent::ImageInfo> info;
std::optional<EventContent::ImageInfo> info;
if (json["images"_ls][k].toObject().contains(QStringLiteral("info"))) {
info = EventContent::ImageInfo(QUrl(json["images"_ls][k]["url"_ls].toString()), json["images"_ls][k]["info"_ls].toObject(), k);
} else {
info = none;
info = std::nullopt;
}
images += ImagePackImage{
k,

View File

@@ -26,10 +26,10 @@ public:
* @brief Defines the properties of an image pack.
*/
struct Pack {
Quotient::Omittable<QString> displayName; /**< The display name of the pack. */
Quotient::Omittable<QUrl> avatarUrl; /**< The source mxc URL for the pack avatar. */
Quotient::Omittable<QStringList> usage; /**< An array of the usages for this pack. Possible usages are "emoticon" and "sticker". */
Quotient::Omittable<QString> attribution; /**< The attribution for the pack author(s). */
std::optional<QString> displayName; /**< The display name of the pack. */
std::optional<QUrl> avatarUrl; /**< The source mxc URL for the pack avatar. */
std::optional<QStringList> usage; /**< An array of the usages for this pack. Possible usages are "emoticon" and "sticker". */
std::optional<QString> attribution; /**< The attribution for the pack author(s). */
};
/**
@@ -38,14 +38,14 @@ public:
struct ImagePackImage {
QString shortcode; /**< The shortcode for the image. */
QUrl url; /**< The mxc URL for this image. */
Quotient::Omittable<QString> body; /**< An optional text body for this image. */
Quotient::Omittable<Quotient::EventContent::ImageInfo> info; /**< The ImageInfo object used for the info block of m.sticker events. */
std::optional<QString> body; /**< An optional text body for this image. */
std::optional<Quotient::EventContent::ImageInfo> info; /**< The ImageInfo object used for the info block of m.sticker events. */
/**
* @brief An array of the usages for this image.
*
* The possible values match those of the usage key of a pack object.
*/
Quotient::Omittable<QStringList> usage;
std::optional<QStringList> usage;
};
/**
@@ -53,7 +53,7 @@ public:
*
* @sa Pack
*/
Quotient::Omittable<Pack> pack;
std::optional<Pack> pack;
/**
* @brief Return a vector of images in the pack.

View File

@@ -1,14 +0,0 @@
// 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

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