Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Adding support for MSC3202 for E2E appservice support #3280

Open
danpe opened this issue Dec 6, 2023 · 1 comment
Open

Adding support for MSC3202 for E2E appservice support #3280

danpe opened this issue Dec 6, 2023 · 1 comment

Comments

@danpe
Copy link
Contributor

danpe commented Dec 6, 2023

Looking at matrix-org/matrix-spec-proposals#3202 seems like a pretty straight forward implementation.
I think I can contribute that part, but would love for direction on which files it should be implemented on.

@S7evinK
Copy link
Contributor

S7evinK commented Dec 13, 2023

Ignoring MSC2409, we need device_lists, device_one_time_keys_count and device_unused_fallback_key_types (the latter isn't implemented yet, iirc)
device_lists and device_one_time_keys_count currently have some internal functions in the SyncAPI:

func DeviceOTKCounts(ctx context.Context, keyAPI api.SyncKeyAPI, userID, deviceID string, res *types.Response) error {

func DeviceListCatchup(
ctx context.Context, db storage.SharedUsers, userAPI api.SyncKeyAPI, rsAPI roomserverAPI.SyncRoomserverAPI,
userID string, res *types.Response, from, to types.StreamPosition,
) (newPos types.StreamPosition, hasNew bool, err error) {

Those are used for /sync responses and most likely will need to be "public" so the appservice API can use them.
So IMO, we need to modify https://github.com/matrix-org/dendrite/blob/main/appservice/consumers/roomserver.go to:

  • Add OTKs for all users the appservice is interested in when the consumer receives a m.room.encrypted event
  • Have appserviceState keep track of the StreamPosition (from, in this case) to be able to calculate device_lists
  • Make the mentioned internal functions public

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants