mirror of
https://github.com/owncast/owncast.git
synced 2024-12-23 01:31:10 +03:00
16 lines
569 B
TypeScript
16 lines
569 B
TypeScript
import { ConnectedClientInfoEvent } from '../../../interfaces/socket-events';
|
|
|
|
export default function handleConnectedClientInfoMessage(
|
|
message: ConnectedClientInfoEvent,
|
|
setChatDisplayName: (string) => void,
|
|
setChatDisplayColor: (number) => void,
|
|
setChatUserId: (number) => void,
|
|
setIsChatModerator: (boolean) => void,
|
|
) {
|
|
const { user } = message;
|
|
const { id, displayName, displayColor, scopes } = user;
|
|
setChatDisplayName(displayName);
|
|
setChatDisplayColor(displayColor);
|
|
setChatUserId(id);
|
|
setIsChatModerator(scopes?.includes('moderator'));
|
|
}
|