Parsing the message and sending shape information further

This commit is contained in:
Oleksandr Zhurbenko 2015-08-05 16:54:44 -07:00
parent 3afad5db50
commit 400a0db0f4

View File

@ -232,6 +232,12 @@ class Meteor.RedisPubSub
return return
if message.header.name is "send_whiteboard_shape_message" if message.header.name is "send_whiteboard_shape_message"
#Meteor stringifies an array of JSONs (...shape.result) in this message
#parsing the String and reassigning the value
if message.payload.shape.shape_type is "poll_result" and typeof message.payload.shape.shape.result is 'string'
message.payload.shape.shape.result = JSON.parse message.payload.shape.shape.result
shape = message.payload.shape shape = message.payload.shape
whiteboardId = shape?.wb_id whiteboardId = shape?.wb_id
addShapeToCollection meetingId, whiteboardId, shape addShapeToCollection meetingId, whiteboardId, shape