Merge pull request #1104 from Shelnutt2/master
Add new server method getRoomIdByNameOrIdpull/1134/head
commit
844dc4ed5e
@ -0,0 +1,14 @@ |
||||
Meteor.methods |
||||
getRoomIdByNameOrId: (rid) -> |
||||
|
||||
console.log '[methods] getRoomIdByNameOrId-> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments |
||||
|
||||
room = RocketChat.models.Rooms.findOneById rid |
||||
|
||||
if not room? |
||||
room = RocketChat.models.Rooms.findOneByName rid |
||||
|
||||
if room? |
||||
rid = room._id |
||||
|
||||
return rid |
Loading…
Reference in new issue