mirror of
https://github.com/owncast/owncast.git
synced 2025-01-09 01:57:43 +03:00
14 lines
477 B
TypeScript
14 lines
477 B
TypeScript
import { ConnectedClientInfoEvent } from '../../../interfaces/socket-events';
|
|
|
|
export default function handleConnectedClientInfoMessage(
|
|
message: ConnectedClientInfoEvent,
|
|
setChatDisplayName: (string) => void,
|
|
setChatUserId: (number) => void,
|
|
setIsChatModerator: (boolean) => void,
|
|
) {
|
|
const { user } = message;
|
|
const { id, displayName, scopes } = user;
|
|
setChatDisplayName(displayName);
|
|
setChatUserId(id);
|
|
setIsChatModerator(scopes?.includes('moderator'));
|
|
}
|