mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #1941
KLINE'd clients would produce a QUIT snotice without a corresponding CONNECT snotice; explicitly suppress the QUIT snotice.
This commit is contained in:
parent
dea2e7961a
commit
077081076c
3 changed files with 14 additions and 2 deletions
|
|
@ -80,6 +80,7 @@ type Client struct {
|
|||
hostname string
|
||||
invitedTo map[string]channelInvite
|
||||
isSTSOnly bool
|
||||
isKlined bool // #1941: k-line kills are special-cased to suppress some triggered notices/events
|
||||
languages []string
|
||||
lastActive time.Time // last time they sent a command that wasn't PONG or similar
|
||||
lastSeen map[string]time.Time // maps device ID (including "") to time of last received command
|
||||
|
|
@ -1181,6 +1182,7 @@ func (client *Client) destroy(session *Session) {
|
|||
details := client.detailsNoMutex()
|
||||
sessionRemoved := false
|
||||
registered := client.registered
|
||||
isKlined := client.isKlined
|
||||
// XXX a temporary (reattaching) client can be marked alwaysOn when it logs in,
|
||||
// but then the session attaches to another client and we need to clean it up here
|
||||
alwaysOn := registered && client.alwaysOn
|
||||
|
|
@ -1341,8 +1343,10 @@ func (client *Client) destroy(session *Session) {
|
|||
}
|
||||
|
||||
if registered {
|
||||
client.server.snomasks.Send(sno.LocalQuits, fmt.Sprintf(ircfmt.Unescape("%s$r exited the network"), details.nick))
|
||||
client.server.logger.Info("quit", fmt.Sprintf("%s is no longer on the server", details.nick))
|
||||
if !isKlined {
|
||||
client.server.snomasks.Send(sno.LocalQuits, fmt.Sprintf(ircfmt.Unescape("%s$r exited the network"), details.nick))
|
||||
client.server.logger.Info("quit", fmt.Sprintf("%s is no longer on the server", details.nick))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue