mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-22 20:09:41 +01:00
restore transition mechanism
This commit is contained in:
parent
6f8711da3b
commit
77184c1625
@ -122,6 +122,7 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||||||
accountName := client.accountName
|
accountName := client.accountName
|
||||||
settings := client.accountSettings
|
settings := client.accountSettings
|
||||||
registered := client.registered
|
registered := client.registered
|
||||||
|
realname := client.realname
|
||||||
client.stateMutex.RUnlock()
|
client.stateMutex.RUnlock()
|
||||||
|
|
||||||
// recompute always-on status, because client.alwaysOn is not set for unregistered clients
|
// recompute always-on status, because client.alwaysOn is not set for unregistered clients
|
||||||
@ -224,6 +225,10 @@ func (clients *ClientManager) SetNick(client *Client, session *Session, newNick
|
|||||||
client.server.stats.AddRegistered(invisible, operator)
|
client.server.stats.AddRegistered(invisible, operator)
|
||||||
}
|
}
|
||||||
session.autoreplayMissedSince = lastSeen
|
session.autoreplayMissedSince = lastSeen
|
||||||
|
// TODO: transition mechanism for #1065, clean this up eventually:
|
||||||
|
if currentClient.Realname() == "" {
|
||||||
|
currentClient.SetRealname(realname)
|
||||||
|
}
|
||||||
// successful reattach!
|
// successful reattach!
|
||||||
return newNick, nil, back
|
return newNick, nil, back
|
||||||
} else if currentClient == client && currentClient.Nick() == newNick {
|
} else if currentClient == client && currentClient.Nick() == newNick {
|
||||||
|
@ -430,6 +430,13 @@ func (client *Client) UpdateActive(session *Session) {
|
|||||||
session.lastActive = now
|
session.lastActive = now
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (client *Client) Realname() string {
|
||||||
|
client.stateMutex.RLock()
|
||||||
|
result := client.realname
|
||||||
|
client.stateMutex.RUnlock()
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
func (channel *Channel) Name() string {
|
func (channel *Channel) Name() string {
|
||||||
channel.stateMutex.RLock()
|
channel.stateMutex.RLock()
|
||||||
defer channel.stateMutex.RUnlock()
|
defer channel.stateMutex.RUnlock()
|
||||||
|
Loading…
Reference in New Issue
Block a user