 
         sequence = _messagesWithInFlights()
         sequence = sequence.filter inMailbox mailboxID
-
         if _filterType is 'flag'
             sequence = sequence.filter _matchFlag
 
         else if _filterType is 'date'
             sequence = sequence.filter _matchRangeDate
+
 
         # We dont filter for _filterType from and dest because it is
         # complicated by collation and name vs address.

        after: _filterAfter
        hasNextPage: not _noMore

    getNextUrl: ->
        if _noMore
            return null
        else if _nextUrl
            _nextUrl
        else
            mailboxID = AccountStore.getSelectedMailbox().get 'id'
            sort = if _filterType in ['from', 'dest']
                encodeURIComponent "+#{_filterType}"
            else
                encodeURIComponent "#{_sortOrder}#{_sortField}"

            url = "mailbox/#{mailboxID}/?sort=#{sort}"
            if _filterType is 'flag' and _filterValue isnt '-'
                url += "&flag=#{_filterValue}"

            if _filterBefore isnt '-'
                url += "&before=#{encodeURIComponent _filterBefore}"

            if _filterAfter isnt '-'
                url += "&after=#{encodeURIComponent _filterAfter}"

            return url



AppDispatcher = require '../app_dispatcher'

AccountStore = require './account_store'

SocketUtils = require '../utils/socketio_utils'

{ActionTypes, MessageFlags, MessageFilter, FlagsConstants} =
