More switching

This commit is contained in:
perroned 2014-09-24 09:46:19 -07:00
parent 52f0b771fe
commit efbd3f1e94

View File

@ -6,12 +6,13 @@
chattingWith = getInSession('inChatWith')
if chattingWith isnt "PUBLIC_CHAT"
dest = Meteor.Users.findOne("userId": chattingWith)
# dest = Meteor.Users.findOne("userId": chattingWith)
dest = Meteor.Users.findOne(_id: chattingWith)
messageForServer = { # construct message for server
"message": message
"chat_type": if chattingWith is "PUBLIC_CHAT" then "PUBLIC_CHAT" else "PRIVATE_CHAT"
"from_userid": getInSession("userId")
"from_userid": getInSession("userId") # will get translated on the server
"from_username": getUsersName()
"from_tz_offset": "240"
"to_username": if chattingWith is "PUBLIC_CHAT" then "public_chat_username" else dest.user.name