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] reason = msg.Params[0]
} }
return fmt.Sprintf("*** Quits: %s (%s@%s) (%s)", msg.Prefix.Name, msg.Prefix.User, msg.Prefix.Host, reason) 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": case "MODE":
return fmt.Sprintf("*** %s sets mode: %s", msg.Prefix.Name, strings.Join(msg.Params[1:], " ")) return fmt.Sprintf("*** %s sets mode: %s", msg.Prefix.Name, strings.Join(msg.Params[1:], " "))
case "NOTICE": case "NOTICE":

View File

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