Commit Graph

618 Commits

Author SHA1 Message Date
Dmitriy Bragin 203fc25d7a feat: allow sending messages inside threads 2023-04-17 14:39:11 +03:00
Nicolas Werner 7039c33f3a
chore: Upgrade to matrix_api_lite 1.6 2023-04-17 13:23:51 +02:00
Philipp Grieshofer 9aff62a18c feat: Expose a getter for all rooms including archived rooms 2023-03-20 13:12:47 +00:00
Nicolas Werner 92999339a9 Merge branch 'krille/fake-user-event' into 'main'
fix: Fake User object

Closes #343

See merge request famedly/company/frontend/famedlysdk!1221
2023-02-17 09:02:59 +00:00
td 0c9e129347
fix: clean expired member state events in group calls 2023-02-14 23:08:50 +05:30
td 1219604dc9
fix: hasActiveGroup call now checks all group calls
fix: implement activeGroupCallEvents to get all active group call state events in a room

refactor: move staleCallChecker and expires_Ts stuff to an extension on Room, instead of Voip because it makes much more sense per room rather than on voip, also makes testing easier

fix: populate local groupCalls list on instantiating VOIP()

fix: starting stale call checker is now handled by the sdk itself because clients can forget to do so
2023-02-14 15:02:28 +05:30
Christian Pauly 31d4d5d08e fix: Check if argument is valid mxid in /maskasdm command 2023-02-14 09:16:48 +01:00
Nicolas Werner 9b3dd5acd7
chore: bump dart to 2.18
Allows us to get rid of some null assertions.
2023-02-01 11:39:55 +01:00
td c5d484bb13
feat: add method to generate the matrix.to link 2023-01-20 03:41:43 +05:30
Krille d6c4b530c5 refactor: room displayname calculation
This deprecates the displayname
getter in favor of the new
getLocalizedDisplayname which
gets the default localization
by default so it can be
called without defining localizations. It adds a method
to calculate if a room is an
abandoned DM room where
it is made sure that the room
is actually empty.
2023-01-17 08:51:07 +01:00
The one with the braid ed0ab3bdb9 Merge branch 'krille/remove-transaction-workaround' into 'main'
refactor: Remove database transaction workaround

See merge request famedly/company/frontend/famedlysdk!1192
2022-12-27 13:20:21 +00:00
Krille 185b27eaf7 Merge branch 'nico/invalid_pushrule_test' into 'main'
test: Add test for dendrites invalid pushrules

See merge request famedly/company/frontend/famedlysdk!1201
2022-12-27 08:54:43 +00:00
Nicolas Werner 2c87b2a8e3
test: Add test for dendrites invalid pushrules
While we do test against dendrite, it is useful to have a few targeted
tests.

See also https://gitlab.com/famedly/company/frontend/famedlysdk/-/issues/349
2022-12-23 11:38:00 +01:00
Nicolas Werner 8c096ef6ca
test: Add tests for account data store and retrieve
fixes https://gitlab.com/famedly/company/frontend/famedlysdk/-/issues/326
2022-12-21 19:49:59 +01:00
Christian Pauly 7a5b013c92 refactor: Remove database transaction workaround
The workaround was from the
time when we have used
sqflite or when Hive had
bugs. But now HiveCollections
already supports transactions
in Dart zones and concurrent
write operations shouldn't
be a problem anymore.
2022-12-21 09:41:11 +01:00
td d517581fa5 Merge branch 'krille/fix-powerlevels' into 'main'
fix: PowerLevel calculation regarding to spec

See merge request famedly/company/frontend/famedlysdk!1172
2022-11-21 09:39:50 +00:00
Christian Pauly f3287dbb99 fix: PowerLevel calculation regarding to spec 2022-11-21 10:14:28 +01:00
TheOneWithTheBraid 476963069a feat: support MSC 3935: cute events
- add cute event skeletron (`im.fluffychat.cute_events`)
- add cute events to default command batch
- this way, all SDK users can profit from cute events
- supported events: `hug`, `googly_eyes`, `cuddle`

Fixes:
https://rail.chat/@AgathaSorceress@eldritch.cafe/109336005433123570

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
2022-11-21 09:17:07 +01:00
Christian Pauly e6182db16b refactor: Remove deprecated fluffybox 2022-10-28 12:56:20 +02:00
TheOneWithTheBraid ed7913e710 feat: introduce hightlighted room getter
- adds `Room.isUnreadOrInvited` extending `Room.isUnread` to invited rooms

This is some high-level abstraction simplifying computation of unread
room badges / notifications.

