Merge branch 'meteor-merge-private-chat' into meteor-rebuild-server
Conflicts: labs/meteor-client/client/views/chat/chat_bar.coffee
This commit is contained in:
commit
3075166fa8
@ -91,7 +91,6 @@ Template.optionsBar.events
|
||||
"from_lang": "en"
|
||||
"from_time": getTime()
|
||||
"from_color": "0"
|
||||
}
|
||||
|
||||
# console.log 'Sending private message to server:'
|
||||
# console.log messageForServer
|
||||
|
@ -1,8 +1,8 @@
|
||||
Meteor.methods
|
||||
addChatToCollection: (meetingId, messageObject) ->
|
||||
entry = {
|
||||
entry =
|
||||
meetingId: meetingId
|
||||
message: { # or message: messageObject but this is more verbose
|
||||
message:
|
||||
chat_type: messageObject.chat_type
|
||||
message: messageObject.message
|
||||
to_username: messageObject.to_username
|
||||
@ -13,8 +13,7 @@ Meteor.methods
|
||||
from_time: messageObject.from_time
|
||||
from_username: messageObject.from_username
|
||||
from_lang: messageObject.from_lang
|
||||
}
|
||||
}
|
||||
|
||||
id = Meteor.Chat.insert(entry)
|
||||
console.log "added chat id=[#{id}]:#{messageObject.message}. Chat.size is now
|
||||
#{Meteor.Chat.find({meetingId: meetingId}).count()}"
|
||||
|
@ -1,15 +1,15 @@
|
||||
Meteor.methods
|
||||
addShapeToCollection: (meetingId, whiteboardId, shapeObject) ->
|
||||
unless Meteor.Shapes.findOne({whiteboardId:whiteboardId, meetingId: meetingId, "shape.wb_id": "shapeObject.wb_id"})?
|
||||
entry = {
|
||||
entry =
|
||||
meetingId: meetingId
|
||||
whiteboardId: whiteboardId
|
||||
shape: {
|
||||
shape:
|
||||
wb_id: shapeObject.wb_id
|
||||
shape_type: shapeObject.shape_type
|
||||
status: shapeObject.status
|
||||
id: shapeObject.id
|
||||
shape: {
|
||||
shape:
|
||||
type: shapeObject.shape.type
|
||||
status: shapeObject.shape.status
|
||||
points: shapeObject.shape.points
|
||||
@ -19,8 +19,6 @@ Meteor.methods
|
||||
transparency: shapeObject.shape.transparency
|
||||
thickness: shapeObject.shape.thickness
|
||||
color: shapeObject.shape.color
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
id = Meteor.Shapes.insert(entry)
|
||||
console.log "added shape id =[#{id}]:#{shapeObject.id} in #{meetingId}"
|
||||
|
@ -1,10 +1,10 @@
|
||||
Meteor.methods
|
||||
addSlideToCollection: (meetingId, presentationId, slideObject) ->
|
||||
unless Meteor.Slides.findOne({meetingId: meetingId, presentationId: presentationId})?
|
||||
entry = {
|
||||
entry =
|
||||
meetingId: meetingId
|
||||
presentationId: presentationId
|
||||
slide: {
|
||||
slide:
|
||||
height_ratio: slideObject.height_ratio
|
||||
y_offset: slideObject.y_offset
|
||||
num: slideObject.num
|
||||
@ -16,8 +16,7 @@ Meteor.methods
|
||||
width_ratio: slideObject.width_ratio
|
||||
swf_uri: slideObject.swf_uri
|
||||
thumb_uri: slideObject.thumb_uri
|
||||
}
|
||||
}
|
||||
|
||||
id = Meteor.Slides.insert(entry)
|
||||
console.log "added slide id =[#{id}]:#{slideObject.id} in #{meetingId}. Now there are
|
||||
#{Meteor.Slides.find({meetingId: meetingId}).count()} slides in the meeting"
|
||||
|
@ -27,7 +27,7 @@ Meteor.methods
|
||||
entry =
|
||||
meetingId: meetingId
|
||||
userId: userId
|
||||
user: {
|
||||
user:
|
||||
userid: user.userid
|
||||
presenter: user.presenter
|
||||
name: user.name
|
||||
@ -39,7 +39,7 @@ Meteor.methods
|
||||
extern_userid: user.extern_userid
|
||||
permissions: user.permissions
|
||||
locked: user.locked
|
||||
voiceUser: {
|
||||
voiceUser:
|
||||
web_userid: user.voiceUser.web_userid
|
||||
callernum: user.voiceUser.callernum
|
||||
userid: user.voiceUser.userid
|
||||
@ -48,9 +48,7 @@ Meteor.methods
|
||||
callername: user.voiceUser.callername
|
||||
locked: user.voiceUser.locked
|
||||
muted: user.voiceUser.muted
|
||||
}
|
||||
webcam_stream: user.webcam_stream
|
||||
}
|
||||
|
||||
id = Meteor.Users.insert(entry)
|
||||
console.log "added user id=[#{id}]:#{user.name}. Users.size is now #{Meteor.Users.find({meetingId: meetingId}).count()}"
|
||||
|
@ -45,18 +45,16 @@ class Meteor.RedisPubSub
|
||||
sendValidateToken: (meetingId, userId, authToken) ->
|
||||
console.log "\n\n i am sending a validate_auth_token with " + userId + "" + meetingId
|
||||
|
||||
message = {
|
||||
"payload": {
|
||||
message =
|
||||
"payload":
|
||||
"auth_token": authToken
|
||||
"userid": userId
|
||||
"meeting_id": meetingId
|
||||
},
|
||||
"header": {
|
||||
"header":
|
||||
"timestamp": new Date().getTime()
|
||||
"reply_to": meetingId + "/" + userId
|
||||
"name": "validate_auth_token"
|
||||
}
|
||||
}
|
||||
|
||||
if authToken? and userId? and meetingId?
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify(message))
|
||||
else
|
||||
@ -64,17 +62,15 @@ class Meteor.RedisPubSub
|
||||
|
||||
sendUserLeavingRequest: (meetingId, userId) ->
|
||||
console.log "\n\n sending a user_leaving_request for #{meetingId}:#{userId}"
|
||||
message = {
|
||||
"payload": {
|
||||
message =
|
||||
"payload":
|
||||
"meeting_id": meetingId
|
||||
"userid": userId
|
||||
},
|
||||
"header": {
|
||||
"header":
|
||||
"timestamp": new Date().getTime()
|
||||
"name": "user_leaving_request"
|
||||
"version": "0.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
if userId? and meetingId?
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.users, JSON.stringify(message))
|
||||
else
|
||||
@ -165,19 +161,16 @@ class Meteor.RedisPubSub
|
||||
whiteboardId = "#{presentation.id}/#{page.num}" # d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1404411622872/1
|
||||
console.log "the whiteboard_id here is:" + whiteboardId
|
||||
|
||||
message = {
|
||||
"payload": {
|
||||
message =
|
||||
"payload":
|
||||
"meeting_id": meetingId
|
||||
"requester_id": "nodeJSapp"
|
||||
"whiteboard_id": whiteboardId
|
||||
|
||||
},
|
||||
"header": {
|
||||
"timestamp": new Date().getTime()
|
||||
"name": "get_whiteboard_shapes_request"
|
||||
"version": "0.0.1"
|
||||
}
|
||||
}
|
||||
|
||||
if whiteboardId? and meetingId?
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.whiteboard, JSON.stringify(message))
|
||||
else
|
||||
@ -212,27 +205,23 @@ class Meteor.RedisPubSub
|
||||
|
||||
publishingChatMessage: (meetingId, chatObject) =>
|
||||
console.log "publishing a chat message to bbb-apps"
|
||||
message = {
|
||||
header : {
|
||||
message =
|
||||
header :
|
||||
"timestamp": new Date().getTime()
|
||||
"name": "send_public_chat_message_request"
|
||||
}
|
||||
payload: {
|
||||
payload:
|
||||
"message" : chatObject
|
||||
"meeting_id": meetingId
|
||||
"requester_id": chatObject.from_userid
|
||||
}
|
||||
}
|
||||
|
||||
console.log "publishing:" + JSON.stringify (message)
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.chat, JSON.stringify (message))
|
||||
|
||||
invokeGetAllMeetingsRequest: =>
|
||||
#grab data about all active meetings on the server
|
||||
message = {
|
||||
"header": {
|
||||
message =
|
||||
"header":
|
||||
"name": "get_all_meetings_request"
|
||||
}
|
||||
"payload": {
|
||||
}
|
||||
}
|
||||
"payload": undefined #not sure if I need this
|
||||
|
||||
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify (message))
|
||||
|
Loading…
Reference in New Issue
Block a user