Mercurial > pumpbridge
diff index.js_to_pump.io-client-app_lib_routes @ 30:3e3fa35e3ce2
twitter sync likes, recommend mongodb
configure pump2twitter, twitter2pump in webui
author | Mathias Gebbe <mgebbe@intevation.de> |
---|---|
date | Thu, 28 Aug 2014 18:40:39 +0200 |
parents | faeb3b96bdeb |
children |
line wrap: on
line diff
--- a/index.js_to_pump.io-client-app_lib_routes Tue Jul 29 16:06:05 2014 +0200 +++ b/index.js_to_pump.io-client-app_lib_routes Thu Aug 28 18:40:39 2014 +0200 @@ -23,6 +23,7 @@ User = require("../models/user"), Host = require("../models/host"), Usermap = require("../../../../lib/usermap"), + //Usermap = require("../../../../src/usermap"), RequestToken = require("../models/requesttoken"), RememberMe = require("../models/rememberme"), site = require("../models/site"); @@ -42,17 +43,21 @@ var hosts, users, bank = Host.bank(); if (req.user) { - var fb=false, gp=false, tw=false; + var fb=false, gp=false, tw=false, twfromesn=true, twtoesn=true; Usermap.search({ user_pumpio: req.user.id }, function(err, result) { if(err) res.render('login', { pageTitle: "pumpbridge" }); _.each(result, function(um) { if ( um.id.indexOf('@facebook') != -1 ) fb=true; - if ( um.id.indexOf('@twitter') != -1 ) tw=true; + if ( um.id.indexOf('@twitter') != -1 ) { + tw=true; + if(typeof um.fromesn != "undefined") twfromesn = um.fromesn; + if(typeof um.toesn != "undefined") twtoesn = um.toesn; + } if ( um.id.indexOf('@google') != -1 ) gp=true; }); - res.render('index', { pageTitle: "pumpbridge" , user: req.user, usermapfb: fb, usermapgp: gp, usermaptw: tw}); + res.render('index', { pageTitle: "pumpbridge" , user: req.user, usermapfb: fb, usermapgp: gp, usermaptw: tw, twfromesn: twfromesn, twtoesn: twtoesn}); }); } else { res.render('login', { pageTitle: "pumpbridge" });