mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
fix #2309
If bob is monitoring alice, bob should get METADATA lines for alice even if bob doesn't have extended-monitor. The four caps that explicitly require extended-monitor are: away-notify, chghost, setname, account-notify.
This commit is contained in:
parent
d5fb189a55
commit
258af017d4
3 changed files with 5 additions and 5 deletions
|
|
@ -1121,7 +1121,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.FriendsMonitors(caps.ChgHost) {
|
||||
for fClient := range client.FriendsMonitors(caps.ExtendedMonitor, caps.ChgHost) {
|
||||
fClient.sendFromClientInternal(false, time.Time{}, "", oldNickMask, details.accountName, isBot, nil, "CHGHOST", details.username, vhost)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ func sendSuccessfulAccountAuth(service *ircService, client *Client, rb *Response
|
|||
|
||||
if client.Registered() {
|
||||
// dispatch account-notify
|
||||
for friend := range client.FriendsMonitors(caps.AccountNotify) {
|
||||
for friend := range client.FriendsMonitors(caps.ExtendedMonitor, caps.AccountNotify) {
|
||||
if friend != rb.session {
|
||||
friend.Send(nil, details.nickMask, "ACCOUNT", details.accountName)
|
||||
}
|
||||
|
|
@ -531,7 +531,7 @@ func dispatchAwayNotify(client *Client, awayMessage string) {
|
|||
// dispatch away-notify
|
||||
details := client.Details()
|
||||
isBot := client.HasMode(modes.Bot)
|
||||
for session := range client.FriendsMonitors(caps.AwayNotify) {
|
||||
for session := range client.FriendsMonitors(caps.ExtendedMonitor, caps.AwayNotify) {
|
||||
if awayMessage != "" {
|
||||
session.sendFromClientInternal(false, time.Time{}, "", details.nickMask, details.accountName, isBot, nil, "AWAY", awayMessage)
|
||||
} else {
|
||||
|
|
@ -3650,7 +3650,7 @@ func setnameHandler(server *Server, client *Client, msg ircmsg.Message, rb *Resp
|
|||
|
||||
// alert friends
|
||||
now := time.Now().UTC()
|
||||
friends := client.FriendsMonitors(caps.SetName)
|
||||
friends := client.FriendsMonitors(caps.ExtendedMonitor, caps.SetName)
|
||||
delete(friends, rb.session)
|
||||
isBot := client.HasMode(modes.Bot)
|
||||
for session := range friends {
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ func (manager *MonitorManager) AddMonitors(users utils.HashSet[*Session], cfnick
|
|||
manager.RLock()
|
||||
defer manager.RUnlock()
|
||||
for session := range manager.watchedby[cfnick] {
|
||||
if session.capabilities.Has(caps.ExtendedMonitor) && session.capabilities.HasAll(capabs...) {
|
||||
if session.capabilities.HasAll(capabs...) {
|
||||
users.Add(session)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue