Skip to content

chat: "tagged" messages #57

@goto-bus-stop

Description

@goto-bus-stop

Some messages might want special handling based on how they are sent. For example, a bot posting links from reddit into the chat so they can be styled differently, or a waitlist raffle message that should ping everybody in the waitlist, or an IRC /me style action message.

One way to solve this generically could be tags. Next to the message contents, a message can have one or more tags, similar to IRCv3 message tags. It could be a list of strings, probably:

{
  "command": "sendChat",
  "data": {
    "message": "[r/kpop] f(x) – FANCY NEW SONG",
    "tags": ["reddit"]
  } | {
    "message": "@Admin started a raffle!",
    "tags": ["raffleStart"]
  } | {
    "message": "waves",
    "tags": ["action"]
  }
}

But there might be uses for tags with more data attached as well, in which case it'd become something like

{
  "tags": {
    "action": true
  } | {
    "raffleEnd": { "winner": "<user id>" },
  }
}

Initially these tags would simply be passed through. Once role-based ACL is implemented there could be roles for sending tags at all: chat.tags, and for using specific tags chat.tags.action, chat.tags.closeEveryone'sBrowser, etc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions