James Graham da1c664f94 Cherrypick Improve Text Handling to 23.04
Improve the handling of text both when sending and receiving.

The main feature is to fix the linked bug (and a host of others that are unreported but similar) which is caused by the fact that we don't properly clean html. This mr does that as per the matrix spec https://spec.matrix.org/v1.5/client-server-api/#mroommessage-msgtypes. So any disallowed tags or attributes are removed and it does the special handling for certain attributes.

Additionally the functions are also designed to cover any other text formatting required, particularly fro received strings.

The receive side is covered by 2 functions `handleRecieveRichText` and `handleRecievePlainText`. The rich/plain in the function name refers to the output type not the input type (both can take plain and rich input), so `handleRecieveRichText` is called to get a string suitable to go in a rich text control and `handleRecievePlainText` for a plain control.

The functions also handle the following some of which was previously handled by `eventToString` in `NeoChatRoom`:
- Strip and reply from the string
- Format any user mentions
- Linkify links in plain strings
- Handle mxc urls in rich text (uses the new `room->makeMediaUrl` functionality from libQuotient)
- `handleRecievePlainText` also deals with markup making `NeoChatRoom->subtitle` redundant

There is also an extensive test suite which defines the behaviour and the best way to review this is probably to look at the tests and decide whether you agree with the expected output given the inputs and/or if there is any missing behaviour.

The final aim especially with the test suite is to give us a framework to make further updates in the future easier and hopefully prevent a new feature breaking old behaviour with the tests.

BUG: 463932 \
BUG: 466330 \
BUG: 466930


(cherry picked from commit f6ba4f2ecd)
2023-03-13 18:18:17 +00:00
2021-04-02 23:55:13 +00:00
2023-02-27 19:13:48 +01:00
2023-01-19 17:17:47 +01:00
2022-09-21 12:07:44 +00:00
2022-11-13 15:16:08 +00:00
2023-03-13 03:53:42 +00:00
2023-02-27 19:13:48 +01:00
2023-01-28 22:57:15 +01:00
2023-03-09 15:50:43 +01:00
2021-01-27 14:51:10 +01:00
2021-01-27 18:54:13 +01:00
2021-05-22 19:12:29 +00:00
2023-02-27 19:13:48 +01:00

NeoChat

NeoChat is a client for Matrix, the decentralized communication protocol for instant messaging. It is a fork of Spectral, using KDE frameworks, most notably Kirigami, KConfig and KI18n.

Download on Flathub

Get it

A stable release is available for download for Linux distributions.

Along with the stable release, a Flatpak version is available for the nightly version:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak remote-add --if-not-exists kdeapps --from https://distribute.kde.org/kdeapps.flatpakrepo
flatpak install kdeapps org.kde.neochat

A nightly build is also available for Android in the KDE nightly F-Droid repo and can also directly be downloaded from the binary factory.

Nightly builds for Windows, MacOS and AppImages can also be downloaded from the binary factory.

Timeline

Features

  • Sending messages
  • Sending files from clipboard and filesystem
  • Reply to message (right-click on a message to access menu)
  • Start a private chat (but not encrypted)
  • Show notifications, for the moment there is only a global switch to disable it. We plan to implement the configuration part of the specification soon.
  • Autocompletion of usernames in chat
  • Emoji picker
  • Basic room setting page
  • Send and accept invitations
  • /rainbow (very important)
  • /me

NeoChat is still missing a few features to become a full-featured Matrix client (most notably encryption support and video chat support). We welcome contributions in this direction.

Contact

You can reach the maintainers at #neochat:kde.org, if you are already on Matrix. Development happens in http://invent.kde.org/network/neochat (not in GitHub).

Acknowledgement

This program utilizes libQuotient library and some C++ models from Quaternion.

This program is a fork of Spectral.

License

GPLv3

This program is licensed under GNU General Public License, Version 3.

Description
A client for matrix, the decentralized communication protocol
Readme 74 MiB
Languages
C++ 51.4%
QML 31.5%
C 15.1%
CMake 1.5%
Python 0.5%