prettified an object

This commit is contained in:
Logsol 2013-01-05 20:30:25 +01:00
parent fb5de522e5
commit 9d23898018

View file

@ -38,10 +38,17 @@
Channel.prototype.onAddUser = function (userId) { Channel.prototype.onAddUser = function (userId) {
var user = new User(userId, this); var user = new User(userId, this);
var othersJoined = Object.keys(this.users); var others = Object.keys(this.users);
this.users[user.id] = user; this.users[user.id] = user;
NotificationCenter.trigger('user/' + user.id + "/joinSuccess", {userId: user.id, channelName: this.name, others: othersJoined});
var options = {
userId: user.id,
channelName: this.name,
others: others
};
NotificationCenter.trigger('user/' + user.id + "/joinSuccess", options);
NotificationCenter.trigger('user/joined', user); NotificationCenter.trigger('user/joined', user);
} }