       video source[src^="#{internalFileUrlPrefix}"],
       video source[src^="#{internalFileAbsoluteUrlPrefix}"]
     """
+      images[message._id].links += 1
       src = elt.getAttribute 'src'
       if 0 <= src.indexOf 'gridfs'
         messageImagesInternal[url2internalFile src] = true

    -> elt.removeEventListener 'dragstart', listener for elt in elts
  , [folded, history?, message]

  ## Maintain id2dom mapping
  useEffect ->
    id2dom[message._id] = ref.current
    ->
      delete id2dom[message._id]
      checkImage message._id
  , [message._id]
  ## Scroll to this message if it's been requested.
  useEffect ->
    if scrollToLater == message._id
      scrollToLater = null
      scrollToMessage message._id
    undefined
  , [message._id]

  ## Fold naturally folded (minimized and deleted) messages by default on
  ## initial load.  But only if not previously manually overridden.
  useEffect ->
    oldDefault = defaultFolded.get message._id
    oldFolded = messageFolded.get message._id

      initImageInternal id
      imagesInternal[id].count += 1
      checkImageInternal id
    checkImage message._id
    ->
      for id of messageImages
        images[id].count -= 1