Related: https://gitlab.com/groups/famedly/company/-/epics/28

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
2022-10-26 11:51:32 +02:00
Christian Pauly 69f82b2619 refactor: Remove unused imports 2022-10-18 11:42:11 +02:00
Nicolas Werner ee93d545cc chore: fix exception test after api_lite update 2022-10-17 12:52:08 +02:00
Nicolas Werner f55bb4776a feat: Support evaluating pushrules
fixes #339
2022-10-17 04:29:20 +02:00
Christian Pauly 403824b261 feat: Store original event 2022-09-19 09:40:42 +02:00
cloudwebrtc 62cd4e78fb chore: fix analyzer error. 2022-09-17 00:19:21 +08:00
Nicolas Werner 163ad0de6b fix: The initial sync waiting for a long time in some cases 2022-08-30 14:22:09 +02:00
Nicolas Werner dd1f61c29e feat: support dehydrated devices 2022-08-29 13:05:55 +02:00
Nicolas Werner 651abc7c14 Merge branch 'krille/add-mark-as-dm-commands' into 'main'
feat: Add markasdm and markasgroup commands

See merge request famedly/company/frontend/famedlysdk!1092
2022-08-15 14:19:17 +00:00
Nicolas Werner a47833ab80 Merge branch 'nico/lints' into 'main'
feat: switch from pedantic to lints

See merge request famedly/company/frontend/famedlysdk!1094
2022-08-15 14:15:51 +00:00
Nicolas Werner 6555f36d6d feat: switch from pedantic to lints 2022-08-15 14:15:51 +00:00
Nicolas Werner 4ac1615ad6 fix: coverage_without_olm tests
The coverage calculation is currently broken in dart/test, see
https://github.com/dart-lang/test/issues/1698 for reference.
2022-08-15 13:03:06 +02:00
Christian Pauly 527bcc63ad refactor: Add reference to itself in bootstrap onUpdate callback 2022-08-12 15:23:32 +02:00
Nicolas Werner 064b84305d chore: Add markasdm/group tests 2022-08-09 15:33:59 +02:00
Nicolas Werner 073d98cf3d feat: add coverage to MRs 2022-08-08 15:42:54 +02:00
td f56e0ddb5f
fix: check for m.call permissions in groupCallEnabled 2022-08-01 14:27:10 +05:30
Nicolas Werner 7f55e131f4 Merge branch 'td/enable_group' into 'main'
feat: allow enabling group calls in already created rooms

See merge request famedly/company/frontend/famedlysdk!1084
2022-07-24 19:24:43 +00:00
Jayesh Nirve 29c1241359
chore: add tests for group calls 2022-07-21 23:16:59 +05:30
Henri Carnot 2a019eaec3 feat: keep timeline history for archive rooms in memory 2022-07-21 14:14:17 +00:00
td f04d8a9f40 Merge branch 'krille/import-sorter' into 'main'
refactor: Use import sorter and ci templates

See merge request famedly/company/frontend/famedlysdk!1079
2022-07-21 13:59:05 +00:00
Christian Pauly 7885281c72 refactor: Use import sorter and ci templates 2022-07-21 15:44:04 +02:00
td 32d84dde1d Merge branch 'nico/try-canceling-async-task-in-archive-test' into 'main'
fix: (potentially) a race in the archive test

See merge request famedly/company/frontend/famedlysdk!1083
2022-07-21 06:16:10 +00:00
Nicolas Werner d5fd03d52d fix: (potentially) a race in the archive test 2022-07-19 14:13:55 +02:00
Jayesh Nirve 25abed35c4
chore: cleanup unused imports and analyzer warnings 2022-07-19 15:21:26 +05:30
Nicolas Werner 6e211f5a81 fix: race conditions in the SDK and its tests 2022-07-13 00:36:49 +00:00
Christian Pauly ff359aedff refactor: Better fetch own profile
This makes it possible to pass cache
and getFromRooms variable in
fetchOwnProfile. It also removes the
never working and duplicated
check from rooms. The Profiles
can be duplicated in the Set
because they are equal but not
the same objects. In the get
profile method, it now checks the
cache first before the rooms as
the cache might have the more
accurate result.
This makes displaying an avatar
change much easier as it makes
it possible to just disable cache
then.
2022-07-11 08:08:40 +02:00
Christian Pauly 28231936b1 feat: Calc encryption health state and allow key sharing with unknown devices
In order to allow key sharing with
unknown devices (master key has been
verified but this device is not
signed by this master key) the
user should at least be informed.
This makes it possible to set
in the client constructor whether
the app should share keys with
unverified devices or unknown
devices.
2022-07-09 09:39:31 +02:00
Henri Carnot 65b20e7d17 fix: request history 2022-07-05 13:24:35 +00:00
Christian Pauly 9628095ac9 feat: Implement CachedStreamController
This makes it possible to access the last
value of a stream at any time.
2022-06-30 09:22:53 +02:00
Christian Pauly a1c6bc7551 refactor: Let _handleRoomEvents use BasicEvent
This is the first step to reduce
the use of pure json in the
sync method.
2022-06-28 14:09:12 +02:00
Duan Weiwei e2efa3e758 Support group call. 2022-06-13 15:26:25 +00:00
Christian Pauly 58cfd1f688 refactor: Rename methods and get rid of all Future getter 2022-06-08 08:30:05 +02:00
Henri Carnot fb18843b08 refactor: make sender getter async 2022-06-02 08:13:21 +00:00
Henri Carnot 69dacc8ccd feat: allow updating image size 2022-05-31 20:32:35 +00:00
Lanna Michalke 8fd3bbe28c feat: support HiveCollections as Database provider
- support Hive's new `CollectionBox` and `BoxCollection`

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-05-21 20:19:52 +02:00
Krille Fear 3f3d4d38d6 refactor: Migrate to Matrix Api Lite 1.0.0 2022-05-17 22:50:04 +00:00
Henri Carnot ff586b06b1 fix: don't assume element is a string 2022-05-17 09:25:13 +00:00
h.carnot 6c2e525a64 fix: remove duplicated read marker 2022-05-16 10:49:57 +02:00
Nicolas Werner 907a0d2317 feat: Store timestamp in the presence events
This fixes the presence never being accurate in the app.
2022-05-06 13:04:31 +02:00
Henri Carnot 09b324674e feat: non cached fragmented timeline 2022-05-03 14:08:33 +00:00
Lanna Michalke ecdbb06118 feat: introduce new MSC library architecture
- migrated to more useful MSC directory structure
- migrate Widgets API into new structure
- add recent emoji API into new structure

