   updated = root.updated
   query = Messages.find
     root: root._id
+    ## Mimicking _consideredSubmessage above
     published: $ne: false    ## published is false or Date
     deleted: $ne: true
     private: $ne: true

#    updated = dateMax updated, submessage.updated
#  updated

_submessagesChanged = (root) ->
  return unless root?
  root = findMessage root

  message.id = id
  diffid = MessagesDiff.insert message
  message._id = diffid
  #_submessagesChanged old.root ? id
  ## In this special case, we can efficiently simulate the behavior of
  ## _submessagesChanged via a direct update to the root:
  if _consideredSubmessage message, old
    rootUpdate = $max: submessageLastUpdate: message.updated
    if old.root? and not _consideredSubmessage old
      rootUpdate.$inc = submessageCount: 1  ## considered a new submessage
    Messages.update (old.root ? id), rootUpdate
  else if _consideredSubmessage old
    ## If this message is no longer considered a submessage, we need to
    ## recompute from scratch in order to find the new last update.
    _submessagesChanged old.root ? id
  notifyMessageUpdate message if Meteor.isServer  ## client in simulation
  diffid

