spacebarchat / server

Spacebar server - A reimplementation of the Discord.com backend, built with Typescript and love
https://spacebar.chat
GNU Affero General Public License v3.0
1.42k stars 246 forks source link

Live message composing #379

Open SamuelScheit opened 3 years ago

SamuelScheit commented 3 years ago

Problem You want to quickly get your point across and answer someone. So what you do is rapidly type in your message and hit sent and then reread, edit and correct your message in retrospect.

Solution To revolutionize messaging and how text communication works we'll introduce Live message composing. It allows you to communicate with friends in real time over a text interface and shows your message preview instantaneously on the other side just like the current typing indicator.

Implementation You need to opt in on the client for each channel to send TYPING_UPDATE events. Event data: Field Type Description
channel_id snowflake id of the channel
guild_id snowflake id of the guild
user_id snowflake id of the user
content string The message content
erkinalp commented 3 years ago

Blocked by #280

SamuelScheit commented 3 years ago

Actually you can already send some events to the gateway (presence update, voice state update, request guild members). We can add TYPING_UPDATE and only use the gateway for critical real time events, but for all other actions we should still use the api.

TheArcaneBrony commented 3 years ago

you could send it as a message, and use MESSAGE_EDIT or similar to update it, with backwards compatibility with discord.

erkinalp commented 3 years ago

@TheArcaneBrony that would work on messages sent using REST but not on ones currently being typed using the WSS gateway, as MESSAGE_EDIT is not supposed to be sent while the message is not actually posted.

SamuelScheit commented 3 years ago

Fosscord is backwards but not forwards compatible, which means that all discord base features will work with the discord client/bots, however new features will not be compatible to discord.