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