Prevent archived rooms from showing up in the list of all channels

pull/1620/head
Matthias Brun 10 years ago
parent fd81049609
commit bd2c75f17c
  1. 11
      packages/rocketchat-lib/server/models/Rooms.coffee
  2. 2
      server/methods/channelsList.coffee

@ -147,6 +147,17 @@ RocketChat.models.Rooms = new class extends RocketChat.models._Base
return @find query, options
findByTypeAndArchivationState: (type, archivationstate, options) ->
query =
t: type
if archivationstate
query.archived = true
else
query.archived = { $ne: true }
return @find query, options
findByVisitorToken: (visitorToken, options) ->
query =
"v.token": visitorToken

@ -1,3 +1,3 @@
Meteor.methods
channelsList: ->
return { channels: RocketChat.models.Rooms.findByType('c', { sort: { msgs:-1 } }).fetch() }
return { channels: RocketChat.models.Rooms.findByTypeAndArchivationState('c', false, { sort: { msgs:-1 } }).fetch() }

Loading…
Cancel
Save