mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-23 04:19:25 +01:00
commit
feb6a63e57
@ -1174,7 +1174,12 @@ func (am *AccountManager) Unregister(account string, erase bool) error {
|
||||
var channelsStr string
|
||||
keepProtections := false
|
||||
am.server.store.Update(func(tx *buntdb.Tx) error {
|
||||
// get the unfolded account name; for an active account, this is
|
||||
// stored under accountNameKey, for an unregistered account under unregisteredKey
|
||||
accountName, _ = tx.Get(accountNameKey)
|
||||
if accountName == "" {
|
||||
accountName, _ = tx.Get(unregisteredKey)
|
||||
}
|
||||
if erase {
|
||||
tx.Delete(unregisteredKey)
|
||||
} else {
|
||||
|
@ -841,6 +841,8 @@ func nsUnregisterHandler(server *Server, client *Client, command string, params
|
||||
if erase {
|
||||
// account may not be in a loadable state, e.g., if it was unregistered
|
||||
accountName = username
|
||||
// make the confirmation code nondeterministic for ERASE
|
||||
registeredAt = server.ctime
|
||||
} else {
|
||||
account, err := server.accounts.LoadAccount(username)
|
||||
if err == errAccountDoesNotExist {
|
||||
|
Loading…
Reference in New Issue
Block a user