mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Merge pull request #1460 from slingamn/issue1449_invite_playback
fix #1449
This commit is contained in:
commit
5b79e427b5
4 changed files with 27 additions and 21 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue