You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently doing this manually with doRequest but it's a bit of extra legwork that I'd rather not do:
let from: string|undefined;
for (;;) {
const events = await this.matrixClient.doRequest(
'GET',
`/_matrix/client/v3/rooms/${encodeURIComponent(roomId)}/messages`,
{ dir: 'b', limit: 100, from },
);
for (const ev of events.chunk) {
if (ev.type === 'm.room.create') {
break;
} else if (ev.type === interestingEventType) {
interestingEvents.push(ev.content);
}
}
if (from === events.end) break;
from = events.end;
}
// use interestingEvents
The above could serve as an inspiration for the PR.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
There is currently no wrapper around https://spec.matrix.org/v1.3/client-server-api/#get_matrixclientv3roomsroomidmessages to be able to load messages from a room.
Describe the solution you'd like
A nicely typed wrapper for that endpoint.
Describe alternatives you've considered
I'm currently doing this manually with
doRequest
but it's a bit of extra legwork that I'd rather not do:The above could serve as an inspiration for the PR.
The text was updated successfully, but these errors were encountered: