adjusting the parameter names so that they match what is recognized on the server
This commit is contained in:
parent
8c61b3fcdc
commit
2fb970d9cd
@ -33,15 +33,15 @@ Template.chatInput.events
|
||||
|
||||
messageForServer = { # construct message for server
|
||||
"message": $("#newMessageInput").val()
|
||||
"chatType": "PUBLIC_CHAT"
|
||||
"fromUserID": Session.get "userId"
|
||||
"fromUsername": Session.get "userName"
|
||||
"fromTimezoneOffset": "240"
|
||||
"toUsername": "public_chat_username"
|
||||
"toUserID": "public_chat_userid"
|
||||
"fromLang": "en"
|
||||
"fromTime": "1.403794169042E12"
|
||||
"fromColor": "0"
|
||||
"chat_type": "PUBLIC_CHAT"
|
||||
"from_userid": Session.get "userId"
|
||||
"from_username": Session.get "userName"
|
||||
"from_tz_offset": "240"
|
||||
"to_username": "public_chat_username"
|
||||
"to_userid": "public_chat_userid"
|
||||
"from_lang": "en"
|
||||
"from_time": "1.403794169042E12"
|
||||
"from_color": "0"
|
||||
}
|
||||
console.log "Sending message to server" + messageForServer.message
|
||||
Meteor.call "sendChatMessagetoServer", Session.get("meetingId"), messageForServer
|
||||
|
@ -1,6 +1,6 @@
|
||||
Meteor.methods
|
||||
addChatToCollection: (meetingId, messageObject) ->
|
||||
console.log "before -- " + Meteor.Chat.find({meetingId: meetingId}).count()
|
||||
console.log "Chat.size before -- " + Meteor.Chat.find({meetingId: meetingId}).count()
|
||||
entry = {
|
||||
meetingId: meetingId
|
||||
message: { # or message: messageObject but this is more verbose
|
||||
|
@ -26,7 +26,7 @@ Meteor.methods
|
||||
if Meteor.Users.findOne({userId:userId, meetingId: meetingId})?
|
||||
console.log "redundant entry, do not add to Meteor.Users - #{userId}:#{meetingId}:#{user.name}"
|
||||
else
|
||||
console.log "before:" + Meteor.Users.find().count()
|
||||
console.log "Users.size before:" + Meteor.Users.find().count()
|
||||
entry =
|
||||
meetingId: meetingId
|
||||
userId: userId
|
||||
|
@ -141,7 +141,7 @@ class Meteor.RedisPubSub
|
||||
payload: {
|
||||
"message" : chatObject
|
||||
"meeting_id": meetingId
|
||||
"requester_id": chatObject.fromUserID
|
||||
"requester_id": chatObject.from_userid
|
||||
}
|
||||
}
|
||||
console.log "\n\n\n\n" + JSON.stringify (message)
|
||||
|
Loading…
Reference in New Issue
Block a user