Log TOPIC messages

See [1].

[1]: 82c4ad8362/modules/log.cpp (L486)
This commit is contained in:
Simon Ser 2020-04-06 18:49:39 +02:00
parent c985b88559
commit 78b123be72
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
2 changed files with 7 additions and 0 deletions

View file

@ -100,6 +100,12 @@ func formatMessage(msg *irc.Message) string {
reason = msg.Params[0]
}
return fmt.Sprintf("*** Quits: %s (%s@%s) (%s)", msg.Prefix.Name, msg.Prefix.User, msg.Prefix.Host, reason)
case "TOPIC":
var topic string
if len(msg.Params) > 1 {
topic = msg.Params[1]
}
return fmt.Sprintf("*** %s changes topic to '%s'", msg.Prefix.Name, topic)
case "MODE":
return fmt.Sprintf("*** %s sets mode: %s", msg.Prefix.Name, strings.Join(msg.Params[1:], " "))
case "NOTICE":

View file

@ -745,6 +745,7 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error {
} else {
ch.Topic = ""
}
uc.appendLog(ch.Name, msg)
uc.forEachDownstream(func(dc *downstreamConn) {
params := []string{dc.marshalChannel(uc, name)}
if ch.Topic != "" {