(account api.Account)
| 203 | } |
| 204 | |
| 205 | func (i *Inbound) updateUser(account api.Account) { |
| 206 | i.mu.Lock() |
| 207 | defer i.mu.Unlock() |
| 208 | |
| 209 | if i.clients == nil { |
| 210 | i.clients = make(map[string]api.Account) |
| 211 | } |
| 212 | |
| 213 | email := account.GetEmail() |
| 214 | switch a := account.(type) { |
| 215 | case *api.VmessAccount: |
| 216 | i.clients[email] = a |
| 217 | |
| 218 | case *api.VlessAccount: |
| 219 | i.clients[email] = a |
| 220 | |
| 221 | case *api.TrojanAccount: |
| 222 | i.clients[email] = a |
| 223 | |
| 224 | case *api.ShadowsocksTcpAccount: |
| 225 | i.clients[email] = a |
| 226 | |
| 227 | case *api.ShadowsocksAccount: |
| 228 | method, ok := i.Settings["method"].(string) |
| 229 | if ok { |
| 230 | na := checkShadowsocks2022(method, *a) |
| 231 | i.clients[email] = &na |
| 232 | } else { |
| 233 | i.clients[email] = a |
| 234 | } |
| 235 | |
| 236 | case *api.HysteriaAccount: |
| 237 | i.clients[email] = a |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | func (i *Inbound) updateUsers(accounts []api.Account, removeEmails []string) { |
| 242 | i.mu.Lock() |
no test coverage detected