decent-chat / decent

Open source messaging platform for the modern web
https://meta.decent.chat
GNU General Public License v3.0
21 stars 5 forks source link

Implement reactions #21

Open towerofnix opened 6 years ago

towerofnix commented 6 years ago

The backend is half done already - there's an /api/add-message-reaction endpoint, and the reactions on a message can be fetched with /api/message/:messageID (or through message lists, etc). There still needs to be a socket event emitted to the client when a reaction is added, though. Input on how to do that? Perhaps just an "(add reaction {username, messageID, reactionCharacter} to message)" event? I don't want to send the whole list of everyone who's reacted every time - that could end up being a lot of data if there's many reactions (e.g. :+1: 152, :-1: 30, :100: 4, :trollface: 8).

The backend will also need to be updated to support more complex emoji, like ones which take up two unicode characters, and custom emotes, once those are implemented later (#18).

The client will need a way to add reactions. An emote picker would be handy, but that's for a separate issue - for now just entering a single character in a prompt is fine.

bates64 commented 6 years ago

Perhaps just an "(add reaction {username, messageID, reactionCharacter} to message)" event

Yes

bates64 commented 6 years ago

@towerofnix can you stabilize the API for this - i.e. write the second half! - so I can work on the frontend for it?

bates64 commented 6 years ago

Also kinda half blocked by #18.

towerofnix commented 6 years ago

Yeah, I'll see what I can do to make the format fairly extensible, so we can with custom reactions easily once we implement #18.

towerofnix commented 6 years ago

Unblocked; custom emotes are implemented.

bates64 commented 6 years ago

This is gonna need docs too (/api/add-message-reaction was removed in #204). I'm thinking POST /api/messages/:id/reactions?