The recent emoji API is non-standard and should be compatible with Element.

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-05-03 09:17:57 +02:00
Henri Carnot f23abcd323 feat: get fully read marker 2022-05-02 08:43:54 +00:00
Christian Pauly eefc40e2d0 refactor: Get rid of dynamic input in checkHomeserver
This also fixes the automatic
homeserver detection in the
login method. It no longer uses
the deprecated user.
2022-04-21 15:40:21 +02:00
Krille Fear c5a6cc9a52 Merge branch 'krille/get-event-from-push' into 'main'
feat: Get event from push notification

See merge request famedly/company/frontend/famedlysdk!1008
2022-04-14 15:08:46 +00:00
Christian Pauly 5973e629fe feat: Get event from push notification 2022-04-14 17:01:05 +02:00
Christian Pauly 059a240214 feat: Add more localization strings and add default matrix localizations 2022-04-14 07:54:15 +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
Nicolas Werner e2d2a69e45 Merge branch 'voip/move-voip-methods-from-room' into 'main'
chore: Move the call methods in room to the voip class.

See merge request famedly/company/frontend/famedlysdk!980
2022-03-25 23:51:55 +00:00
Duan Weiwei cac4dc967d chore: Move the call methods in room to the voip class. 2022-03-25 23:51:55 +00:00
h.carnot f095cbe29d feat: add some more tests 2022-03-18 11:45:08 +01:00
h.carnot 77347a44ff feat: allow removing markdown formating 2022-03-18 11:40:10 +01:00
Nicolas Werner 62780b5b2f Merge branch 'krille/fix-reactions-trigger-notifications' into 'main'
fix: Dont encrypt reactions

See merge request famedly/company/frontend/famedlysdk!974
2022-03-15 10:40:52 +00:00
Christian Pauly f1d422b89a fix: Dont encrypt reactions
This fixes that server
sends notifications for reactions.
2022-03-15 08:42:53 +01:00
Krille Fear 93b11dd8ca Merge branch 'krille/matrix-file-improvements' into 'main'
refactor: Make MatrixFile final and move all image calculation into isolate

Closes famedly/fluffychat#863

See merge request famedly/company/frontend/famedlysdk!972
2022-03-15 07:40:59 +00:00
Krille Fear 9fa5667234 refactor: Make MatrixFile final and move all image calculation into isolate
This makes all fields in a MatrixFile final and
the object therefore stateless. It also moves
all calculations into the isolate. After some
benchmarks it seems that this does not
really speed up the thumbnail creation
but it does no longer block the UI for
some seconds.
2022-03-15 08:27:40 +01:00
Nicolas Werner 83298cc98b fix: own profile containing mxid
There are a few ways to fix this. We could skip events, where we don't
have the state in memory yet or always do a /profile request and cache
that.

I chose to go with loading the event from the database if necessary. If
we have a room in the db, we should have our memberevent in the db. In
some cases we might not (if the server thinks our memberevent is super
redundant), but I think the spec doesn't really allow that and it
doesn't happen in practice. And even if it would, we probably would want
our member event ASAP. And if we have no rooms, we fetch it from the
server as before instead of constructing a member with an MXID as the
username.

