         _undoable[ref]
 
     getQueryParams: ->
-        sort: "#{_sortOrder}#{_sortField}"
-        type: _filterType
-        filter: _filterValue
-        before: _filterBefore
-        after: _filterAfter
-        hasNextPage: not _noMore
+        filter = _getFilter()
+        params =
+            sort: _getURISort()
+            type: filter.type
+            filter: filter.value
+            before: filter.before
+            after: filter.after
+            hasNextPage: not _noMore
+        return params
 
     getCurrentURL: ->
+        filter = _getFilter()
         mailboxID = AccountStore.getSelectedMailbox().get 'id'
-        sort = if _filterType in ['from', 'dest']
-            encodeURIComponent "+#{_filterType}"
+        sort = if filter.type in ['from', 'dest']
+            encodeURIComponent "+#{filter.type}"
         else
-            encodeURIComponent "#{_sortOrder}#{_sortField}"
+            encodeURIComponent _getURISort()
 
         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}"
+        if filter.type is 'flag' and filter.value isnt '-'
+            url += "&flag=#{filter.value}"
+
+        if filter.before isnt '-'
+            url += "&before=#{encodeURIComponent filter.before}"
+
+        if filter.after isnt '-'
+            url += "&after=#{encodeURIComponent filter.after}"
         return url
 
     getNextUrl: ->


        handle ActionTypes.SELECT_ACCOUNT, (value) ->
            @setCurrentID null
            _sortOrder = '+'
            _sortField = 'date'
            _filterType = 'nofilter'
            _filterValue = '-'
            _filterBefore = '-'
            _filterAfter = '-'
            _noMore = false
            _nextUrl = null

        handle ActionTypes.RECEIVE_MESSAGE_DELETE, (id) ->
            _messages = _messages.remove id

            _currentUrl = url
            return url

module.exports = self = new MessageStore()
