Skip to content

Add support for device masquerading (MSC4326) #17

@rsb-tbg

Description

@rsb-tbg

The shortcoming you see
Synapse v1.141.0+ now has stable support for device masquerading. I'd like to submit a PR to add similar support for ruma-client.

The improvement
My initial thought would be to modify send_request_as from:

    pub async fn send_request_as<R: OutgoingRequest>(
        &self,
        user_id: &UserId,
        request: R,
    ) -> ResponseResult<C, R> {
        self.send_customized_request(request, add_user_id_to_query::<C, R>(user_id)).await
    }

to:

    pub async fn send_request_as<R: OutgoingRequest>(
        &self,
        user_id: Option<&UserId>,
        device_id: Option<&DeviceId>,
        request: R,
    ) -> ResponseResult<C, R> {
        self.send_customized_request(request, add_ids_to_query::<C, R>(user_id, device_id)).await
    }

I would also similarly change the send_matrix_request_as signature.

Is that acceptable? Or should I avoid breaking changes by creating independent functions for user and/or device masquearding?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions