|
@@ -600,7 +600,8 @@ func (client *Client) tryResumeChannels() {
|
600
|
600
|
|
601
|
601
|
func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.Item, complete bool) {
|
602
|
602
|
var batchID string
|
603
|
|
- nick := client.Nick()
|
|
603
|
+ details := client.Details()
|
|
604
|
+ nick := details.nick
|
604
|
605
|
if 0 < len(items) {
|
605
|
606
|
batchID = rb.StartNestedHistoryBatch(nick)
|
606
|
607
|
}
|
|
@@ -626,7 +627,14 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
|
626
|
627
|
if allowTags {
|
627
|
628
|
tags = item.Tags
|
628
|
629
|
}
|
629
|
|
- rb.AddSplitMessageFromClient(item.Nick, item.AccountName, tags, command, nick, item.Message)
|
|
630
|
+ if item.Params[0] == "" {
|
|
631
|
+ // this message was sent *to* the client from another nick
|
|
632
|
+ rb.AddSplitMessageFromClient(item.Nick, item.AccountName, tags, command, nick, item.Message)
|
|
633
|
+ } else {
|
|
634
|
+ // this message was sent *from* the client to another nick; the target is item.Params[0]
|
|
635
|
+ // substitute the client's current nickmask in case they changed nick
|
|
636
|
+ rb.AddSplitMessageFromClient(details.nickMask, item.AccountName, tags, command, item.Params[0], item.Message)
|
|
637
|
+ }
|
630
|
638
|
}
|
631
|
639
|
|
632
|
640
|
rb.EndNestedBatch(batchID)
|