Skip to content

Commit

Permalink
Don't connect to servers to get username list
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 7, 2009
1 parent f35c0d9 commit 54cc311
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions client.js
Expand Up @@ -205,12 +205,16 @@ function onConnect (session) {
showChat(CONFIG.nick);
}

function outputNickString () {
var nick_string = nicks.length > 0 ? nicks.join(", ") : "(none)";
addMessage("users:", nick_string, new Date(), "notice");
}

function who () {
jQuery.get("/who", {}, function (data, status) {
if (status != "success") return;
nicks = data.nicks;
var nick_string = nicks.length > 0 ? nicks.join(", ") : "(none)";
addMessage("users:", nick_string, new Date(), "notice");
outputNickString();
}, "json");
}

Expand All @@ -223,7 +227,7 @@ $(document).ready(function() {
$("#entry").attr("value", ""); // clear the entry field.
});

$("#usersLink").click(who);
$("#usersLink").click(outputNickString);

$("#connectButton").click(function () {
showLoad();
Expand Down

0 comments on commit 54cc311

Please sign in to comment.