Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Extract addUserToRoom/removeUserFromRoom logic to separate function that doesn't require logged in user

Open rwakida opened this issue 11 years ago • 5 comments

Use Case: Allows automated, anonymous (bot) adding/removal of users from a room. For example, we create a channel based on a user's location, and automatically add the user to the channel.

The logic to update the ChatRoom/ChatSubscription, and create a new ChatMessage would be extracted to a new non-exposed, serverside function. The existing Method methods would check that Meteor.userId() exists, and that the current user created the room then delegates to the new methods. The backend "bots" would call the extracted method.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

rwakida avatar Aug 13 '15 03:08 rwakida

Agreed! We did something similar with sendMessage.. we should do the same with ALL methods.

engelgabriel avatar Aug 14 '15 04:08 engelgabriel

With our bots now being logged in, and having our permissions system in place. Is this still relevant?

geekgonecrazy avatar May 12 '16 01:05 geekgonecrazy

@geekgonecrazy I haven't kept up with the RocketChat changes, but I'm cool with closing this issue as long as bots can execute the function. This also applies to issue #455.

rwakida avatar May 12 '16 04:05 rwakida

I don't think we should close it. We still need to move all logic from all methods into internal functions. Maybe we can re-title it?

engelgabriel avatar May 12 '16 12:05 engelgabriel

@engelgabriel Most of the requirements of the original request are now implemented and can be accessed in many ways, either the rest api or ddp method calls. Can this be closed now?

graywolf336 avatar Dec 07 '16 13:12 graywolf336