|
@@ -850,7 +850,7 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
|
850
|
850
|
if target == "" {
|
851
|
851
|
target = nick
|
852
|
852
|
}
|
853
|
|
- batchID = rb.StartNestedHistoryBatch(target)
|
|
853
|
+ batchID = rb.StartNestedBatch(target, "chathistory")
|
854
|
854
|
|
855
|
855
|
isSelfMessage := func(item *history.Item) bool {
|
856
|
856
|
// XXX: Params[0] is the message target. if the source of this message is an in-memory
|
|
@@ -1425,27 +1425,27 @@ func composeMultilineBatch(batchID, fromNickMask, fromAccount string, isBot bool
|
1425
|
1425
|
}
|
1426
|
1426
|
|
1427
|
1427
|
var (
|
1428
|
|
- // these are all the output commands that MUST have their last param be a trailing.
|
1429
|
|
- // this is needed because dumb clients like to treat trailing params separately from the
|
1430
|
|
- // other params in messages.
|
1431
|
|
- commandsThatMustUseTrailing = map[string]bool{
|
1432
|
|
- "PRIVMSG": true,
|
1433
|
|
- "NOTICE": true,
|
1434
|
|
-
|
1435
|
|
- RPL_WHOISCHANNELS: true,
|
1436
|
|
- RPL_USERHOST: true,
|
1437
|
|
-
|
|
1428
|
+ // in practice, many clients require that the final parameter be a trailing
|
|
1429
|
+ // (prefixed with `:`) even when this is not syntactically necessary.
|
|
1430
|
+ // by default, force the following commands to use a trailing:
|
|
1431
|
+ commandsThatMustUseTrailing = utils.SetLiteral(
|
|
1432
|
+ "PRIVMSG",
|
|
1433
|
+ "NOTICE",
|
|
1434
|
+ RPL_WHOISCHANNELS,
|
|
1435
|
+ RPL_USERHOST,
|
1438
|
1436
|
// mirc's handling of RPL_NAMREPLY is broken:
|
1439
|
1437
|
// https://forums.mirc.com/ubbthreads.php/topics/266939/re-nick-list
|
1440
|
|
- RPL_NAMREPLY: true,
|
1441
|
|
- }
|
|
1438
|
+ RPL_NAMREPLY,
|
|
1439
|
+ )
|
1442
|
1440
|
)
|
1443
|
1441
|
|
|
1442
|
+func forceTrailing(config *Config, command string) bool {
|
|
1443
|
+ return config.Server.Compatibility.forceTrailing && commandsThatMustUseTrailing.Has(command)
|
|
1444
|
+}
|
|
1445
|
+
|
1444
|
1446
|
// SendRawMessage sends a raw message to the client.
|
1445
|
1447
|
func (session *Session) SendRawMessage(message ircmsg.Message, blocking bool) error {
|
1446
|
|
- // use dumb hack to force the last param to be a trailing param if required
|
1447
|
|
- config := session.client.server.Config()
|
1448
|
|
- if config.Server.Compatibility.forceTrailing && commandsThatMustUseTrailing[message.Command] {
|
|
1448
|
+ if forceTrailing(session.client.server.Config(), message.Command) {
|
1449
|
1449
|
message.ForceTrailing()
|
1450
|
1450
|
}
|
1451
|
1451
|
|