Revert "fix #2309"

This reverts commit 258af017d4.
This commit is contained in:
Shivaram Lingamneni 2025-12-15 22:52:15 -05:00
parent 258af017d4
commit 623735c757
3 changed files with 5 additions and 5 deletions

View file

@ -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.ExtendedMonitor, caps.ChgHost) {
for fClient := range client.FriendsMonitors(caps.ChgHost) {
fClient.sendFromClientInternal(false, time.Time{}, "", oldNickMask, details.accountName, isBot, nil, "CHGHOST", details.username, vhost)
}
}

View file

@ -114,7 +114,7 @@ func sendSuccessfulAccountAuth(service *ircService, client *Client, rb *Response
if client.Registered() {
// dispatch account-notify
for friend := range client.FriendsMonitors(caps.ExtendedMonitor, caps.AccountNotify) {
for friend := range client.FriendsMonitors(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.ExtendedMonitor, caps.AwayNotify) {
for session := range client.FriendsMonitors(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.ExtendedMonitor, caps.SetName)
friends := client.FriendsMonitors(caps.SetName)
delete(friends, rb.session)
isBot := client.HasMode(modes.Bot)
for session := range friends {

View file

@ -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.HasAll(capabs...) {
if session.capabilities.Has(caps.ExtendedMonitor) && session.capabilities.HasAll(capabs...) {
users.Add(session)
}
}