Merge pull request #1761 from delthas/feature-extended-monitor

Add support for extended-monitor
This commit is contained in:
Shivaram Lingamneni 2021-08-26 10:14:31 -04:00 committed by GitHub
commit 9b6ec04ca5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 36 additions and 5 deletions

View file

@ -109,7 +109,7 @@ func sendSuccessfulAccountAuth(service *ircService, client *Client, rb *Response
if client.Registered() {
// dispatch account-notify
for friend := range client.Friends(caps.AccountNotify) {
for friend := range client.FriendsMonitors(caps.AccountNotify) {
if friend != rb.session {
friend.Send(nil, details.nickMask, "ACCOUNT", details.accountName)
}
@ -421,7 +421,7 @@ func dispatchAwayNotify(client *Client, isAway bool, awayMessage string) {
// dispatch away-notify
details := client.Details()
isBot := client.HasMode(modes.Bot)
for session := range client.Friends(caps.AwayNotify) {
for session := range client.FriendsMonitors(caps.AwayNotify) {
if isAway {
session.sendFromClientInternal(false, time.Time{}, "", details.nickMask, details.accountName, isBot, nil, "AWAY", awayMessage)
} else {
@ -2926,7 +2926,7 @@ func setnameHandler(server *Server, client *Client, msg ircmsg.Message, rb *Resp
// alert friends
now := time.Now().UTC()
friends := client.Friends(caps.SetName)
friends := client.FriendsMonitors(caps.SetName)
delete(friends, rb.session)
isBot := client.HasMode(modes.Bot)
for session := range friends {