         if not trash?
             LayoutActionCreator.alertError t 'message delete no trash'
         else
-            msg = message.toObject()
+            msg = message.toJSON()
             observer = jsonpatch.observe msg
             delete msg.mailboxIDs[id] for id of msg.mailboxIDs
             msg.mailboxIDs[trash] = -1

                callback error

    updateFlag: (message, flags, callback) ->
        msg = message.toObject()
        patches = jsonpatch.compare {flags: msg.flags}, {flags}
        XHRUtils.messagePatch message.get('id'), patches, (error, message) ->
            if not error?

                    callback err

    move: (message, from, to, callback) ->
        msg = message.toJSON()
        observer = jsonpatch.observe msg
        delete msg.mailboxIDs[from]
        msg.mailboxIDs[to] = -1
