add admin to init message
This commit is contained in:
parent
3525fdcff4
commit
7771251f4f
3 changed files with 5 additions and 3 deletions
|
@ -45,7 +45,8 @@ export interface MSAgentInitMessage extends MSAgentProtocolMessage {
|
|||
charlimit: number
|
||||
users: {
|
||||
username: string,
|
||||
agent: string
|
||||
agent: string,
|
||||
admin: boolean
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ export class MSAgentChatRoom {
|
|||
users: this.clients.filter(c => c.username !== null).map(c => {
|
||||
return {
|
||||
username: c.username!,
|
||||
agent: c.agent!
|
||||
agent: c.agent!,
|
||||
admin: c.admin
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ export class MSAgentClient {
|
|||
this.charlimit = initMsg.data.charlimit;
|
||||
for (let _user of initMsg.data.users) {
|
||||
let agent = await agentCreateCharacterFromUrl(this.url + '/api/agents/' + _user.agent);
|
||||
agent.setUsername(_user.username, "#000000");
|
||||
agent.setUsername(_user.username, _user.admin ? "#FF0000" : "#000000");
|
||||
agent.addToDom(this.agentContainer);
|
||||
agent.show();
|
||||
let user = new User(_user.username, agent);
|
||||
|
|
Loading…
Reference in a new issue