Changeset 729 in code for trunk/downstream.go
- Timestamp:
- Nov 30, 2021, 11:02:54 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r727 r729 1080 1080 } 1081 1081 1082 if uc := dc.upstream(); uc != nil && uc.caps["draft/account-registration"] { 1083 // Strip "before-connect", because we require downstreams to be fully 1084 // connected before attempting account registration. 1085 values := strings.Split(uc.supportedCaps["draft/account-registration"], ",") 1086 for i, v := range values { 1087 if v == "before-connect" { 1088 values = append(values[:i], values[i+1:]...) 1089 break 1090 } 1091 } 1092 dc.setSupportedCap("draft/account-registration", strings.Join(values, ",")) 1093 } else { 1094 dc.unsetSupportedCap("draft/account-registration") 1095 } 1096 1082 1097 if _, ok := dc.user.msgStore.(chatHistoryMessageStore); ok && dc.network != nil { 1083 1098 dc.setSupportedCap("draft/event-playback", "") … … 2409 2424 if uc == nil || !uc.caps["sasl"] { 2410 2425 return ircError{&irc.Message{ 2411 Prefix: dc.srv.prefix(),2412 2426 Command: irc.ERR_SASLFAIL, 2413 2427 Params: []string{dc.nick, "Upstream network authentication not supported"}, … … 2437 2451 }) 2438 2452 } 2453 case "REGISTER", "VERIFY": 2454 // Check number of params here, since we'll use that to save the 2455 // credentials on command success 2456 if (msg.Command == "REGISTER" && len(msg.Params) < 3) || (msg.Command == "VERIFY" && len(msg.Params) < 2) { 2457 return newNeedMoreParamsError(msg.Command) 2458 } 2459 2460 uc := dc.upstream() 2461 if uc == nil || !uc.caps["draft/account-registration"] { 2462 return ircError{&irc.Message{ 2463 Command: "FAIL", 2464 Params: []string{msg.Command, "TEMPORARILY_UNAVAILABLE", "*", "Upstream network account registration not supported"}, 2465 }} 2466 } 2467 2468 uc.logger.Printf("starting %v with account name %v", msg.Command, msg.Params[0]) 2469 uc.enqueueCommand(dc, msg) 2439 2470 case "MONITOR": 2440 2471 // MONITOR is unsupported in multi-upstream mode
Note:
See TracChangeset
for help on using the changeset viewer.