Changeset 100 in code for trunk/downstream.go
- Timestamp:
- Mar 16, 2020, 8:32:18 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r98 r100 62 62 closed chan struct{} 63 63 64 registered bool 65 user *user 66 nick string 67 username string 68 realname string 69 password string // empty after authentication 70 network *network // can be nil 64 registered bool 65 user *user 66 nick string 67 username string 68 rawUsername string 69 realname string 70 password string // empty after authentication 71 network *network // can be nil 71 72 } 72 73 … … 324 325 return err 325 326 } 326 dc. username = "~" +username327 dc.rawUsername = username 327 328 case "PASS": 328 329 if err := parseMessageParams(msg, &dc.password); err != nil { … … 333 334 return newUnknownCommandError(msg.Command) 334 335 } 335 if dc. username != "" && dc.nick != "" {336 if dc.rawUsername != "" && dc.nick != "" { 336 337 return dc.register() 337 338 } … … 349 350 350 351 func (dc *downstreamConn) register() error { 351 username := strings.TrimPrefix(dc.username, "~")352 username := dc.rawUsername 352 353 var networkName string 353 354 if i := strings.LastIndexAny(username, "/@"); i >= 0 { … … 357 358 username = username[:i] 358 359 } 360 dc.username = "~" + username 359 361 360 362 password := dc.password
Note:
See TracChangeset
for help on using the changeset viewer.