forked from External/grumble
Make LastChannel logic work.
This commit is contained in:
parent
41689595f2
commit
b1d6717a04
3 changed files with 14 additions and 5 deletions
12
server.go
12
server.go
|
|
@ -561,10 +561,18 @@ func (server *Server) finishAuthenticate(client *Client) {
|
|||
server.hclients[host] = append(server.hclients[host], client)
|
||||
server.hmutex.Unlock()
|
||||
|
||||
channel := server.RootChannel()
|
||||
if client.IsRegistered() {
|
||||
lastChannel := server.Channels[client.user.LastChannelId]
|
||||
if lastChannel != nil {
|
||||
channel = lastChannel
|
||||
}
|
||||
}
|
||||
|
||||
userstate := &mumbleproto.UserState{
|
||||
Session: proto.Uint32(client.Session),
|
||||
Name: proto.String(client.ShownName()),
|
||||
ChannelId: proto.Uint32(0),
|
||||
ChannelId: proto.Uint32(uint32(channel.Id)),
|
||||
}
|
||||
|
||||
if len(client.CertHash) > 0 {
|
||||
|
|
@ -601,7 +609,7 @@ func (server *Server) finishAuthenticate(client *Client) {
|
|||
}
|
||||
}
|
||||
|
||||
server.userEnterChannel(client, server.RootChannel(), userstate)
|
||||
server.userEnterChannel(client, channel, userstate)
|
||||
if err := server.broadcastProtoMessage(userstate); err != nil {
|
||||
// Server panic?
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue