mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #2113
Persisting always-on clients was panicking if client X believed it was a member of channel Y, but channel Y didn't have a record of client X.
This commit is contained in:
parent
a4d160b76d
commit
4aa1aa371d
2 changed files with 10 additions and 3 deletions
|
|
@ -545,11 +545,14 @@ func (channel *Channel) ClientStatus(client *Client) (present bool, joinTimeSecs
|
|||
|
||||
// helper for persisting channel-user modes for always-on clients;
|
||||
// return the channel name and all channel-user modes for a client
|
||||
func (channel *Channel) alwaysOnStatus(client *Client) (chname string, status alwaysOnChannelStatus) {
|
||||
func (channel *Channel) alwaysOnStatus(client *Client) (ok bool, chname string, status alwaysOnChannelStatus) {
|
||||
channel.stateMutex.RLock()
|
||||
defer channel.stateMutex.RUnlock()
|
||||
chname = channel.name
|
||||
data := channel.members[client]
|
||||
data, ok := channel.members[client]
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
status.Modes = data.modes.String()
|
||||
status.JoinTime = data.joinTime
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue