parent
f11b65c9a8
commit
0eeb465d72
@ -0,0 +1,13 @@ |
||||
Meteor.startup -> |
||||
|
||||
Meteor.call 'getTotalChannels', (error, result) -> |
||||
if error |
||||
return Errors.throw error.reason |
||||
|
||||
# @todo: create settings for limit? |
||||
if result <= 200 |
||||
Meteor.call 'channelsList', (chError, channels) -> |
||||
if chError |
||||
return Errors.throw chError.reason |
||||
|
||||
CachedChannelList.insert(channel) for channel in channels.channels |
||||
@ -0,0 +1,7 @@ |
||||
Meteor.methods |
||||
getTotalChannels: -> |
||||
if not Meteor.userId() |
||||
throw new Meteor.Error 'invalid-user', '[methods] getTotalChannels -> Invalid user' |
||||
|
||||
console.log '[methods] getTotalChannels -> '.green, 'userId:', Meteor.userId() |
||||
return RocketChat.models.Rooms.find({ t: 'c' }).count() |
||||
Loading…
Reference in new issue