fixes https://gitlab.com/famedly/company/frontend/frontend-issue-inbox/-/issues/65
2022-03-15 02:13:09 +01:00
Christian Pauly 01dfdb29fd fix: Has new messages compares ts
This compares the origin server timestamp which might not map
to the real sort order of the timeline. But it is the best
solution for now.
2022-02-15 10:26:17 +01:00
Christian Pauly 68fcee98cb fix: Show reactions as last events and refactor hasNewMessage
Reactions are triggering push
notifications and should therefore
be displayed as last events
in the room list of a client.
The body should just display
the reaction key.
This fixes that rooms with
new reactions can't set to
read.
2022-02-14 15:06:22 +01:00
Nicolas Werner 4a52540006 fix: exception on removed widgets
And widgets without a name.

fixes #267
2022-02-13 23:11:53 +01:00
Christian Pauly f9875e2929 chore: Bump version 2022-02-08 08:43:19 +01:00
Krille Fear 84e87279e8 fix: Remove onHistoryReceived which was broken anyway 2022-02-07 15:15:44 +01:00
Christian Pauly 846d5b0f46 fix: Add redaction events to timeline
The redaction events should not
be displayed in the GUI but it
is the job of the app to hide
them from the timeline while
the SDK should offer an
accurate list of ALL timeline
events by default.
2022-02-04 08:55:47 +01:00
Christian Pauly c82ae911db chore: Bump version 2022-02-03 10:53:48 +01:00
TheOneWithTheBraid fa6bd12294 feat: implement to get a room's widgets
Please note that this does not implement *modifying* widgets,
as this requires a full implementation of the Matrix Integration Manager
API first. This is to be done later.

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
2022-02-02 08:38:56 +01:00
Lanna Michalke 58f6cde0bf BREAKING CHANGE: high-level hadling of image sizes
- By using [package:image](https://pub.dev/packages/image), the
`MatrixImageFile` was given automatically generated width and heigth.
- Moreover, `MatrixImageFile` was given a factory to create the image
  file from a given maximal dimension.
- When sending images without explicitly providing a thumbnail, the
  thumbnail is automatically generated based on the provided image.
- The blur hash in generated automatically based on the provided image.

Fixes:
https://gitlab.com/famedly/company/frontend/famedly-web/-/issues/162, https://gitlab.com/famedly/fluffychat/-/issues/756

Signed-off-by: Lanna Michalke <l.michalke@famedly.com>
2022-01-19 13:10:17 +01:00
Lanna Michalke cab03aa73b fix: Allow unpadded base64 decoding 2022-01-11 09:02:34 +00:00
Krille Fear b472dd7b92 fix: Room Member updates should always be cached
I think the commit which broke it was this: e3bd0cf1 It makes sure that only important state events get cached and room member events are not important state events and so new invites have no room member events cached. It makes sense to also allow room member events here to always be cached as they are special typed.
2022-01-08 10:44:22 +01:00
Krille Fear 3bce8b4489 refactor: Remove unnecessary type checks and imports 2021-12-23 11:46:45 +01:00
Nicolas Werner d687973b01 fix: fallback in body for replies to replies 2021-12-15 19:21:41 +00:00
Sorunome b009ada0ac
fix: Allow consecutive edits for state events in-memory
The lastEvent was incorrect when trying to process an edit of an edit.
This fixes that by allowing consecutive edits for the last event.
2021-12-06 11:11:21 +01:00
Sorunome e3bd0cf139
fix: Only save state events from sync processing in-memory if needed
If we dump all state events from sync into memory then we needlessly
clog up our memory, potentially running out of ram. This is useless
as when opening the timeline we post-load the unimportant state events
anyways. So, this PR makes sure that only the state events of post-loaded
rooms and important state events land in-memory when processing a sync
request.
2021-12-06 11:09:50 +01:00
Sorunome 872bc04674
fix(ssss): Strip all whitespace characters from recovery keys upon decode
Previously we stripped all spaces off of the recovery when decoding it,
so that we could format the recovery key nicely. It turns out, however,
that some element flavours also format with linebreaks, leading to the
user having to manually remove them. We fix this by just stripping *all*
whitespace off of the recovery key.
2021-12-05 12:19:22 +01:00
Krille Fear ac06864627 feat: Migrate olm sessions on database migration
This adds a getAllOlmSessions
endpoint to the database API and
implements them in both
implementations. This also
adds it to the database
migration.
2021-11-26 08:17:43 +01:00
Krille Fear bc6ec5e592 Merge branch 'krille/idb' into 'main'
feat: Implement FluffyBox database

See merge request famedly/company/frontend/famedlysdk!900
2021-11-23 15:00:42 +00:00
Krille Fear 01eb851364 fix: 2021-11-23 15:48:18 +01:00
Krille Fear 921c694888 feat: Add clear cache command 2021-11-23 09:48:08 +01:00
Krille Fear a61e1ae4a3 feat: Add commands to create chats 2021-11-21 13:40:41 +01:00
Krille Fear b99a78476a refactor: Remove Sembast database implementation
It was a nice experiment but it
loading everything into memory
is just too slow for big
accounts.
2021-11-18 19:55:21 +01:00
Krille Fear 0532974022 Merge branch 'krille/sembast' into 'main'
feat: Implement sembast store

Closes #239

See merge request famedly/company/frontend/famedlysdk!892
2021-11-16 09:42:40 +00:00
Krille Fear f5051a5afe feat: Implement sembast store
refactor: Use typed store
2021-11-16 09:50:25 +01:00
Krille Fear 66bf8e6ace fix: HtmlToText crashes with an empty code block 2021-11-16 08:18:07 +01:00
Krille Fear f052957c0a fix: Change eventstatus of edits in prevEvent
Unfortunately the last fix
was not working.
This fixes it for real now and also
adds a test case to make sure it
never breaks again.
2021-11-11 09:48:50 +01:00
Krille Fear 58b36a67a3 refactor: Update matrix_api_lite and use SyncUpdate constructors 2021-11-10 10:04:03 +01:00
Nicolas Werner d2e7de4702
fix: crash on invalid displaynames 2021-11-09 21:27:55 +01:00
Krille Fear 9abe1ed81d fix: Dont enable e2ee in test verification DM room 2021-11-09 15:42:43 +01:00
Krille Fear 4cf88e2be6 feat: More advanced create chat methods
This includes a new simplified
API to create new direct and
group chats. It also handles
enabling encryption by
default.
2021-11-09 15:39:42 +01:00
Nicolas Werner c443b239b4 Merge branch 'krille/timeline-set-read-marker' into 'main'
refactor: Move setreadmarker functionality to timeline

See merge request famedly/company/frontend/famedlysdk!879
2021-11-09 14:14:43 +00:00
Krille Fear e313426dd9 refactor: Move setreadmarker functionality to timeline
Apps had a hard time to just set
the marker for the last event.
The lastEvent in the Room may
not be the actual last event
because we ignore several
event types there. Therefore
it makes sense to refactor
the setUnread method.
Now the timeline class has an
easy method to set the read
marker to the last synced
event, which can only be
known by the timeline if we
want to avoid another DB access.
2021-11-09 14:56:59 +01:00
Krille Fear e1f93637b3 feat: Add onInsert, onRemove and onUpdate cb to timeline
This makes it finally possible to
use Flutters AnimatedListView with
our Timeline class and in web we
can now update single elements
instead of the whole timeline
on every change which should
be quiet good for the
performance
2021-11-09 09:55:26 +01:00
Krille Fear 9be87918f1 refactor: Make room in Event class not nullable 2021-11-04 14:21:04 +01:00
Krille Fear eb200afe18 refactor: download method should not return null
If the decryption fails, it should
throw an exception and not
return null.
2021-11-04 12:22:20 +01:00
Sorunome 5c87b560b9
fix: obay explicitly set ports in mxc URLs 2021-11-03 08:54:04 +01:00
Nicolas Werner 6e20c53b01
refactor: remove redundant null checks 2021-10-28 14:32:09 +02:00
Nicolas Werner e6f77924d6
refactor: port encryption tests 2021-10-28 03:44:02 +02:00
Nicolas Werner 32c6e0ec6e
refactor: port client and related tests to nullsafety 2021-10-28 03:44:02 +02:00
Nicolas Werner 3f83e5481c
refactor: port room test to nullsafety 2021-10-28 03:44:02 +02:00
Nicolas Werner 2fd4425099
refactor: port some simple tests to nullsafety 2021-10-28 03:44:02 +02:00
Nicolas Werner 6abd9e7e22
refactor: nullsafe event test 2021-10-28 03:44:01 +02:00
Nicolas Werner ebd5bc3d24
refactor: make room nullsafe 2021-10-28 00:54:25 +02:00
Nicolas Werner fb0a84d7b2
refactor: make client nullsafe 2021-10-25 16:34:02 +02:00
Nicolas Werner 17fd1f22b3 refactor: make event nullsafe 2021-10-25 10:10:25 +00:00
Jindřich Pikora c6e0359522 refactor: Change event status to enum 2021-10-14 13:31:07 +00:00
Nicolas Werner 60956bde00 chore: port the remaining encryption files to nullsafety 2021-10-13 13:58:21 +00:00
Nicolas Werner a196b53219 refactor: nullsafe encryption 2021-09-30 12:58:37 +00:00
Jayesh Nirve 77ca7523d0 refactor: remove unused clientId 2021-09-24 16:05:05 +02:00
Sorunome b41c7b1bc6
fix: Don't re-play m.dummy to_device events
If both ends had m.dummy events queued as last messages an an olm
session corrupted, then the clients landed in an infinite game of
ping-pong. It was so stable, that the clients could have won the
ping-pong world championships!
2021-09-21 10:05:51 +02:00
Sorunome 6f0c7c5f64 feat: Add /discardsession command 2021-09-17 05:52:53 +00:00
Sorunome 0611ea1495
fix: Auto-reply key requests 2021-09-16 22:14:41 +02:00
Jindřich Pikora 03f82d84b9 fix: only/number emotes in a reply 2021-09-14 09:21:49 +00:00
Christian Pauly 00771fc209 refactor: _updateUserDeviceKeys method 2021-09-13 14:58:07 +02:00
cloudwebrtc ea34f0b82c feat: MSC2746: Improved Signalling for 1:1 VoIP. 2021-09-10 02:50:24 +02:00
Christian Pauly e13b00d127 refactor: Make RoomUpdate class null safe by removing it
RoomUpdate came from a time where we had no data model for
SyncUpdates but now we have and therefore this class is just
code duplication. This removes the class
and uses the SyncRoomUpdate class from
the package matrix_api_lite instead.
It needed a lot of refactoring at some places
where I also have removed some unnecessary null or type checks.
2021-09-08 12:31:55 +00:00
Christian Pauly 461874d6b1 fix: Remove print 2021-09-06 08:46:29 +02:00
Christian Pauly 524b09c572 feat: Do not load all timeline events from store at once 2021-09-03 14:58:43 +02:00
Christian Pauly 9c1f79359e refactor: Replace all logic regarding sortOrder
The current implementation of sortOrder can be made way more easier now
by just keeping the sortOrder of the list
and the timelineFragments in the hiveStore. This needed a huge
change but mostly removes a lot of code which can be done
way more easy now. This also needed some rewriting of the setState logic and changes to
the prevEvent calculation. This solution should also be more stable.
More information:
https://www.reddit.com/r/fluffychat/comments/pfnlhq/the_sort_order_of_matrix_timelines/
2021-09-02 07:13:38 +00:00
Sorunome efb5842959
fix: Implement dummy transactions for hive
That way some concurrency bugs might be fixed, such as if two sync
requests are processed at the same time. That can e.g. happen if you
request history while a sync request is already being processed.
2021-09-01 19:11:46 +02:00
Nicolas Werner 8b46fa3fc2 fix: room account data key/type returned encoded
We uri encode all hive keys. But in some cases we never decode them.
This leads to fun issues like SSSS being unreadable after restart.

fixes https://gitlab.com/famedly/company/frontend/famedlysdk/-/issues/179
2021-09-01 16:37:51 +00:00
Christian Pauly 5eb2d22207 refactor: Make eventupdate null safe 2021-08-30 09:20:17 +02:00
Christian Pauly 4bee82dbe0 fix: uiaRequests send broken auth object at first try
We should just let the `auth` object null and dont send it at the
first try and wait for the servers response. This worked in the past
but now it is broken because of changes in the
matrix_api_lite. This could also be fault for some
bootstrap issues.
I have also removed an unnecessary check if a String is a String and just made it a
null check because this was intended at this point.

Because of that this blocks uiaRequests it is a hotfix and therefore directly bumps the version.
2021-08-30 08:31:20 +02:00
Sorunome ffb6fd426c
fix: Requesting history being funky
As it turns out, some of the code set the prev_batch for rooms too
early to an empty string. For synapse this means "request from the start",
for conduit it is just an error. This commit fixes that by never resolving
null --> empty string, but instead throw an error.
2021-08-29 12:56:16 +02:00
Sorunome 024e0de4b9
fix: Don't lag when sending messages in big rooms
The old mentionMap was very inefficient to build and scaled badly with
room member size. This resulted in noticable lag when sending any message
in a large room, no matter if it contained a message or not.
Now, the algorithm is severly optimized and mentions (and emotes) are
only loaded when actually used.
2021-08-29 11:43:46 +02:00
Sorunome f3f9b219e1 feat: Cleanup Event.plaintextBody and add [plaintextBody] to Event.getLocalizedBody
It appears that [hideEdit] in Event.getLocalizedBody was written in a way that it
assumes a valid event body. This was also fixed, while also adding tests for the
various parameters of Event.getLocalizedBody
2021-08-28 09:46:03 +00:00
Sorunome b849c828e3
fix: String.parseIdentifierIntoParts not working with unicode matrix.to links
Some clients do not uri-encode the identifier for matrix.to links, so we must
handle if we can't uri-decode them
2021-08-28 11:19:26 +02:00
Jayesh Nirve 5ac9b6bd73
fix: dartfmt 2021-08-26 03:50:27 +05:30
Jayesh Nirve 0281261a8c
test: add tests to check if last event is set properly 2021-08-26 03:45:39 +05:30
Christian Pauly 2f35277e47 refactor: Change name of archive getter to function
This is more intuitive because it is
a function that loads something from
the server and doesnt directly return
something.
2021-08-25 10:36:58 +02:00
Lukas Lihotzki 9087f08775 chore: mxc url in Uri 2021-08-23 11:05:47 +02:00
Christian Pauly 9b7474e2f2 refactor: Update to dart 2.12 and opt out in all files
This also adds some missing license headers, I have detected while
using license header search&replace to add the
null safety opt out
2021-08-18 08:09:39 +02:00
xenofem a1b95c0915
feat(events): add plain-text body representation from HTML
Co-Authored-By: Sorunome <mail@sorunome.de>
2021-08-17 18:33:45 +02:00
Sorunome 98b0bd4322 feat: Add a way to get a verification request by its transaction id
A client might find the need to get the verification request object by
its transaction id, to be able to e.g. display for in-room verification
an "accept verification request" button easily.
2021-08-17 15:03:30 +00:00
Christian Pauly 86041513f8 refactor: Remove deprecated moor database
We have used some data models which were only used in moor in the tests.
I needed to rewrite them in the original data as well.
Also now the "fake database" on native is the same like on web now with hive.
2021-08-17 10:11:59 +02:00
Sorunome fb16b96ea6 fix: Correctly parse the reason of a spoiler
Previously only the first child node of a spoiler was considered to
determine if there should be a spoiler reason. This was, unfortunately,
incorrect, as soon as e.g. the reason had more than one space. This is
fixed by properly iterating all child nodes to search for the reason.
2021-08-17 07:33:53 +00:00
Jindřich Pikora cf441e533d refactor: rename LoginState.logged to loggedIn 2021-08-03 12:26:17 +00:00
Lukas Lihotzki 8665f092f4 chore: matrix_api_lite 0.4.0 2021-07-26 14:54:22 +02:00
Nicolas Werner 179f73db3a fix: Upload OTKs if the otk_count field is missing
fixes #180
2021-07-26 09:47:05 +02:00
Sorunome a1594fd9ac
feat: Add general image pack handling as per MSC2545
This also deprecates the old ways to access just emoticons, as the MSC
now covers both emoticons and stickers!
2021-07-18 18:46:32 +02:00
Sorunome ee287a09b9
feat: Add support for nicer mentions
This PR adds support for nicer mentions in markdown: You can now
fetch the mention string of a user with `user.mention` which is
human-friendly (typically contains the display name), which will get
properly pillified upon passing through the markdown parser.
2021-07-18 17:29:25 +02:00
Sorunome 44b7c96d73
fix: preserve homeserver port when creating thumbnail URIs 2021-07-11 13:15:57 +02:00
Sorunome cd5131daa5
fix: Add locking to sending encrypted to_device messages to prevent potential race conditions
Due to chunked lazy sending of megolm sessions it was in theory that we encrypted two olm
messages to the same device in different futures out-of-order. Introducing locking here should
fix this (increadibly rare, so far only theoretical?) race-condition
2021-07-11 13:06:39 +02:00
Sorunome 4735d2d0a8
fix: Sending of the to_device key
With the switch to hive a regression of sending the to_device key was
introduced: When popping elements .deleteAt(), so deleting at the index,
was used, instead of .delete(), so deleting of the key. As the new events
pushed onto the queue used hives auto increment key, a .delete() is
appropriate here.
2021-07-09 19:43:48 +02:00
Christian Pauly ebc9be250d fix: Mark unsent events as failed
In Moor this was implemented but forgotten in Hive.
Events with status 0 (not sent yet) should be marked as failed on restart.
In fact they should be marked as failed if older than 1 minute. To not have a big startup job which iterates through all events in the database
we just do a time check when opening a room where we iterate through all events anyway.
The new implementation is now in the constructor of the Event and therefore
independent from the database implementation.
2021-07-05 08:37:46 +02:00
Christian Pauly a7ffe4835d feat: Also migrate inbound group sessions
For users who do not use the chat backup this could be useful.
2021-06-19 11:03:52 +02:00
Christian Pauly c0c7f68bf3 chore: Rename to matrix 2021-06-18 09:58:25 +02:00
Christian Pauly 14ee16fe16 feat: Implement new Hive Database
The hive database now implements the whole API except for storing files which
should be better done by the flutter_cache_manager package inside of the
flutter app. All tests already run with Hive now but the Moor database is still
tested too. We needed to change some wait jobs in the tests because the Hive
database is not 100% in memory for the tests like Moor.
For now both database implementations are equal and the developer can pick
which one to use but we plan to get rid of Moor in the future.
2021-06-16 08:43:33 +02:00
Christian Pauly 967712adfe feat: Implement database migration
This allows the user to give a legacyDatabaseBuilder to the client object
and in the init proccess the client checks by itself if there is old data in the legacy
database. If yes then it migrates them and
then deletes the old database. This uses the database_api and is agnostic to
the database implementation.
2021-06-11 10:10:18 +02:00
Lukas Lihotzki ae2aafbd52 test: use setUp and tearDown 2021-06-09 17:12:14 +02:00
Christian Pauly 0e1e72d3ab fix: Minor test glitches 2021-06-01 15:27:57 +02:00
Christian Pauly c387b33e9f refactor: Make support for file storing optional in database API 2021-06-01 15:27:18 +02:00
Christian Pauly 26261ecd5e feat: Add fromJson method for Room
This also included to move the room summary to a dedicated object inside
of the Room object because so it is easier to convert this to and from json.
2021-06-01 12:54:16 +02:00
Christian Pauly c3d47b16c6 CI: Use correct image 2021-05-25 10:46:34 +02:00
Christian Pauly c66e35c16c refactor: Create a clean database API 2021-05-20 07:36:03 +00:00
Christian Pauly aa4b0a25fa refactor: Update matrix_api_lite and remove no longer necessary dep override
The logger package has been removed too because the matrix_api_lite no longer
depends on it. It was a unnecessary import anyway because it was transitive in the past.
2021-05-17 07:50:54 +00:00
Lukas Lihotzki c196610998 chore: operation names from OpenAPI spec 2021-05-12 13:56:16 +02:00
Christian Pauly ffef732103 refactor: enable more linter rules
enable prefer_final_locals and prefer_final_in_for_each linter rules
2021-04-14 10:29:29 +02:00
Lukas Lihotzki 545ce26e39 style: fix format and lint 2021-04-12 14:49:03 +02:00
Lukas Lihotzki 761138a56d refactor: use OpenSSL for AES 2021-04-12 14:49:01 +02:00
Lukas Lihotzki b9df73989b test: fix test on web 2021-04-12 14:47:59 +02:00
Christian Pauly fb0177ac5f feat: Implement spaces 2021-04-12 09:24:20 +02:00
Lukas Lihotzki 2a2a170609 refactor: upgrade http package 2021-04-01 13:43:24 +02:00
Christian Pauly 0ceb2b26df refactor: Constants names 2021-03-30 12:43:50 +02:00
Christian Pauly 97daae3419 refactor: Update to matrix_api_lite 0.2.0
This introduces a minor breaking change in the login method.
It now uses correctly the AuthenticationIdentifier
and deprecates the user, medium and address parameter.
2021-03-09 19:14:53 +01:00
Krille Fear 5cf97886b4 Merge branch 'soru/strip-at-room' into 'main'
feat: Escape @room in the reply fallback when replying

See merge request famedly/famedlysdk!667
2021-03-09 18:12:47 +00:00
Sorunome 6d171542af
feat: Escape @room in the reply fallback when replying 2021-03-09 18:29:13 +01:00
Christian Pauly 1f8285c3e7 refactor: Room states 2021-03-09 17:28:55 +00:00
Krille Fear 44ca96e544 refactor: Update pedantic
This enforces to NOT use curly braces in Strings where not needed
and not await non-future variables.
2021-03-09 17:28:04 +00:00
Krille Fear 0d8bddf708 Merge branch 'soru/fallback-keys' into 'main'
feat: Add fallback keys support

Closes #136

See merge request famedly/famedlysdk!653
2021-03-03 07:38:32 +00:00
Sorunome 498c7825a5
feat: Add fallback keys support 2021-03-02 16:17:32 +01:00
Christian Pauly 5c35799e18 refactor: Request user 2021-03-01 10:32:04 +01:00
Sorunome 885141968c Merge branch 'krille/refactor-event-update' into 'main'
refactor: Deprecate eventType in EventUpdate

See merge request famedly/famedlysdk!661
2021-02-26 16:11:57 +00:00
Christian Pauly b8659213ae feat: Implement can request history calculation 2021-02-26 13:48:29 +01:00
Christian Pauly c9d3c327f6 refactor: Deprecate eventType in EventUpdate 2021-02-26 13:06:02 +01:00
Sorunome e7c8e754a1
chore: Update matrix scheme parsing to match updated MSC 2021-02-23 16:34:43 +01:00
Christian Pauly 72a7bc1637 feat: Implement upload sync filters 2021-02-18 14:03:58 +01:00
Nicolas Werner ac1ad1b897 fix: escape attributes in markdown less aggressively 2021-02-17 22:56:31 +01:00
Sorunome 6c2fc1679a
feat: Auto-selfsign and auto-cache when opening ssss keys 2021-02-13 14:55:09 +01:00
Sorunome fcb8d48bd7
feat: Add command parser 2021-02-09 18:19:38 +01:00
Christian Pauly d362d6db23 fix: Request history on limited timeline 2021-02-09 15:02:48 +01:00
Sorunome d373a06aa2
fix: Add to_device queue to prevent olm session corruptions 2021-02-08 14:57:19 +01:00
Sorunome 0c4db25d05
feat: Add a way to string-encode a recovery key 2021-02-03 11:34:56 +01:00
Sorunome 21a5854fbf
fix: Attempt event decryption on fetching replied events 2021-02-02 12:51:43 +01:00
Krille Fear c701268d71 feat: Do well known by default in check homeserver 2021-01-20 13:21:51 +00:00