From de28d8af55c331b0067f30e946bcb626b8d54c2e Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Thu, 2 May 2013 16:00:24 -0400 Subject: [PATCH] token bug --- public/templates/home.tpl | 14 ++++++++++++-- src/websockets.js | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/public/templates/home.tpl b/public/templates/home.tpl index b49f4c2e85..48aeda29fa 100644 --- a/public/templates/home.tpl +++ b/public/templates/home.tpl @@ -3,7 +3,7 @@
  • {topics.title}

    -

    Posted {topics.relativeTime} by user {topics.uid}. {topics.post_count} posts.

    +

    Posted {topics.relativeTime} by user . {topics.post_count} posts.

  • @@ -14,7 +14,17 @@ new_post.onclick = function() { } jQuery('document').ready(function() { - + var userId = {topics.uid}; + + socket.on('api:user.get', function(userObj) { + console.log("derp"); + console.log(userObj); + + }); + + socket.emit('api:user.get', { fields: [ 'uid' ], 'uid': userId }); + + }); diff --git a/src/websockets.js b/src/websockets.js index 642a7d5c57..eff9118aa9 100644 --- a/src/websockets.js +++ b/src/websockets.js @@ -70,7 +70,7 @@ var SocketIO = require('socket.io').listen(global.server,{log:false}), // BEGIN: API calls (todo: organize) // julian: :^) socket.on('api:user.get', function(data) { - modules.user.get(socket, uid, data.fields); + modules.user.get(socket, data.uid || uid, data.fields); }); socket.on('user.exists', function(data) {