   MessagesStore
   (threads, messages) ->
     threads.map (thread) ->
-      # replace messageIds in list with message instances.
-
-      messages = thread.get('messages').map (messageId) ->
-
+      thread.update 'messages', (msgs) -> msgs.map (messageId) ->
         message = messages.get messageId
         if message.has('__editedBody')
           message = message.set 'body', message.get '__editedBody'
           message = message.set 'payload', message.get '__editedPayload'
 
         return message
-
-      thread.set 'messages', messages
 ]
 
 channelPopularMessages = [

selectedChannelThreadMessages = [
  selectedChannelThread
  (thread) ->
    if thread?.has 'messages'
    then thread.get 'messages'
    else immutable.List()
selectedChannelPopularMessages = [
  channelPopularMessages
  selectedChannelThreadId

  channelThreads
  selectedChannel
  (threads, channel) ->
    return null  unless channel
    thread = threads.get channel.get('id')
    return thread.set 'channel', channel
]
