|
@@ -93,9 +93,7 @@ func (rb *ResponseBuffer) AddFromClient(time time.Time, msgid string, fromNickMa
|
93
|
93
|
msg.SetTag("msgid", msgid)
|
94
|
94
|
}
|
95
|
95
|
// attach server-time
|
96
|
|
- if rb.session.capabilities.Has(caps.ServerTime) && !msg.HasTag("time") {
|
97
|
|
- msg.SetTag("time", time.UTC().Format(IRCv3TimestampFormat))
|
98
|
|
- }
|
|
96
|
+ rb.session.setTimeTag(&msg, time)
|
99
|
97
|
|
100
|
98
|
rb.AddMessage(msg)
|
101
|
99
|
}
|
|
@@ -223,9 +221,7 @@ func (rb *ResponseBuffer) flushInternal(final bool, blocking bool) error {
|
223
|
221
|
// ACK message
|
224
|
222
|
message := ircmsg.MakeMessage(nil, rb.session.client.server.name, "ACK")
|
225
|
223
|
message.SetTag(caps.LabelTagName, rb.Label)
|
226
|
|
- if rb.session.capabilities.Has(caps.ServerTime) {
|
227
|
|
- message.SetTag("time", time.Now().UTC().Format(IRCv3TimestampFormat))
|
228
|
|
- }
|
|
224
|
+ rb.session.setTimeTag(&message, time.Time{})
|
229
|
225
|
rb.session.SendRawMessage(message, blocking)
|
230
|
226
|
} else if useLabel && len(rb.messages) == 1 && rb.batchID == "" && final {
|
231
|
227
|
// single labeled message
|
|
@@ -235,9 +231,7 @@ func (rb *ResponseBuffer) flushInternal(final bool, blocking bool) error {
|
235
|
231
|
// send each message out
|
236
|
232
|
for _, message := range rb.messages {
|
237
|
233
|
// attach server-time if needed
|
238
|
|
- if rb.session.capabilities.Has(caps.ServerTime) && !message.HasTag("time") {
|
239
|
|
- message.SetTag("time", time.Now().UTC().Format(IRCv3TimestampFormat))
|
240
|
|
- }
|
|
234
|
+ rb.session.setTimeTag(&message, time.Time{})
|
241
|
235
|
|
242
|
236
|
// attach batch ID, unless this message was part of a nested batch and is
|
243
|
237
|
// already tagged
|