~mergeusershook for notify

This commit is contained in:
reality 2013-08-24 20:42:30 +00:00
parent dfde53b8ac
commit 9a4111c393

View File

@ -188,7 +188,14 @@ var report = function(dbot) {
if(_.has(dbot.modules, 'web')) {
dbot.api.web.addIndexLink('/notify', 'Notifications');
}
};
dbot.api.event.addHook('~mergeusers', function(server, oldUser, newUser) {
this.db.search('notifies', { 'user': oldUser.id }, function(notify) {
notify.user = newUser.id;
this.db.save('notifies', notify.id, notify, function() {});
}.bind(this), function() {});
}.bind(this));
}.bind(this);
};
exports.fetch = function(dbot) {