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:
Anton Georgiev 2014-07-28 19:56:40 +00:00
commit 3075166fa8
6 changed files with 31 additions and 49 deletions

View File

@ -91,7 +91,6 @@ Template.optionsBar.events
"from_lang": "en" "from_lang": "en"
"from_time": getTime() "from_time": getTime()
"from_color": "0" "from_color": "0"
}
# console.log 'Sending private message to server:' # console.log 'Sending private message to server:'
# console.log messageForServer # console.log messageForServer

View File

@ -1,8 +1,8 @@
Meteor.methods Meteor.methods
addChatToCollection: (meetingId, messageObject) -> addChatToCollection: (meetingId, messageObject) ->
entry = { entry =
meetingId: meetingId meetingId: meetingId
message: { # or message: messageObject but this is more verbose message:
chat_type: messageObject.chat_type chat_type: messageObject.chat_type
message: messageObject.message message: messageObject.message
to_username: messageObject.to_username to_username: messageObject.to_username
@ -13,8 +13,7 @@ Meteor.methods
from_time: messageObject.from_time from_time: messageObject.from_time
from_username: messageObject.from_username from_username: messageObject.from_username
from_lang: messageObject.from_lang from_lang: messageObject.from_lang
}
}
id = Meteor.Chat.insert(entry) id = Meteor.Chat.insert(entry)
console.log "added chat id=[#{id}]:#{messageObject.message}. Chat.size is now console.log "added chat id=[#{id}]:#{messageObject.message}. Chat.size is now
#{Meteor.Chat.find({meetingId: meetingId}).count()}" #{Meteor.Chat.find({meetingId: meetingId}).count()}"

View File

@ -1,15 +1,15 @@
Meteor.methods Meteor.methods
addShapeToCollection: (meetingId, whiteboardId, shapeObject) -> addShapeToCollection: (meetingId, whiteboardId, shapeObject) ->
unless Meteor.Shapes.findOne({whiteboardId:whiteboardId, meetingId: meetingId, "shape.wb_id": "shapeObject.wb_id"})? unless Meteor.Shapes.findOne({whiteboardId:whiteboardId, meetingId: meetingId, "shape.wb_id": "shapeObject.wb_id"})?
entry = { entry =
meetingId: meetingId meetingId: meetingId
whiteboardId: whiteboardId whiteboardId: whiteboardId
shape: { shape:
wb_id: shapeObject.wb_id wb_id: shapeObject.wb_id
shape_type: shapeObject.shape_type shape_type: shapeObject.shape_type
status: shapeObject.status status: shapeObject.status
id: shapeObject.id id: shapeObject.id
shape: { shape:
type: shapeObject.shape.type type: shapeObject.shape.type
status: shapeObject.shape.status status: shapeObject.shape.status
points: shapeObject.shape.points points: shapeObject.shape.points
@ -19,8 +19,6 @@ Meteor.methods
transparency: shapeObject.shape.transparency transparency: shapeObject.shape.transparency
thickness: shapeObject.shape.thickness thickness: shapeObject.shape.thickness
color: shapeObject.shape.color color: shapeObject.shape.color
}
}
}
id = Meteor.Shapes.insert(entry) id = Meteor.Shapes.insert(entry)
console.log "added shape id =[#{id}]:#{shapeObject.id} in #{meetingId}" console.log "added shape id =[#{id}]:#{shapeObject.id} in #{meetingId}"

View File

@ -1,10 +1,10 @@
Meteor.methods Meteor.methods
addSlideToCollection: (meetingId, presentationId, slideObject) -> addSlideToCollection: (meetingId, presentationId, slideObject) ->
unless Meteor.Slides.findOne({meetingId: meetingId, presentationId: presentationId})? unless Meteor.Slides.findOne({meetingId: meetingId, presentationId: presentationId})?
entry = { entry =
meetingId: meetingId meetingId: meetingId
presentationId: presentationId presentationId: presentationId
slide: { slide:
height_ratio: slideObject.height_ratio height_ratio: slideObject.height_ratio
y_offset: slideObject.y_offset y_offset: slideObject.y_offset
num: slideObject.num num: slideObject.num
@ -16,8 +16,7 @@ Meteor.methods
width_ratio: slideObject.width_ratio width_ratio: slideObject.width_ratio
swf_uri: slideObject.swf_uri swf_uri: slideObject.swf_uri
thumb_uri: slideObject.thumb_uri thumb_uri: slideObject.thumb_uri
}
}
id = Meteor.Slides.insert(entry) id = Meteor.Slides.insert(entry)
console.log "added slide id =[#{id}]:#{slideObject.id} in #{meetingId}. Now there are console.log "added slide id =[#{id}]:#{slideObject.id} in #{meetingId}. Now there are
#{Meteor.Slides.find({meetingId: meetingId}).count()} slides in the meeting" #{Meteor.Slides.find({meetingId: meetingId}).count()} slides in the meeting"

View File

@ -27,7 +27,7 @@ Meteor.methods
entry = entry =
meetingId: meetingId meetingId: meetingId
userId: userId userId: userId
user: { user:
userid: user.userid userid: user.userid
presenter: user.presenter presenter: user.presenter
name: user.name name: user.name
@ -39,7 +39,7 @@ Meteor.methods
extern_userid: user.extern_userid extern_userid: user.extern_userid
permissions: user.permissions permissions: user.permissions
locked: user.locked locked: user.locked
voiceUser: { voiceUser:
web_userid: user.voiceUser.web_userid web_userid: user.voiceUser.web_userid
callernum: user.voiceUser.callernum callernum: user.voiceUser.callernum
userid: user.voiceUser.userid userid: user.voiceUser.userid
@ -48,9 +48,7 @@ Meteor.methods
callername: user.voiceUser.callername callername: user.voiceUser.callername
locked: user.voiceUser.locked locked: user.voiceUser.locked
muted: user.voiceUser.muted muted: user.voiceUser.muted
}
webcam_stream: user.webcam_stream webcam_stream: user.webcam_stream
}
id = Meteor.Users.insert(entry) id = Meteor.Users.insert(entry)
console.log "added user id=[#{id}]:#{user.name}. Users.size is now #{Meteor.Users.find({meetingId: meetingId}).count()}" console.log "added user id=[#{id}]:#{user.name}. Users.size is now #{Meteor.Users.find({meetingId: meetingId}).count()}"

View File

@ -45,18 +45,16 @@ class Meteor.RedisPubSub
sendValidateToken: (meetingId, userId, authToken) -> sendValidateToken: (meetingId, userId, authToken) ->
console.log "\n\n i am sending a validate_auth_token with " + userId + "" + meetingId console.log "\n\n i am sending a validate_auth_token with " + userId + "" + meetingId
message = { message =
"payload": { "payload":
"auth_token": authToken "auth_token": authToken
"userid": userId "userid": userId
"meeting_id": meetingId "meeting_id": meetingId
}, "header":
"header": {
"timestamp": new Date().getTime() "timestamp": new Date().getTime()
"reply_to": meetingId + "/" + userId "reply_to": meetingId + "/" + userId
"name": "validate_auth_token" "name": "validate_auth_token"
}
}
if authToken? and userId? and meetingId? if authToken? and userId? and meetingId?
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify(message)) @pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify(message))
else else
@ -64,17 +62,15 @@ class Meteor.RedisPubSub
sendUserLeavingRequest: (meetingId, userId) -> sendUserLeavingRequest: (meetingId, userId) ->
console.log "\n\n sending a user_leaving_request for #{meetingId}:#{userId}" console.log "\n\n sending a user_leaving_request for #{meetingId}:#{userId}"
message = { message =
"payload": { "payload":
"meeting_id": meetingId "meeting_id": meetingId
"userid": userId "userid": userId
}, "header":
"header": {
"timestamp": new Date().getTime() "timestamp": new Date().getTime()
"name": "user_leaving_request" "name": "user_leaving_request"
"version": "0.0.1" "version": "0.0.1"
}
}
if userId? and meetingId? if userId? and meetingId?
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.users, JSON.stringify(message)) @pubClient.publish(Meteor.config.redis.channels.toBBBApps.users, JSON.stringify(message))
else else
@ -165,19 +161,16 @@ class Meteor.RedisPubSub
whiteboardId = "#{presentation.id}/#{page.num}" # d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1404411622872/1 whiteboardId = "#{presentation.id}/#{page.num}" # d2d9a672040fbde2a47a10bf6c37b6a4b5ae187f-1404411622872/1
console.log "the whiteboard_id here is:" + whiteboardId console.log "the whiteboard_id here is:" + whiteboardId
message = { message =
"payload": { "payload":
"meeting_id": meetingId "meeting_id": meetingId
"requester_id": "nodeJSapp" "requester_id": "nodeJSapp"
"whiteboard_id": whiteboardId "whiteboard_id": whiteboardId
},
"header": { "header": {
"timestamp": new Date().getTime() "timestamp": new Date().getTime()
"name": "get_whiteboard_shapes_request" "name": "get_whiteboard_shapes_request"
"version": "0.0.1" "version": "0.0.1"
}
}
if whiteboardId? and meetingId? if whiteboardId? and meetingId?
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.whiteboard, JSON.stringify(message)) @pubClient.publish(Meteor.config.redis.channels.toBBBApps.whiteboard, JSON.stringify(message))
else else
@ -212,27 +205,23 @@ class Meteor.RedisPubSub
publishingChatMessage: (meetingId, chatObject) => publishingChatMessage: (meetingId, chatObject) =>
console.log "publishing a chat message to bbb-apps" console.log "publishing a chat message to bbb-apps"
message = { message =
header : { header :
"timestamp": new Date().getTime() "timestamp": new Date().getTime()
"name": "send_public_chat_message_request" "name": "send_public_chat_message_request"
} payload:
payload: {
"message" : chatObject "message" : chatObject
"meeting_id": meetingId "meeting_id": meetingId
"requester_id": chatObject.from_userid "requester_id": chatObject.from_userid
}
}
console.log "publishing:" + JSON.stringify (message) console.log "publishing:" + JSON.stringify (message)
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.chat, JSON.stringify (message)) @pubClient.publish(Meteor.config.redis.channels.toBBBApps.chat, JSON.stringify (message))
invokeGetAllMeetingsRequest: => invokeGetAllMeetingsRequest: =>
#grab data about all active meetings on the server #grab data about all active meetings on the server
message = { message =
"header": { "header":
"name": "get_all_meetings_request" "name": "get_all_meetings_request"
} "payload": undefined #not sure if I need this
"payload": {
}
}
@pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify (message)) @pubClient.publish(Meteor.config.redis.channels.toBBBApps.meeting, JSON.stringify (message))