zorchenhimer / MovieNight

Single instance video streaming server with integrated chat.

Home Page:https://discord.gg/F2VSgjJ

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Scrollback for joining users.

zorchenhimer opened this issue · comments

commented

Add a scrollback with the last N messages in chat to send to joining users. The number of messages should be configurable.

Yep, seems to be an good idea.
Did you already though of a solution to keep the last N messages ?

  • Maybe an in ram rolling stack ?

if i understand correctly a chat message is defined here:

type DataMessage struct {

Therefore it should be rather easy to implement a rolling stack with a fixed length to enable scrollback.

I bet the 'bigest' problem isn't the stack but handling the new chat user and send just to him the stack content.

commented

Nah, that should be pretty straight forward. A bunch of (hidden) messages are already sent to the client during the join process. Sending the scrollback would just happen after all that. I suppose it could be a new hidden message type so it could be formatted differently or something (eg, greyed out), but that's not exactly necessary.