Permalink
Browse files

Show the logged-in username instead of the server

If we have a logged in user, show the username they logged in with,
instead of the server on the user-box on the sidebar.

There's little space left there, so adding the username separately
isn't a particularly good choice.

This fixes #149.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
  • Loading branch information...
1 parent 6158f96 commit a1d8d24c24c005416bbaf9a633da0c0a72588665 @algernon algernon committed Jul 23, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 assets/js/client.js
View
@@ -54,6 +54,7 @@ $(function() {
});
irc.socket.on('login_success', function(data) {
+ irc.username = data.username;
if(data.exists){
irc.socket.emit('connect', {});
} else {
@@ -72,7 +73,7 @@ $(function() {
});
irc.socket.on('restore_connection', function(data) {
- irc.me = new User({nick: data.nick, server: data.server});
+ irc.me = new User({nick: data.nick, server: (irc.username) ? irc.username : data.server, username: irc.username});
irc.connected = true;
irc.appView.render();
irc.appView.renderUserBox();

0 comments on commit a1d8d24

Please sign in to comment.