Skip to content

A matrix_sdk_base::Room needs a method to get the timeline (RoomEvents) #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jsparber opened this issue Feb 12, 2021 · 4 comments
Closed

Comments

@jsparber
Copy link
Contributor

Currently the user needs to track the RoomEvents themself on every sync, because the sdk doesn't store them (see #138).
It would be nice that a user can retrieve the events directly from the sdk.

I would suggest adding a method to Room that returns the timeline. The method takes an start EventId and an optional end EventId or a limit that specifics how many events the user wants.

    pub async fn get_timeline(&self,
                              start: EventId,
                              end: Option<EventId>,
                              limit: Option<u128>,
                              direction: Direction,
                              ) -> StoreResult<Vec<AnyRoomEvent>> {
        // Get events from store
    } 

I created to track the high-level issue separate form #138, which concerns the store itself.

@agraven
Copy link
Contributor

agraven commented Feb 12, 2021

There is Client::room_messages, which might do some of what you want. It should be noted that any additional methods the SDK could potentially provide will also be limited to the endpoints the matrix API provides for fetching events.

@jsparber
Copy link
Contributor Author

jsparber commented Feb 12, 2021

There is Client::room_messages, which might do some of what you want. It should be noted that any additional methods the SDK could potentially provide will also be limited to the endpoints the matrix API provides for fetching events.

I'm talking about a high-level API to retrieve room events in the same fashion as we do for room members. joined_members() for example retrieves the members from the local store without making requests to matrix.

Obviously #138 needs to be completed first, so that the store actually contains room events ;).

@agraven
Copy link
Contributor

agraven commented Feb 12, 2021

I see, I didn't realize you made your suggestion under the assumption of a/the message store being available

@jsparber
Copy link
Contributor Author

jsparber commented Mar 15, 2021

I opened a new issue for this since this method should be added to the matrix-sdk-base but to the high-level API in the matrix-sdk

#178

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

No branches or pull requests

2 participants