1
0
Fork 0
forked from External/ergo

Merge pull request #1460 from slingamn/issue1449_invite_playback

fix #1449
This commit is contained in:
Shivaram Lingamneni 2020-12-14 23:43:27 -05:00 committed by GitHub
commit 5b79e427b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 27 additions and 21 deletions

View file

@ -1088,14 +1088,6 @@ func (channel *Channel) replayHistoryForResume(session *Session, after time.Time
rb.Send(true)
}
func stripMaskFromNick(nickMask string) (nick string) {
index := strings.Index(nickMask, "!")
if index == -1 {
return nickMask
}
return nickMask[0:index]
}
func (channel *Channel) replayHistoryItems(rb *ResponseBuffer, items []history.Item, autoreplay bool) {
// send an empty batch if necessary, as per the CHATHISTORY spec
chname := channel.Name()
@ -1118,7 +1110,7 @@ func (channel *Channel) replayHistoryItems(rb *ResponseBuffer, items []history.I
defer rb.EndNestedBatch(batchID)
for _, item := range items {
nick := stripMaskFromNick(item.Nick)
nick := NUHToNick(item.Nick)
switch item.Type {
case history.Privmsg:
rb.AddSplitMessageFromClient(item.Nick, item.AccountName, item.Tags, "PRIVMSG", chname, item.Message)
@ -1552,11 +1544,10 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
details := inviter.Details()
tDetails := invitee.Details()
tnick := invitee.Nick()
message := utils.MakeMessage("")
message := utils.MakeMessage(chname)
item := history.Item{
Type: history.Invite,
Message: message,
Params: [1]string{chname},
}
for _, member := range channel.Members() {