             else
                 v = {}
                 for x in syncdb.select()
+                    if x.edits
+                        x.edits = immutable.Stack(x.edits)
                     v[x.date - 0] = x
                 actions.setState(messages : immutable.fromJS(v))
                 syncdb.on('change', actions._syncdb_change)

                            user_map     = {@props.user_map}
                            project_id   = {@props.project_id}
                            font_size    = {@props.font_size}
                            file_path    = {if @props.path? then misc.path_split(@props.path).head} />
                    </Panel>
                </Col>
            </Row>

    set_input: (input) =>
        @setState(input:input)

    # Doesn't work
    change_message: (message, new_content) =>
        #key = message.get('date')
        #console.log("CHANGE MESSAGE", key, new_content)

        #@mergeState(messages:
        #    "#{key}":
        #        payload:
        #            content:new_content)

    save_scroll_state: (position, height, offset) =>
        # height == 0 means chat room is not rendered
        if height != 0
            @setState(saved_position:position, height:height, offset:offset)


# boilerplate setting up actions, stores, sync'd file, etc.
syncdbs = {}
