mirror of https://github.com/calzoneman/sync.git
More fixes
This commit is contained in:
parent
6570c3da6c
commit
0f82faaef8
|
@ -1137,6 +1137,20 @@ Channel.prototype.sendRecentChat = function (users) {
|
|||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Sends a user profile
|
||||
*/
|
||||
Channel.prototype.sendUserProfile = function (users, user) {
|
||||
var packet = {
|
||||
name: user.name,
|
||||
profile: user.profile
|
||||
};
|
||||
|
||||
users.forEach(function (u) {
|
||||
u.socket.emit("setUserProfile", packet);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Packs userdata for addUser or userlist
|
||||
*/
|
||||
|
|
12
lib/user.js
12
lib/user.js
|
@ -58,6 +58,18 @@ function User(socket) {
|
|||
if (announcement != null) {
|
||||
self.socket.emit("announcement", announcement);
|
||||
}
|
||||
|
||||
self.on("login", function () {
|
||||
db.recordVisit(self.ip, self.name);
|
||||
db.users.getProfile(self.name, function (err, profile) {
|
||||
if (!err) {
|
||||
self.profile = profile;
|
||||
if (self.inChannel()) {
|
||||
self.channel.sendUserProfile(self.channel.users, self);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -119,8 +119,10 @@ function formatUserlistItem(div) {
|
|||
$("<em/>").text(meta.ip).appendTo(profile);
|
||||
}
|
||||
if (meta.aliases) {
|
||||
$("<p/>").text("aliases: " + meta.aliases.join(", ")).appendTo(profile);
|
||||
$("<br/>").appendTo(profile);
|
||||
$("<em/>").text("aliases: " + meta.aliases.join(", ")).appendTo(profile);
|
||||
}
|
||||
$("<hr/>").css("margin-top", "5px").css("margin-bottom", "5px").appendTo(profile);
|
||||
$("<p/>").text(data.profile.text).appendTo(profile);
|
||||
});
|
||||
name.mousemove(function(ev) {
|
||||
|
@ -642,7 +644,9 @@ function applyOpts() {
|
|||
.appendTo($("head"));
|
||||
}
|
||||
|
||||
switch(USEROPTS.layout) {
|
||||
switch (USEROPTS.layout) {
|
||||
case "synchtube-fluid":
|
||||
fluidLayout();
|
||||
case "synchtube":
|
||||
synchtubeLayout();
|
||||
break;
|
||||
|
@ -657,7 +661,7 @@ function applyOpts() {
|
|||
$("#qualitywrap").html("");
|
||||
$("#videowrap").remove();
|
||||
$("#chatwrap").removeClass("col-lg-5 col-md-5").addClass("col-lg-12 col-md-12");
|
||||
$("#chatline").removeClass().addClass("col-lg-12 col-md-12");
|
||||
$("#chatline").removeClass().addClass("col-lg-12 col-md-12 form-control");
|
||||
}
|
||||
|
||||
$("#chatbtn").remove();
|
||||
|
|
Loading…
Reference in New Issue