Show correct names for registered users.

This commit is contained in:
Mikkel Krautz 2011-04-09 21:39:38 +02:00
parent 58fca6bcf7
commit 76ca3dcebc
2 changed files with 4 additions and 1 deletions

View file

@ -103,6 +103,9 @@ func (client *Client) UserId() int {
// Get the client's shown name.
func (client *Client) ShownName() string {
if client.IsSuperUser() {
return "SuperUser"
}
if client.IsRegistered() {
return client.user.Name
}

View file

@ -413,7 +413,7 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
userstate := &mumbleproto.UserState{
Session: proto.Uint32(client.Session),
Name: proto.String(client.Username),
Name: proto.String(client.ShownName()),
ChannelId: proto.Uint32(0),
}
if client.IsRegistered() {