mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
fix #487
This commit is contained in:
parent
9930d9bfa2
commit
25974b6881
@ -600,7 +600,8 @@ func (client *Client) tryResumeChannels() {
|
|||||||
|
|
||||||
func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.Item, complete bool) {
|
func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.Item, complete bool) {
|
||||||
var batchID string
|
var batchID string
|
||||||
nick := client.Nick()
|
details := client.Details()
|
||||||
|
nick := details.nick
|
||||||
if 0 < len(items) {
|
if 0 < len(items) {
|
||||||
batchID = rb.StartNestedHistoryBatch(nick)
|
batchID = rb.StartNestedHistoryBatch(nick)
|
||||||
}
|
}
|
||||||
@ -626,7 +627,14 @@ func (client *Client) replayPrivmsgHistory(rb *ResponseBuffer, items []history.I
|
|||||||
if allowTags {
|
if allowTags {
|
||||||
tags = item.Tags
|
tags = item.Tags
|
||||||
}
|
}
|
||||||
|
if item.Params[0] == "" {
|
||||||
|
// this message was sent *to* the client from another nick
|
||||||
rb.AddSplitMessageFromClient(item.Nick, item.AccountName, tags, command, nick, item.Message)
|
rb.AddSplitMessageFromClient(item.Nick, item.AccountName, tags, command, nick, item.Message)
|
||||||
|
} else {
|
||||||
|
// this message was sent *from* the client to another nick; the target is item.Params[0]
|
||||||
|
// substitute the client's current nickmask in case they changed nick
|
||||||
|
rb.AddSplitMessageFromClient(details.nickMask, item.AccountName, tags, command, item.Params[0], item.Message)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rb.EndNestedBatch(batchID)
|
rb.EndNestedBatch(batchID)
|
||||||
|
@ -2060,12 +2060,17 @@ func messageHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *R
|
|||||||
rb.Add(nil, server.name, RPL_AWAY, cnick, tnick, user.AwayMessage())
|
rb.Add(nil, server.name, RPL_AWAY, cnick, tnick, user.AwayMessage())
|
||||||
}
|
}
|
||||||
|
|
||||||
user.history.Add(history.Item{
|
item := history.Item{
|
||||||
Type: histType,
|
Type: histType,
|
||||||
Message: splitMsg,
|
Message: splitMsg,
|
||||||
Nick: nickMaskString,
|
Nick: nickMaskString,
|
||||||
AccountName: accountName,
|
AccountName: accountName,
|
||||||
})
|
}
|
||||||
|
// add to the target's history:
|
||||||
|
user.history.Add(item)
|
||||||
|
// add this to the client's history as well, recording the target:
|
||||||
|
item.Params[0] = tnick
|
||||||
|
client.history.Add(item)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user