Commit Graph

146 Commits

Author SHA1 Message Date
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
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
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
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
Christian Pauly 5973e629fe feat: Get event from push notification 2022-04-14 17:01:05 +02: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
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
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
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 6e20c53b01
refactor: remove redundant null checks 2021-10-28 14:32:09 +02:00
Nicolas Werner 32c6e0ec6e
refactor: port client and related tests to nullsafety 2021-10-28 03:44:02 +02:00
Nicolas Werner fb0a84d7b2
refactor: make client nullsafe 2021-10-25 16:34:02 +02:00
Christian Pauly 00771fc209 refactor: _updateUserDeviceKeys method 2021-09-13 14:58:07 +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
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
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
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 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 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
Christian Pauly c387b33e9f refactor: Make support for file storing optional in database API 2021-06-01 15:27:18 +02: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
Christian Pauly fb0177ac5f feat: Implement spaces 2021-04-12 09:24:20 +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 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 c9d3c327f6 refactor: Deprecate eventType in EventUpdate 2021-02-26 13:06:02 +01:00
Sorunome d373a06aa2
fix: Add to_device queue to prevent olm session corruptions 2021-02-08 14:57:19 +01:00
Krille Fear c701268d71 feat: Do well known by default in check homeserver 2021-01-20 13:21:51 +00:00
Sorunome a35266f1e4
feat: Replay last sent olm message on olm session recovery from other device 2021-01-20 12:50:52 +01:00
Sorunome 9d6005ca2a
fix: Smoothen up sending to rooms with extremely many devices 2021-01-14 18:47:51 +01:00
Christian Pauly c94da38438 fix: Hide verification timeline events in lastEvent 2021-01-13 13:30:47 +01:00
Christian Pauly e450a09fb5 refactor: External matrix api 2021-01-04 10:26:29 +01:00
Sorunome 6723c01a31
feat: Lazy-send room keys, chunked and sorted by importance 2020-12-29 14:46:36 +01:00
Marcus Hoffmann 54fc29f203 clear cache fix 2020-12-22 17:34:50 +01:00
Christian Pauly cd4dafcd45 chore: Nicer logs in tests 2020-12-21 14:21:12 +01:00
Christian Pauly 57286d4c28 feat: Use logger package 2020-12-19 12:04:25 +00:00
Sorunome 405306f84e
feat: Add == operator to the Receipt, User and Room objects 2020-12-19 12:15:50 +01:00
Sorunome d1ce075b5b
feat: Automatically cache storable files on upload 2020-12-17 11:59:31 +01:00
Christian Pauly bec1761172 refactor: content parsing 2020-11-30 15:34:46 +01:00
Christian Pauly 323b203718 refactor: algorithm types 2020-11-30 14:26:31 +01:00
Christian Pauly 0697d47cc2 refactor: Minor init refactoring 2020-11-19 17:02:07 +01:00
Christian Pauly f9f18641e3 refactor: Connection error handling 2020-10-29 10:42:05 +01:00
Christian Pauly 5381c3935c refactor: Check server 2020-10-26 08:33:25 +00:00
Christian Pauly 66e590073e refactor: Event Update Type 2020-10-22 13:01:35 +02:00
Christian Pauly 864cbfa906 fix: Hotfix ignored user list 2020-09-20 10:37:36 +02:00
Christian Pauly a77e776479 feat: Implement ignore list 2020-09-19 12:39:19 +02:00
Christian Pauly fb9b505988 Krille/make client extend matrixapi 2020-08-11 16:11:51 +00:00
Christian Pauly 6170c79fe1 Improve logging 2020-08-06 09:35:02 +00:00
Christian Pauly 6779ab6624 Deprecate debug mode 2020-08-06 07:09:32 +00:00
Christian Pauly c87450dafb Remove deprecated contactlist method 2020-07-02 10:41:23 +00:00
Lukas Lihotzki 842581699c MatrixFile refactoring for thumbnails 2020-06-29 12:00:26 +00:00
Sorunome 5dda0c3623 Merge branch 'soru/cross-signing' into 'master'
Cross-Signing

