Skip to content

[FIX] Auto hide Livechat room from sidebar on close#13824

Merged
renatobecker-zz merged 4 commits intoRocketChat:developfrom
knrt10:issue11118
Apr 3, 2019
Merged

[FIX] Auto hide Livechat room from sidebar on close#13824
renatobecker-zz merged 4 commits intoRocketChat:developfrom
knrt10:issue11118

Conversation

@knrt10
Copy link
Contributor

@knrt10 knrt10 commented Mar 21, 2019

Closes #11118

cc @renatobecker would you please review

// mark message as read as well
ReadReceipt.markMessageAsReadBySender(message, room._id, message.u._id);

if (message.t === 'livechat-close') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good idea.
Let's check if the room is not closed before calling the method, like this:

	if (room && !room.closedAt) {
		Subscriptions.setAsReadByRoomIdAndUserId(room._id, message.u._id);
	}

But, to make it works fine, you will need to send an updated room object here:
https://github.com/RocketChat/Rocket.Chat/blob/develop/app/livechat/server/lib/Livechat.js#L317

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, let me update.

@renatobecker-zz renatobecker-zz changed the title [FIX] Auto hide room from sidebar on close [FIX] Auto hide Livechat room from sidebar on close Apr 3, 2019
@renatobecker-zz renatobecker-zz merged commit ab3faad into RocketChat:develop Apr 3, 2019
@rodrigok rodrigok mentioned this pull request Apr 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-hide livechat room on close

4 participants

Comments