Changeset 559 in code for trunk


Ignore:
Timestamp:
Jun 14, 2021, 7:44:38 PM (4 years ago)
Author:
contact
Message:

Add support for account-tag

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r555 r559  
    132132// require support from all upstreams to be enabled
    133133var needAllDownstreamCaps = map[string]string{
     134        "account-tag":   "",
    134135        "away-notify":   "",
    135136        "extended-join": "",
     
    376377                        case "time":
    377378                                supported = dc.caps["server-time"]
     379                        case "account":
     380                                supported = dc.caps["account"]
    378381                        }
    379382                        if !supported {
     
    19511954                        echoTags := tags.Copy()
    19521955                        echoTags["time"] = irc.TagValue(time.Now().UTC().Format(serverTimeLayout))
     1956                        if uc.account != "" {
     1957                                echoTags["account"] = irc.TagValue(uc.account)
     1958                        }
    19531959                        echoMsg := &irc.Message{
    19541960                                Tags: echoTags,
  • trunk/upstream.go

    r553 r559  
    2222// requested when supported.
    2323var permanentUpstreamCaps = map[string]bool{
     24        "account-tag":      true,
    2425        "away-notify":      true,
    2526        "batch":            true,
     
    9596        batches       map[string]batch
    9697        away          bool
     98        account       string
    9799        nextLabelID   uint64
    98100
     
    535537                })
    536538        case irc.RPL_LOGGEDIN:
    537                 var account string
    538                 if err := parseMessageParams(msg, nil, nil, &account); err != nil {
    539                         return err
    540                 }
    541                 uc.logger.Printf("logged in with account %q", account)
     539                if err := parseMessageParams(msg, nil, nil, &uc.account); err != nil {
     540                        return err
     541                }
     542                uc.logger.Printf("logged in with account %q", uc.account)
    542543        case irc.RPL_LOGGEDOUT:
     544                uc.account = ""
    543545                uc.logger.Printf("logged out")
    544546        case irc.ERR_NICKLOCKED, irc.RPL_SASLSUCCESS, irc.ERR_SASLFAIL, irc.ERR_SASLTOOLONG, irc.ERR_SASLABORTED:
Note: See TracChangeset for help on using the changeset viewer.