Extension idea: chat channels
Posted: 13 Jun 2009, 10:23
Just had a random thought about implementing chat channels in ADC. Since the PM attribute in the MSG action allows for a group SID, the hub can arbitrarily assign SIDs that act as the host for chat channels. Below is a rough idea of a potential implementation. Supporting clients would broadcast the CHAN feature in the SU field.
1. An operator (SID=ABCD) creates a chat channel, for which the hub assigns a SID e.g. a hub command like !join "Movie Chat". The hub would internally allocate a SID, such as DCBA, to an identity named 'Movie Chat'. It would also add the operator to a list of users in that channel.
2. Another user, CABD, attempts to join the channel via the !join hub command. If the hub recognises the channel name, and authorises their entry to the channel, it sends an INF JCDCBA to the members of the DCBA channel, except CABD, where the JC parameter stands for Join Channel. I'm not sure which type of INF would be best, but the CABD SID must be sent as part of the message, so perhaps an Echo since CABD is indirectly the source.
3. CABD receives an INF CNMovie\sChat, where CN is Channel Name. CABD's client creates a new chat window, similar to a hub window (with chat area and user list), which has the title from the CN parameter.
4. CABD receives an INF JCDCBA identifying each member of the channel, including itself.
5. The user CABD decides to leave the channel, by closing the chat window. Their client sends INF PCDCBA i.e. Part Channel, which the hub forwards to all other members of the channel.
Additionally, if a group SID is registered by a bot (CT1 in the INF message when it connected) then the hub will forward all messages to that bot. This is sketchy in my head, but the benefit is that, for example, you can run a trivia bot in a seperate window from main chat, and still see all the users interacting with the bot.
The protocol doesn't offer any guidance on the rationale for group-SID in the PM parameter of MSG, but I thought this might be a decent use of it. Thoughts?
1. An operator (SID=ABCD) creates a chat channel, for which the hub assigns a SID e.g. a hub command like !join "Movie Chat". The hub would internally allocate a SID, such as DCBA, to an identity named 'Movie Chat'. It would also add the operator to a list of users in that channel.
2. Another user, CABD, attempts to join the channel via the !join hub command. If the hub recognises the channel name, and authorises their entry to the channel, it sends an INF JCDCBA to the members of the DCBA channel, except CABD, where the JC parameter stands for Join Channel. I'm not sure which type of INF would be best, but the CABD SID must be sent as part of the message, so perhaps an Echo since CABD is indirectly the source.
3. CABD receives an INF CNMovie\sChat, where CN is Channel Name. CABD's client creates a new chat window, similar to a hub window (with chat area and user list), which has the title from the CN parameter.
4. CABD receives an INF JCDCBA identifying each member of the channel, including itself.
5. The user CABD decides to leave the channel, by closing the chat window. Their client sends INF PCDCBA i.e. Part Channel, which the hub forwards to all other members of the channel.
Additionally, if a group SID is registered by a bot (CT1 in the INF message when it connected) then the hub will forward all messages to that bot. This is sketchy in my head, but the benefit is that, for example, you can run a trivia bot in a seperate window from main chat, and still see all the users interacting with the bot.
The protocol doesn't offer any guidance on the rationale for group-SID in the PM parameter of MSG, but I thought this might be a decent use of it. Thoughts?