Keep track of highlights when user is offline
This commit is contained in:
parent
f81235900b
commit
96ef274838
@ -1,6 +1,6 @@
|
|||||||
{{#each channels}}
|
{{#each channels}}
|
||||||
<div data-id="{{id}}" data-target="#chan-{{id}}" data-title="{{name}}" class="chan {{type}}">
|
<div data-id="{{id}}" data-target="#chan-{{id}}" data-title="{{name}}" class="chan {{type}}">
|
||||||
<span class="badge" data-count="{{unread}}">{{#if unread}}{{unread}}{{/if}}</span>
|
<span class="badge{{#if highlight}} highlight{{/if}}" data-count="{{unread}}">{{#if unread}}{{unread}}{{/if}}</span>
|
||||||
<span class="close"></span>
|
<span class="close"></span>
|
||||||
<span class="name" title="{{name}}">{{name}}</span>
|
<span class="name" title="{{name}}">{{name}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -320,6 +320,7 @@ Client.prototype.open = function(data) {
|
|||||||
var target = this.find(data);
|
var target = this.find(data);
|
||||||
if (target) {
|
if (target) {
|
||||||
target.chan.unread = 0;
|
target.chan.unread = 0;
|
||||||
|
target.chan.highlight = false;
|
||||||
this.activeChannel = target.chan.id;
|
this.activeChannel = target.chan.id;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -18,6 +18,7 @@ function Chan(attr) {
|
|||||||
topic: "",
|
topic: "",
|
||||||
type: Chan.Type.CHANNEL,
|
type: Chan.Type.CHANNEL,
|
||||||
unread: 0,
|
unread: 0,
|
||||||
|
highlight: false,
|
||||||
users: []
|
users: []
|
||||||
}, attr));
|
}, attr));
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,10 @@ module.exports = function(irc, network) {
|
|||||||
|
|
||||||
if (chan.id !== client.activeChannel) {
|
if (chan.id !== client.activeChannel) {
|
||||||
chan.unread++;
|
chan.unread++;
|
||||||
|
|
||||||
|
if (highlight) {
|
||||||
|
chan.highlight = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = data.from;
|
var name = data.from;
|
||||||
|
Loading…
Reference in New Issue
Block a user