           ShareJS.initializeDoc id, old.body ? ''
           timer = null
           listener = Meteor.bindEnvironment (opData) ->
-            Meteor.clearTimeout timer
-            timer = Meteor.setTimeout ->
-              doc = Meteor.wrapAsync(ShareJS.model.getSnapshot) id
-              #console.log id, 'changed to', doc.snapshot
-              msg = Messages.findOne id
-              unless msg.body == doc.snapshot
-                _messageUpdate id,
-                  body: doc.snapshot
-                , msg.editing, msg
-              #Messages.update id,
-              #  $set: body: doc.snapshot
-              #MessagesDiff.insert
-              #  id: id
-              #  updators: msg.editing
-              #  updated: new Date
-              #  body: doc.snapshot
-            , idle
+            delayedEditor2messageUpdate id
           ShareJS.model.listen id, listener
       Messages.update id,
         $addToSet: editing: Meteor.user().username

      doc.updated = new Date
    MessagesParent.insert doc

Meteor.methods
  messageUpdate: (id, message) -> _messageUpdate id, message


    #if Meteor.isServer and (after.editing ? []).length == 0
    if Meteor.isServer
      unless Messages.findOne(id).editing?.length
        editor2messageUpdate id
        ShareJS.model.delete id

  messageImport: (group, parent, message, diffs) ->
