3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 12:29:26 +01:00
This commit is contained in:
reality 2013-08-17 21:04:42 +00:00
parent da025dafbb
commit 0d927881b4
5 changed files with 17 additions and 21 deletions

View File

@ -18,6 +18,18 @@ var pages = function(dbot) {
});
},
'/report/:server/missing': function(req, res) {
var server = req.params.server,
user = req.user,
notifies = this.pending[user.id];
res.render('missing_notifies', {
'name': dbot.config.name,
'user': user.primaryNick,
'notifies': notifies
});
},
'/report/:server/:channel': function(req, res) {
var server = req.params.server,
channel = req.params.channel,
@ -35,20 +47,6 @@ var pages = function(dbot) {
'notifies': notifies
});
});
},
'/report/:server/missing/:user': function(req, res) {
var server = req.params.server,
nick = req.params.user;
dbot.api.users.resolveUser(server, nick, function(user) {
var notifies = this.pending[user.id];
res.render('missing_notifies', {
'name': dbot.config.name,
'user': nick,
'notifies': notifies
});
}.bind(this));
}
};
};

View File

@ -59,8 +59,7 @@ var report = function(dbot) {
if(_.has(this.pending, event.rUser.id) && this.pNotify[event.rUser.id] === true) {
dbot.say(event.server, event.user, dbot.t('missed_notifies', {
'user': event.rUser.primaryNick,
'link': dbot.api.web.getUrl('report/' + event.server +
'/missing/' + event.rUser.primaryNick)
'link': dbot.api.web.getUrl('report/' + event.server + '/missing')
}));
this.pNotify = false;
}

View File

@ -24,14 +24,11 @@ var webInterface = function(dbot) {
this.app.use(this.app.router);
passport.serializeUser(function(user, done) {
console.log('serialising ' + user);
done(null, user.id);
});
passport.deserializeUser(function(id, done) {
dbot.api.users.getUser(id, function(user) {
console.log(id);
console.log(user);
done(null, user);
});
});
@ -176,7 +173,6 @@ var webInterface = function(dbot) {
return next();
}
} else {
console.log(req);
res.render('login', {
'message': 'You need to log in to access this module.',
'redirect': req.originalUrl
@ -191,7 +187,6 @@ var webInterface = function(dbot) {
this.commands = {
'~setwebpass': function(event) {
var newPass = event.input[1];
console.log(newPass);
this.api.getWebUser(event.rUser.id, function(webUser) {
if(!webUser) {
webUser = {

View File

@ -2,6 +2,8 @@ extends ../layout
block content
h3 Notifications Missed by #{user.primaryNick}
div#backlink
a(href='/report') « Notifications
p
if notifies
div#profile_datatable

View File

@ -4,6 +4,8 @@ block content
h3 Servers
div#backlink
a(href='/') « Home
div
a(href='/report/'+user.server+'/missing') My Missed Notifications
ul#quotelist
-each server in servers
a(href='/report/'+server)