mirror of https://github.com/calzoneman/sync.git
Fix #238
This commit is contained in:
parent
329505de9d
commit
8f72854e38
8
user.js
8
user.js
|
@ -83,7 +83,8 @@ User.prototype.noflood = function(name, hz) {
|
|||
User.prototype.setAFK = function (afk) {
|
||||
if(this.channel === null)
|
||||
return;
|
||||
var changed = this.meta.afk != afk;
|
||||
if(this.meta.afk === afk)
|
||||
return;
|
||||
var chan = this.channel;
|
||||
this.meta.afk = afk;
|
||||
if(afk) {
|
||||
|
@ -96,7 +97,10 @@ User.prototype.setAFK = function (afk) {
|
|||
this.autoAFK();
|
||||
}
|
||||
chan.checkVoteskipPass();
|
||||
chan.broadcastUserUpdate(this);
|
||||
chan.sendAll("setAFK", {
|
||||
name: this.name,
|
||||
afk: afk
|
||||
});
|
||||
}
|
||||
|
||||
User.prototype.autoAFK = function () {
|
||||
|
|
|
@ -660,6 +660,24 @@ Callbacks = {
|
|||
|
||||
},
|
||||
|
||||
setAFK: function (data) {
|
||||
var users = $("#userlist").children();
|
||||
for(var i = 0; i < users.length; i++) {
|
||||
var name = users[i].children[1].innerHTML;
|
||||
// Reformat user
|
||||
if(name == data.name) {
|
||||
var u = $(users[i]);
|
||||
u.find(".icon-time").remove();
|
||||
$(users[i].children[1]).css("font-style", "");
|
||||
if(data.afk) {
|
||||
$("<i/>").addClass("icon-time")
|
||||
.appendTo(users[i].children[0]);
|
||||
$(users[i].children[1]).css("font-style", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
userLeave: function(data) {
|
||||
var users = $("#userlist").children();
|
||||
for(var i = 0; i < users.length; i++) {
|
||||
|
|
Loading…
Reference in New Issue