forked from External/ergo
Merge pull request #1761 from delthas/feature-extended-monitor
Add support for extended-monitor
This commit is contained in:
commit
9b6ec04ca5
5 changed files with 36 additions and 5 deletions
|
|
@ -1025,6 +1025,13 @@ func (client *Client) Friends(capabs ...caps.Capability) (result map[*Session]em
|
|||
return
|
||||
}
|
||||
|
||||
// Friends refers to clients that share a channel or extended-monitor this client.
|
||||
func (client *Client) FriendsMonitors(capabs ...caps.Capability) (result map[*Session]empty) {
|
||||
result = client.Friends(capabs...)
|
||||
client.server.monitorManager.AddMonitors(result, client.nickCasefolded, capabs...)
|
||||
return
|
||||
}
|
||||
|
||||
// helper for Friends
|
||||
func addFriendsToSet(set map[*Session]empty, client *Client, capabs ...caps.Capability) {
|
||||
client.stateMutex.RLock()
|
||||
|
|
@ -1049,7 +1056,7 @@ func (client *Client) SetOper(oper *Oper) {
|
|||
func (client *Client) sendChghost(oldNickMask string, vhost string) {
|
||||
details := client.Details()
|
||||
isBot := client.HasMode(modes.Bot)
|
||||
for fClient := range client.Friends(caps.ChgHost) {
|
||||
for fClient := range client.FriendsMonitors(caps.ChgHost) {
|
||||
fClient.sendFromClientInternal(false, time.Time{}, "", oldNickMask, details.accountName, isBot, nil, "CHGHOST", details.username, vhost)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue