How do I expand the chat?

19 views
Skip to first unread message

Hidden Knowledge

unread,
May 7, 2014, 1:44:01 PM5/7/14
to action...@googlegroups.com
Hello fellow users of actionHero.js, 

I've been looking at the documentation of your project (and I've been playing around a bit) and I was wondering how I would expand the chat system to allow for, 
for example: Chat administrator (users that can execute special commands that force-leave a user, or prevent a user from ever joining again) and other client-to-server commands/features.

I don't want you to write the code for me (although pseudocode would be fine), just point me in the right direction, if you want :)

Non-related: Is there a public IRC/XMPP chat for users/developers?

Kind Regards,
HiddenKnowledge

Evan Tahler

unread,
May 7, 2014, 8:34:30 PM5/7/14
to action...@googlegroups.com
Lets start another thread about an IRC server

The notion of a client administering a chat room is fun!  First, be sure to check out this new chat room philosophy section.

- The "admin" methods are server-side only (for security), but there's no reason you can't wrap them in an action (with authentication on the client).  
- I think the way to handle clients joining a room would be to create a 'login' action clients would call which would set `connection.authorizedRoom = 'nameOfRoom'`.  Then, they can roomChange into the proper room.
- actionhero won't "boot" a users who is no longer allowed into a room.  Once they are in, they are in (we only check the auth key when joining a room).  You can get around the effects of this by deleting the room and then re-creating it if you want to 'boot' someone.  The act of "booting" a member would involve changing/nulling `connection.authorizedRoom` on the client to boot.  To handle this, actionhero needs a way for one server to modify the attributes of a connection which may exists on another server.  I'll look into it.  

I'll also work on adding an `api.chatRoom.reAuthenticate()` method which can be called to ensure that all members are still authorized.  

Reply all
Reply to author
Forward
0 new messages