             create_at: Date.now()
             user_id: @self.id
             channel_id: channelID
+
+        if typeof msg is 'string'
+          postData.message = msg
+        else
+          postData.message = msg.message
+          if msg.props
+            postData.props = msg.props
+
+        console.log '=======postMessage data =======' + JSON.stringify postData
 
         # break apart long messages
         chunks = @_chunkMessage(postData.message)

        return null

    _chunkMessage: (msg) ->
        message_length = new TextEncoder.TextEncoder('utf-8').encode(msg).length
        message_limit = messageMaxRunes
        chunks = []

            # check if channel in other direction exists
            channel = userID + "__" + @self.id
            channel = @findChannelByName(channel)
        if channel
            # channel obviously doesn't exist, let's create it
            if callback? then callback(channel)
            return
        @createDirectChannel(userID,callback)

    getAllChannels: ->
        @channels