See merge request famedly/famedlysdk!319
2020-06-25 07:53:30 +00:00
Christian Pauly 2afd0bb3a8 Implement pinned events 2020-06-24 08:41:52 +00:00
Sorunome 7803dc4b93
add more tests 2020-06-13 10:56:39 +02:00
Sorunome 4c60369b8d
migrate to new thingy! 2020-06-05 22:03:28 +02:00
Sorunome 1c115ecf51
fix tests for real 2020-06-05 13:10:53 +02:00
Sorunome fe3a697a15
fix test for non-olm 2020-06-05 12:07:06 +02:00
Sorunome fbc8f03f67
encrypt m.room_key event properly 2020-06-05 10:15:36 +02:00
Sorunome c94e41d393
fix tests for real 2020-06-04 18:16:22 +02:00
Sorunome f3f3231df6
add some encrypt / decrypt tests 2020-06-04 17:51:49 +02:00
Sorunome fcde6a2459
split encryption stuff to other library 2020-06-04 13:39:51 +02:00
Christian Pauly c6bf098644 Init matrix_api library 2020-06-03 10:16:01 +00:00
Sorunome d672edf394 Make room key sharing requests (hopefully) more robust and spec-compliant 2020-05-29 06:49:37 +00:00
Christian Pauly cbf5069e32 Add more tests 2020-05-25 09:34:43 +00:00
Christian Pauly 066221b84d Make coverage visible again 2020-05-19 09:28:13 +00:00
Sorunome c5e4e2c751
decrypt events in sync loop, making it async 2020-05-19 09:49:37 +02:00
Christian Pauly a6c7d88f00 Add profile cache 2020-05-18 11:45:49 +00:00
Sorunome 06b601c41b lazy-load group session keys 2020-05-17 07:54:34 +00:00
Sorunome f71826739c Switch to moor 2020-05-15 18:40:17 +00:00
Christian Pauly 6f5ebe4681 [MxContent] Switch to Uri Extension 2020-04-24 09:24:06 +02:00
Christian Pauly 7c7a0f15e5 [Client] Remove lazyloadingcheck 2020-04-02 11:29:07 +00:00
Christian Pauly a3c5add79e [SDK] Refactoring with new linter rules 2020-03-30 09:08:38 +00:00
Christian Pauly 31b64a6631 [Room] Clear outbound session only if devices changed 2020-02-27 08:41:49 +00:00
Lukas Lihotzki 3c78f11f2c [MatrixFile] Use Uint8List instead of List<int> 2020-02-24 17:54:43 +01:00
Christian Pauly 49e643625c [Client] Add debug prints 2020-02-20 07:28:15 +00:00
Christian Pauly 77b11d78db [Client] Implement device management 2020-02-19 14:26:38 +01:00
Christian Pauly f5b493f9bd [SDK] Add dart-olm library and update CI 2020-02-15 07:48:41 +00:00
Christian Pauly 24d08d83b9 [Client] Always claim own devices 2020-02-05 08:23:47 +00:00
Christian Pauly edd8aa5c4c Client feature add device tracking 2020-02-04 13:41:13 +00:00
Christian Pauly 995da7d255 [Client] Upload with StreamedRequest 2020-02-01 12:08:14 +00:00
Christian Pauly 0b393497f8 [Client] Add register methods 2020-01-14 15:16:24 +00:00
Christian Pauly 5fbeceb217 [SDK] Refactoring 2020-01-14 11:27:26 +00:00
Christian Pauly 0be548e4e9 [Client] Implement request openID 2020-01-12 11:30:05 +01:00
Christian Pauly de2872cfee Update lib/src/client.dart, lib/src/user.dart, lib/src/timeline.dart, lib/src/room.dart, lib/src/presence.dart, lib/src/event.dart, lib/src/utils/profile.dart, lib/src/utils/receipt.dart, test/client_test.dart, test/event_test.dart, test/presence_test.dart, test/room_test.dart, test/timeline_test.dart, test/user_test.dart files 2020-01-04 17:56:17 +00:00