mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Show correct names for registered users.
This commit is contained in:
parent
58fca6bcf7
commit
76ca3dcebc
2 changed files with 4 additions and 1 deletions
|
|
@ -103,6 +103,9 @@ func (client *Client) UserId() int {
|
||||||
|
|
||||||
// Get the client's shown name.
|
// Get the client's shown name.
|
||||||
func (client *Client) ShownName() string {
|
func (client *Client) ShownName() string {
|
||||||
|
if client.IsSuperUser() {
|
||||||
|
return "SuperUser"
|
||||||
|
}
|
||||||
if client.IsRegistered() {
|
if client.IsRegistered() {
|
||||||
return client.user.Name
|
return client.user.Name
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
|
||||||
|
|
||||||
userstate := &mumbleproto.UserState{
|
userstate := &mumbleproto.UserState{
|
||||||
Session: proto.Uint32(client.Session),
|
Session: proto.Uint32(client.Session),
|
||||||
Name: proto.String(client.Username),
|
Name: proto.String(client.ShownName()),
|
||||||
ChannelId: proto.Uint32(0),
|
ChannelId: proto.Uint32(0),
|
||||||
}
|
}
|
||||||
if client.IsRegistered() {
|
if client.IsRegistered() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue