FIXED THAT MOTHERFUCKING BASTID BUG I AM THE RESURRECTION YEAAAAAAAAA [#272]

This commit is contained in:
reality 2013-03-24 18:05:57 +00:00
parent 17c2c4b317
commit 9443970c89

View File

@ -12,7 +12,7 @@ var users = function(dbot) {
'createUser': function(server, nick, channel, callback) { 'createUser': function(server, nick, channel, callback) {
var id = uuid.v4(); var id = uuid.v4();
this.db.create('users', id, { this.db.create('users', id, {
'uuid': id, 'id': id,
'primaryNick': nick, 'primaryNick': nick,
'currentNick': nick, 'currentNick': nick,
'server': server, 'server': server,
@ -22,15 +22,12 @@ var users = function(dbot) {
if(!err) { if(!err) {
dbot.api.event.emit('new_user', [ result ]); dbot.api.event.emit('new_user', [ result ]);
callback(result); callback(result);
dbot.say('aberwiki', '#realitest', result.server);
dbot.say('aberwiki', '#realitest', result.primaryNick);
} }
}); });
}.bind(this), }.bind(this),
'addChannelUser': function(user, channelName) { 'addChannelUser': function(user, channelName) {
user.channels.push(channelName); user.channels.push(channelName);
dbot.say('aberwiki', '#realitest', user.id);
this.db.save('users', user.id, user, function(err) { this.db.save('users', user.id, user, function(err) {
if(!err) { if(!err) {
this.api.getChannel(user.server, channelName, function(channel) { this.api.getChannel(user.server, channelName, function(channel) {
@ -40,7 +37,7 @@ var users = function(dbot) {
dbot.api.event.emit('new_channel_user', [ user, channel]); dbot.api.event.emit('new_channel_user', [ user, channel]);
} }
}); });
}); }.bind(this));
} }
}.bind(this)); }.bind(this));
}.bind(this), }.bind(this),
@ -101,7 +98,7 @@ var users = function(dbot) {
if(!channel) { // Channel does not yet exist if(!channel) { // Channel does not yet exist
var id = uuid.v4(); var id = uuid.v4();
this.db.create('channel_users', id, { this.db.create('channel_users', id, {
'uuid': id, 'id': id,
'server': event.server, 'server': event.server,
'name': event.channel.name, 'name': event.channel.name,
'users': [] 'users': []