If new RR-RM API not implemented, fallback to RR-only API

pull/21833/head
Luke Barnard 2017-04-20 14:34:59 +01:00
parent a4ba5f041c
commit 67089cb527
1 changed files with 9 additions and 2 deletions

View File

@ -536,9 +536,16 @@ var TimelinePanel = React.createClass({
this.props.timelineSet.room.roomId,
this.state.readMarkerEventId,
lastReadEvent
).catch((e) => {
// /read_markers API is not implemented on this HS, fallback to just RR
if (e.errcode === 'M_UNRECOGNIZED') {
return MatrixClientPeg.get().sendReadReceipt(
lastReadEvent
).catch(() => {
// it failed, so allow retries next time the user is active
this.last_rr_sent_event_id = undefined;
});
}
// it failed, so allow retries next time the user is active
this.last_rm_sent_event_id = undefined;
});