diff --git a/modules/users/users.js b/modules/users/users.js index 2d57193..d08c91f 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -38,13 +38,14 @@ var users = function(dbot) { var knownUsers = getServerUsers(event.server); if(!knownUsers.channelUsers.hasOwnProperty(event.channel.name)) { knownUsers.channelUsers[event.channel.name] = []; + event.reply('creating new chanusers') } var channelUsers = knownUsers.channelUsers[event.channel.name]; event.channel.nicks.each(function(nick) { nick = nick.name; if(api.isKnownUser(event.server, nick)) { - nick = api.resolveUser(nick); + nick = api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); } @@ -167,7 +168,7 @@ var users = function(dbot) { var channelUsers = knownUsers.channelUsers[event.channel.name]; if(api.isKnownUser(event.server, nick)) { - nick = api.resolveUser(nick); + nick = api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); } diff --git a/modules/users/web.js b/modules/users/web.js index b6d4ad2..ff7754b 100644 --- a/modules/users/web.js +++ b/modules/users/web.js @@ -22,9 +22,24 @@ var pages = function(dbot) { if(connections.hasOwnProperty(connection) && connections[connection].channels.hasOwnProperty(channel)) { - var nicks = Object.keys(connections[connection].channels[channel].nicks); + + var nicks = dbot.db.knownUsers[connection].channelUsers[channel]; + var channelUsers = {}; + for(var i=0;i