Changeset 649 in code


Ignore:
Timestamp:
Oct 17, 2021, 7:54:18 PM (4 years ago)
Author:
contact
Message:

Unify away-notify and account-notify handling

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r648 r649  
    411411                return
    412412        }
     413        if msg.Command == "AWAY" && !dc.caps["away-notify"] {
     414                // TODO: we can send AWAY if we just sent a PRIVMSG/NOTICE to this user
     415                return
     416        }
    413417        if msg.Command == "ACCOUNT" && !dc.caps["account-notify"] {
    414418                return
  • trunk/upstream.go

    r648 r649  
    13721372                        })
    13731373                })
    1374         case "AWAY":
    1375                 if msg.Prefix == nil {
    1376                         return fmt.Errorf("expected a prefix")
    1377                 }
    1378 
    1379                 uc.forEachDownstream(func(dc *downstreamConn) {
    1380                         if !dc.caps["away-notify"] {
    1381                                 return
    1382                         }
    1383                         dc.SendMessage(&irc.Message{
    1384                                 Prefix:  dc.marshalUserPrefix(uc.network, msg.Prefix),
    1385                                 Command: "AWAY",
    1386                                 Params:  msg.Params,
    1387                         })
    1388                 })
    1389         case "ACCOUNT":
     1374        case "AWAY", "ACCOUNT":
    13901375                if msg.Prefix == nil {
    13911376                        return fmt.Errorf("expected a prefix")
Note: See TracChangeset for help on using the changeset viewer.