Merge pull request #1615 from dgw/mark-echoes-read
Mark channels as read when receiving self-messages
This commit is contained in:
commit
a263c3eab9
@ -61,6 +61,11 @@ function processReceivedMessage(data) {
|
|||||||
.appendTo(container);
|
.appendTo(container);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clear unread/highlight counter if self-message
|
||||||
|
if (data.msg.self) {
|
||||||
|
sidebar.find("[data-target='" + target + "'] .badge").removeClass("highlight").empty();
|
||||||
|
}
|
||||||
|
|
||||||
// Message arrived in a non active channel, trim it to 100 messages
|
// Message arrived in a non active channel, trim it to 100 messages
|
||||||
if (activeChannelId !== targetId && container.find(".msg").slice(0, -100).remove().length) {
|
if (activeChannelId !== targetId && container.find(".msg").slice(0, -100).remove().length) {
|
||||||
channel.find(".show-more").addClass("show");
|
channel.find(".show-more").addClass("show");
|
||||||
|
@ -72,7 +72,11 @@ Chan.prototype.pushMessage = function(client, msg, increasesUnread) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!msg.self && !isOpen) {
|
if (msg.self) {
|
||||||
|
// reset counters/markers when receiving self-/echo-message
|
||||||
|
this.firstUnread = 0;
|
||||||
|
this.highlight = 0;
|
||||||
|
} else if (!isOpen) {
|
||||||
if (!this.firstUnread) {
|
if (!this.firstUnread) {
|
||||||
this.firstUnread = msg.id;
|
this.firstUnread = msg.id;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user