Commit Graph

166 Commits

Author SHA1 Message Date
Krille 1484e6770f
chore: Add tests for converting event types 2025-01-14 12:49:15 +01:00
Krille 83f993a2ff
fix: Add missing redacts parameter when transforming to Event type 2025-01-14 10:12:22 +01:00
Karthikeyan S 64030693c9
chore: add transactionId getter to Event class 2025-01-08 23:07:32 +05:30
Krille bc328aab5c
refactor: Use Event instead of EventUpdate for storing in db 2025-01-07 14:56:04 +01:00
Krille 5ac6c940a9
refactor: Update rooms by event not event update 2025-01-07 12:36:49 +01:00
Krille 632ecbed7e
chore: Follow up store unable to decrypt information correctly 2024-12-31 13:36:11 +01:00
Mohammad Reza Moradi 9c32193dff
chore: add require trailing comma lint 2024-11-07 16:13:37 +01:00
The one with the braid 0be79a9ee9
chore: update Emote-only expressions
- update the emote base regex
- update documentation about emote computation
- add source for the emote regex
- explain use of regex replace instead of `calcUnlocalizedBody`

Signed-off-by: The one with the braid <info@braid.business>
2024-10-18 12:54:38 +02:00
Nicolas Werner e3d41bb449
fix: properly remove reply fallback from (un)localized body 2024-10-16 13:59:12 +02:00
Nicolas Werner e1f0d9c0ad
fix: edge cases when calculating (un)localized body
We used to randomly return an empty string when the formatted body was
empty, even though we never return an empty string usually. Similarly we
used to return the original formatted body in an edit, when the new
event has no formatted body.
2024-10-16 13:59:12 +02:00
Nicolas Werner a497a66012
chore: Add more (un)localized body tests
Covers a few edge cases that still fail. Changes to the unlocalizedBody
function shouldn't cause behavioural changes apart from fixing a few
edge cases.
2024-10-16 13:59:11 +02:00
Nicolas Werner c7d49695d5
fix: prevent body (and plaintextBody) from return html by accident
It is not clear why we ever would want to return the formatted_body when
we ask for the body, but it seems to not be used anywhere and there are
no tests covering that functionality. However it leads to suprising
results, where the plaintextBody can be tricked into returning html
without applying conversions. So we just get rid of that functionality.
2024-10-16 13:59:11 +02:00
td f79096dfbb
feat: support for authenticated media 2024-08-16 14:35:50 +05:30
td 4eb18f670f
fix: update last event properly on cancel send
also stores status in db
2024-07-31 14:36:25 +05:30
td 4c60e04c05
fix: add main thread receipts to event.receipts getter 2024-07-23 20:30:07 +05:30
krille-chan c5e6a89f05
refactor: Combine sendMessageTimeoutSeconds and sendTimelineEventTimeout
Those timeouts were basically the same
and both had the same default value
1 minute. I guess it was just a
mistake to duplicate this.
2024-05-20 16:57:55 +02:00
Krille 501c457ea1
refactor: delete not sent events without eventupdate stream workaround
This fixes several problems. First
sending a fake event through the
onEventUpdate stream was not a
good design and lead to problems
if you expect a timeline event but
then are unable to build the
event from json. This now uses
a new stream in the Client which
is listened to in the timeline to
delete an event which should be
much more reliable.
It also now throws an exception
if deleting the event fails
instead of returning true or false.
A deprecation note is added.
2024-05-08 12:02:55 +02:00
Krille bf5bf2adb0
refactor: Removes the behavior of deleting an event if the file is no longer cached
This brings more problems than it
helps. It leads to bugs like flickering
of sending images and also
confuses the user. This should
either be handled by the app
or the user.
2024-05-06 14:59:45 +02:00
Krille 5b46ae6e31
refactor: Use strippedstatevent as base for room state and user class
Before we have used the Event class for all
state events while for invite rooms those
actually were StrippedStateEvent objects. This
created some problems like we needed to set a
fake originServerTs (usually to DateTime.now()).
Actually we don't need the additional keys for
state events most of the time so just using
StrippedStateEvent for all states and typecasting
them to event where needed is not much of a
hassle while we benefit from a more clear
structure.
This also now uses StrippedStateEvent as a base
class for the User class which makes the User
class more minimal as keys like event_id and
origin_server_ts are no longer necessary. As we
create a lot of fake User objects where we had to
put fake values in it, it brings more benefits
than problems to just get rid of those fields.
2024-05-03 14:06:49 +02:00
Romain GUILLOT 22df8b39a8
feat: add fromLocalStoreOnly to Event.downloadAndDecryptAttachment
Signed-off-by: Romain GUILLOT <romain.guillot@arche-mc2.fr>
2024-03-06 12:13:07 +01:00
Nicolas Werner 5ffa99d994
fix: Do not assume a missing timestamp means "now"
This causes issues with state handling as we prefer the newer event. It
also has knock-on effects in other places. Instead set such events to
have an obviously invalid timestamp, which makes issues easier to
identify.

