       threadMentions[author] -= 1 for author in mentions
   , [(key for key of message.authors).join('@'), message.title, message.body, usernames]
 
+  messageFileRef = useRef()
+  useEffect ->
+    return if folded or history? or not messageFileRef.current?
+    listener = messageOnDragStart message
+    elts = messageFileRef.current.querySelectorAll 'img, video, a, canvas'
+    elt.addEventListener 'dragstart', listener for elt in elts
+    -> elt.removeEventListener 'dragstart', listener for elt in elts
+  , [folded, history?, messageFileRef.current, message]
+
   onFold = (e) ->
     e.preventDefault()
     e.stopPropagation()

      {renderedChildren}
    </li>
TableOfContents.displayName = 'TableOfContents'

###
Template.tableOfContentsMessage.onRendered ->
  @autorun =>
    listener = messageDrag.call @, @find('a'), false, listener
###

addDragOver = (e) ->
  e.preventDefault()

  #  Math.floor(Math.random() * 25 + 255 - 25).toString(16) +
  #  Math.floor(Math.random() * 25 + 255 - 25).toString(16) +
  #  Math.floor(Math.random() * 25 + 255 - 25).toString(16)

  ## Scroll to this message if it's been requested.
  if scrollToLater == @data._id
