More fixes

This commit is contained in:
calzoneman 2014-01-26 00:13:33 -06:00
parent 6570c3da6c
commit 0f82faaef8
3 changed files with 33 additions and 3 deletions

View File

@ -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 * Packs userdata for addUser or userlist
*/ */

View File

@ -58,6 +58,18 @@ function User(socket) {
if (announcement != null) { if (announcement != null) {
self.socket.emit("announcement", announcement); 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);
}
}
});
});
} }
/** /**

View File

@ -119,8 +119,10 @@ function formatUserlistItem(div) {
$("<em/>").text(meta.ip).appendTo(profile); $("<em/>").text(meta.ip).appendTo(profile);
} }
if (meta.aliases) { 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); $("<p/>").text(data.profile.text).appendTo(profile);
}); });
name.mousemove(function(ev) { name.mousemove(function(ev) {
@ -642,7 +644,9 @@ function applyOpts() {
.appendTo($("head")); .appendTo($("head"));
} }
switch(USEROPTS.layout) { switch (USEROPTS.layout) {
case "synchtube-fluid":
fluidLayout();
case "synchtube": case "synchtube":
synchtubeLayout(); synchtubeLayout();
break; break;
@ -657,7 +661,7 @@ function applyOpts() {
$("#qualitywrap").html(""); $("#qualitywrap").html("");
$("#videowrap").remove(); $("#videowrap").remove();
$("#chatwrap").removeClass("col-lg-5 col-md-5").addClass("col-lg-12 col-md-12"); $("#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(); $("#chatbtn").remove();