This may break invites showing a timestamp or the timestamps for just
sent events, if you rely on the timestamp getting set to "now".
2024-03-04 17:49:50 +01:00
Nicolas Werner 8b8a647cf9
chore: enable discarded_futures lint
BREAKING CHANGE: This changes the runInRoot method to not return a
future. As a user, if you need the result of an async computation passed
to runInRoot, please await it directly. Also the KeyVerification start
and a few call methods now return a future.
2023-11-17 12:59:27 +01:00
Nicolas Werner 82492f92e1
chore: upgrade lints 2023-11-02 10:20:33 +01:00
Krille b5b5cfee5e
fix: Convert linebreaks into br tags on markdown parsing
Removes two test cases in the markdown test which do not work anymore.
Reason for this is that just parsing a word inside of $$ word $$
katex is not valid anyway because katex is only made for mathematical
things. So the output is undefined behavior anyway.
2023-09-29 09:24:50 +02:00
Krille dd64f4702a
fix: Has new messages is never true 2023-08-10 08:44:07 +02:00
td d042f9e6ae
chore: pass event to redactedAnEvent and removedBy 2023-07-04 17:09:23 +05:30
Malin Errenst 395ef0eb8e
refactor: Use tryGet for type casts whenever possible 2023-06-21 15:04:46 +02:00
Malin Errenst 5943576b1b
refactor: Added type casts to match refactored matrix_api_lite 2023-06-16 12:42:10 +02:00
Reza 153005f4a7
chore: calculate unlocalized body 2023-05-17 08:37:41 +02:00
Krille c714574c3f
refactor: Check correct if null
This checks it in a more consistent way
and also makes developing new
databases easier as they
might set the json key but
set it null.
2023-05-11 12:17:53 +02:00
Nicolas Werner 663ab11ec5
feat: Support private read receipts
You can either set them to private on the client or overwrite the
behaviour for that on each readMarker call. This also handles incoming
thread receipts and tries its best to figure out what is the latest
receipt. This however breaks the old m.receipt account data event.
2023-04-21 18:31:15 +02:00
Nicolas Werner 7f519b5619 Merge branch 'main' into 'main'
Implement Thread creating/sending + added neccessary tests

Closes #351

See merge request famedly/company/frontend/famedlysdk!1262
2023-04-17 13:15:36 +00:00
Dmitriy Bragin 203fc25d7a feat: allow sending messages inside threads 2023-04-17 14:39:11 +03:00
Philipp Grieshofer 00cb292781 fix: Use MatrixLocalizations to calculate fallback user displayname 2023-03-13 15:49:05 +00:00
Nicolas Werner 6f6f6b5d10 Merge branch 'kushal/http-call-issue-fix' into 'main'
fix: http api call replaced with httpClient

See merge request famedly/company/frontend/famedlysdk!1189
2023-03-03 15:21:28 +00:00
m_kushal d48542a023 fix: http api call replaced with httpClient
Signed-off-by: m_kushal <kushalmahapatro@gmail.com>
2023-03-03 01:16:10 +04:00
Christian Pauly c5898f62b9 fix: Fake User object 2023-02-13 15:32:01 +01:00
Christian Pauly 411cf3d4ec fix: Redact originalSource on redaction 2022-10-28 12:30:27 +02:00
Christian Pauly 403824b261 feat: Store original event 2022-09-19 09:40:42 +02:00
Nicolas Werner 6555f36d6d feat: switch from pedantic to lints 2022-08-15 14:15:51 +00:00
Lanna Michalke 05ff61ac86 chore: introduce native implementations
- adds Client.nativeImplementations
 - deprecates Client.compute

Allows to properly implement accelerated native operations in web

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-07-28 13:30:22 +02:00
Christian Pauly 7885281c72 refactor: Use import sorter and ci templates 2022-07-21 15:44:04 +02:00
Christian Pauly 0ab2b7e443 refactor: add calcLocalizedBodyFallback method 2022-06-09 08:48:37 +02:00
Christian Pauly 58cfd1f688 refactor: Rename methods and get rid of all Future getter 2022-06-08 08:30:05 +02:00
Christian Pauly f1751a0744 refactor: Use single quotes 2022-06-07 08:53:14 +02:00
Henri Carnot fb18843b08 refactor: make sender getter async 2022-06-02 08:13:21 +00:00
Christian Pauly bce45cbf2b refactor: Remove old deprecations
They have been lived long
enough and the next version
will have breaking changes
anyway.
2022-04-22 12:44:45 +02:00
Krille Fear 2f4d455eee fix: Retry sending a file event 2022-04-08 08:41:55 +02:00
Krille Fear 6f977b7c9d fix: Store sending files in database and fix retrying to send them 2022-04-01 14:26:57 +02:00
Christian Pauly 6a57f99c00 feat: Pass through a custom image
resize function to the client

This allows the use of the
native imaging package in a more
easy way.
2022-03-30 11:15:04 +02:00