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:
parent
9a9c80efab
commit
d6851c39a4
@ -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
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user