You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-31 15:24:23 +03:00
Hook up the callback fn for scrollback. Update CHANGELOG.
This commit is contained in:
@ -39,6 +39,8 @@ New features:
|
|||||||
in which they were submitted.
|
in which they were submitted.
|
||||||
* Room state is automatcally synchronised when joining a room (including if
|
* Room state is automatcally synchronised when joining a room (including if
|
||||||
another device joins a room).
|
another device joins a room).
|
||||||
|
* Scrollback. You can request earlier events in a room using
|
||||||
|
`MatrixClient.scrollback(room, limit, callback)`.
|
||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
* Fixed a bug which prevented the event stream from polling. Some devices will
|
* Fixed a bug which prevented the event stream from polling. Some devices will
|
||||||
|
@ -24,6 +24,10 @@ var rl = readline.createInterface({
|
|||||||
});
|
});
|
||||||
rl.setPrompt("$ ");
|
rl.setPrompt("$ ");
|
||||||
rl.on('line', function(line) {
|
rl.on('line', function(line) {
|
||||||
|
if (line.trim().length === 0) {
|
||||||
|
rl.prompt();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (line.indexOf("/join ") === 0 && !viewingRoom) {
|
if (line.indexOf("/join ") === 0 && !viewingRoom) {
|
||||||
var roomIndex = line.split(" ")[1];
|
var roomIndex = line.split(" ")[1];
|
||||||
viewingRoom = roomList[roomIndex];
|
viewingRoom = roomList[roomIndex];
|
||||||
|
@ -816,9 +816,9 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) {
|
|||||||
utils.map(res.chunk, _PojoToMatrixEventMapper), true
|
utils.map(res.chunk, _PojoToMatrixEventMapper), true
|
||||||
);
|
);
|
||||||
room.oldState.paginationToken = res.end;
|
room.oldState.paginationToken = res.end;
|
||||||
defer.resolve(room);
|
_resolve(callback, defer, room);
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
defer.reject(err);
|
_reject(callback, defer, err);
|
||||||
});
|
});
|
||||||
return defer.promise;
|
return defer.promise;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user