when we try to send a chat message from the html5 client we now send a send_public_chat_message_request towards bbb-apps

This commit is contained in:
Anton Georgiev 2014-06-27 17:53:31 +00:00
parent 9a9c80efab
commit d6851c39a4
3 changed files with 22 additions and 4 deletions

View File

@ -43,8 +43,6 @@ Template.chatInput.events
"fromTime": "1.403794169042E12"
"fromColor": "0"
}
#Meteor.call 'sendChatMessagetoServer', messageForServer
console.log "Sending message to server"
alert JSON.stringify messageForServer
Meteor.call "addChatToCollection", Session.get("meetingId"), messageForServer
console.log "Sending message to server" + messageForServer.message
Meteor.call "sendChatMessagetoServer", Session.get("meetingId"), messageForServer
$('#newMessageInput').val '' # Clear message box

View File

@ -19,3 +19,7 @@ Meteor.methods
id = Meteor.Chat.insert(entry)
console.log "added chat id=[#{id}]:#{messageObject.message}. Chat.size is now
#{Meteor.Chat.find({meetingId: meetingId}).count()}"
sendChatMessagetoServer: (meetingId, messageObject) ->
Meteor.redisPubSub.publishChatMessage(meetingId, messageObject)
Meteor.call "addChatToCollection", meetingId, messageObject

View File

@ -130,3 +130,19 @@ class Meteor.RedisPubSub
console.log "err=" + err
console.log "res=" + res
)
publishChatMessage: (meetingId, chatObject) =>
console.log "publishing a chat message to bbb-apps"
message = {
header : {
"timestamp": new Date().getTime()
"name": "send_public_chat_message_request"
}
payload: {
"message" : chatObject
"meeting_id": meetingId
"requester_id": chatObject.fromUserID
}
}
console.log "\n\n\n\n" + JSON.stringify (message)
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify (message))