You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-29 16:43:09 +03:00
PR feedback, rename method
This commit is contained in:
@@ -2014,7 +2014,7 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) {
|
|||||||
const matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self));
|
const matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self));
|
||||||
if (res.state) {
|
if (res.state) {
|
||||||
const stateEvents = utils.map(res.state, _PojoToMatrixEventMapper(self));
|
const stateEvents = utils.map(res.state, _PojoToMatrixEventMapper(self));
|
||||||
room.currentState.prependStateEvents(stateEvents);
|
room.currentState.setUnknownStateEvents(stateEvents);
|
||||||
}
|
}
|
||||||
room.addEventsToTimeline(matrixEvents, true, room.getLiveTimeline());
|
room.addEventsToTimeline(matrixEvents, true, room.getLiveTimeline());
|
||||||
room.oldState.paginationToken = res.end;
|
room.oldState.paginationToken = res.end;
|
||||||
|
|||||||
@@ -263,14 +263,13 @@ RoomState.prototype.clone = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add previously unknown state events just before
|
* Add previously unknown state events.
|
||||||
* prepending events to the timeline.
|
|
||||||
* When lazy loading members while back-paginating,
|
* When lazy loading members while back-paginating,
|
||||||
* the relevant room state for the timeline chunk at the end
|
* the relevant room state for the timeline chunk at the end
|
||||||
* of the chunk can be set with this method.
|
* of the chunk can be set with this method.
|
||||||
* @param {MatrixEvent[]} events state events to prepend
|
* @param {MatrixEvent[]} events state events to prepend
|
||||||
*/
|
*/
|
||||||
RoomState.prototype.prependStateEvents = function(events) {
|
RoomState.prototype.setUnknownStateEvents = function(events) {
|
||||||
const unknownStateEvents = events.filter((event) => {
|
const unknownStateEvents = events.filter((event) => {
|
||||||
return this.events[event.getType()] === undefined ||
|
return this.events[event.getType()] === undefined ||
|
||||||
this.events[event.getType()][event.getStateKey()] === undefined;
|
this.events[event.getType()][event.getStateKey()] === undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user