Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit b73e28a

Browse files
authored
Merge pull request #1463 from turt2live/travis/peek_rr
Don't send RR or RM when peeking at a room
2 parents 91b888a + df7f1b4 commit b73e28a

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/components/structures/RoomView.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ module.exports = React.createClass({
117117
guestsCanJoin: false,
118118
canPeek: false,
119119
showApps: false,
120+
isPeeking: false,
120121

121122
// error object, as from the matrix client/server API
122123
// If we failed to load information about the room,
@@ -266,6 +267,7 @@ module.exports = React.createClass({
266267
console.log("Attempting to peek into room %s", roomId);
267268
this.setState({
268269
peekLoading: true,
270+
isPeeking: true, // this will change to false if peeking fails
269271
});
270272
MatrixClientPeg.get().peekInRoom(roomId).then((room) => {
271273
this.setState({
@@ -274,6 +276,11 @@ module.exports = React.createClass({
274276
});
275277
this._onRoomLoaded(room);
276278
}, (err) => {
279+
// Stop peeking if anything went wrong
280+
this.setState({
281+
isPeeking: false,
282+
});
283+
277284
// This won't necessarily be a MatrixError, but we duck-type
278285
// here and say if it's got an 'errcode' key with the right value,
279286
// it means we can't peek.
@@ -290,6 +297,7 @@ module.exports = React.createClass({
290297
} else if (room) {
291298
// Stop peeking because we have joined this room previously
292299
MatrixClientPeg.get().stopPeeking();
300+
this.setState({isPeeking: false});
293301
}
294302
},
295303

@@ -1728,8 +1736,8 @@ module.exports = React.createClass({
17281736
<TimelinePanel ref={this._gatherTimelinePanelRef}
17291737
timelineSet={this.state.room.getUnfilteredTimelineSet()}
17301738
showReadReceipts={!UserSettingsStore.getSyncedSetting('hideReadReceipts', false)}
1731-
manageReadReceipts={true}
1732-
manageReadMarkers={true}
1739+
manageReadReceipts={!this.state.isPeeking}
1740+
manageReadMarkers={!this.state.isPeeking}
17331741
hidden={hideMessagePanel}
17341742
highlightedEventId={highlightedEventId}
17351743
eventId={this.state.initialEventId}

0 commit comments

Comments
 (0)