Skip to content

Commit 4ced4ef

Browse files
authored
Merge pull request #2219 from slingamn/quit_tags
fix #2218
2 parents 7e18362 + ec3417b commit 4ced4ef

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

irc/client.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1187,12 +1187,18 @@ func (client *Client) LoggedIntoAccount() bool {
11871187
// (You must ensure separately that destroy() is called, e.g., by returning `true` from
11881188
// the command handler or calling it yourself.)
11891189
func (client *Client) Quit(message string, session *Session) {
1190+
nuh := client.NickMaskString()
1191+
now := time.Now().UTC()
1192+
11901193
setFinalData := func(sess *Session) {
11911194
message := sess.quitMessage
11921195
var finalData []byte
11931196
// #364: don't send QUIT lines to unregistered clients
11941197
if client.registered {
1195-
quitMsg := ircmsg.MakeMessage(nil, client.nickMaskString, "QUIT", message)
1198+
quitMsg := ircmsg.MakeMessage(nil, nuh, "QUIT", message)
1199+
if session.capabilities.Has(caps.ServerTime) {
1200+
quitMsg.SetTag("time", now.Format(utils.IRCv3TimestampFormat))
1201+
}
11961202
finalData, _ = quitMsg.LineBytesStrict(false, MaxLineLen)
11971203
}
11981204

0 commit comments

Comments
 (0)