mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Merge pull request #1415 from slingamn/issue1409_invite_history.1
fix #1409
This commit is contained in:
commit
5edfcced0a
4 changed files with 60 additions and 32 deletions
|
|
@ -2143,37 +2143,20 @@ func dispatchMessageToTarget(client *Client, tags map[string]string, histType hi
|
|||
}
|
||||
}
|
||||
|
||||
if !allowedPlusR {
|
||||
return
|
||||
}
|
||||
|
||||
config := server.Config()
|
||||
if !config.History.Enabled {
|
||||
return
|
||||
}
|
||||
item := history.Item{
|
||||
Type: histType,
|
||||
Message: message,
|
||||
Nick: nickMaskString,
|
||||
AccountName: accountName,
|
||||
Tags: tags,
|
||||
}
|
||||
if !itemIsStorable(&item, config) || !allowedPlusR {
|
||||
return
|
||||
}
|
||||
targetedItem := item
|
||||
targetedItem.Params[0] = tnick
|
||||
cStatus, _ := client.historyStatus(config)
|
||||
tStatus, _ := user.historyStatus(config)
|
||||
// add to ephemeral history
|
||||
if cStatus == HistoryEphemeral {
|
||||
targetedItem.CfCorrespondent = tDetails.nickCasefolded
|
||||
client.history.Add(targetedItem)
|
||||
}
|
||||
if tStatus == HistoryEphemeral && client != user {
|
||||
item.CfCorrespondent = details.nickCasefolded
|
||||
user.history.Add(item)
|
||||
}
|
||||
if cStatus == HistoryPersistent || tStatus == HistoryPersistent {
|
||||
targetedItem.CfCorrespondent = ""
|
||||
server.historyDB.AddDirectMessage(details.nickCasefolded, details.account, tDetails.nickCasefolded, tDetails.account, targetedItem)
|
||||
Type: histType,
|
||||
Message: message,
|
||||
Tags: tags,
|
||||
}
|
||||
client.addHistoryItem(user, item, &details, &tDetails, config)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue