Chats: a shared highlight colour per chat, pushed live with star and rename
chat_color {session_id, color|null} stores a palette name (red, orange,
amber, green, teal, blue, purple, pink) on the operator-session row; rows
and replies carry it as color. Colour, star and rename changes are pushed
to every other connection as chat_session_changed.
This commit is contained in:
@@ -127,6 +127,7 @@ type operatorRegistry interface {
|
||||
CloseOperatorSession(ctx context.Context, sessionID string) error
|
||||
ReopenOperatorSession(ctx context.Context, sessionID string) error
|
||||
SetOperatorSessionStar(ctx context.Context, sessionID string, starred bool) error
|
||||
SetOperatorSessionColor(ctx context.Context, sessionID, color string) error
|
||||
SetOperatorSessionTitle(ctx context.Context, sessionID, title string) error
|
||||
SetOperatorSessionBackend(ctx context.Context, sessionID, backend string) error
|
||||
}
|
||||
@@ -201,10 +202,13 @@ func handleChat(ctx context.Context, request protocol.Message, broker chatBroker
|
||||
handleChatReopen(ctx, request, registry, write)
|
||||
return true
|
||||
case protocol.ChatStar:
|
||||
handleChatStar(ctx, request, registry, write)
|
||||
handleChatStar(ctx, request, registry, hub.changes(), clientID, write)
|
||||
return true
|
||||
case protocol.ChatColor:
|
||||
handleChatColor(ctx, request, registry, hub.changes(), clientID, write)
|
||||
return true
|
||||
case protocol.ChatRename:
|
||||
handleChatRename(ctx, request, registry, write)
|
||||
handleChatRename(ctx, request, registry, hub.changes(), clientID, write)
|
||||
return true
|
||||
case protocol.ChatBackends:
|
||||
handleChatBackends(request, broker, write)
|
||||
|
||||
Reference in New Issue
Block a user