Don't clear channel key on JOIN
Closes: https://todo.sr.ht/~emersion/soju/50
This commit is contained in:
parent
d9186e994d
commit
aa6f3a9954
@ -955,6 +955,11 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
||||
})
|
||||
|
||||
ch := &Channel{Name: upstreamName, Key: key, Detached: false}
|
||||
if current, ok := uc.network.channels[ch.Name]; ok && key == "" {
|
||||
// Don't clear the channel key if there's one set
|
||||
// TODO: add a way to unset the channel key
|
||||
ch.Key = current.Key
|
||||
}
|
||||
if err := uc.network.createUpdateChannel(ch); err != nil {
|
||||
dc.logger.Printf("failed to create or update channel %q: %v", upstreamName, err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user