mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 11:12:44 +01:00
Merge pull request #1812 from slingamn/cstransfer
fix case where CS TRANSFER as an operator required acceptance
This commit is contained in:
commit
d488cf7f57
@ -541,14 +541,12 @@ func csTransferHandler(service *ircService, server *Server, client *Client, comm
|
||||
chname = regInfo.Name
|
||||
account := client.Account()
|
||||
isFounder := account != "" && account == regInfo.Founder
|
||||
var oper *Oper
|
||||
if !isFounder {
|
||||
oper = client.Oper()
|
||||
if !oper.HasRoleCapab("chanreg") {
|
||||
oper := client.Oper()
|
||||
hasPrivs := oper.HasRoleCapab("chanreg")
|
||||
if !isFounder && !hasPrivs {
|
||||
service.Notice(rb, client.t("Insufficient privileges"))
|
||||
return
|
||||
}
|
||||
}
|
||||
target := params[1]
|
||||
targetAccount, err := server.accounts.LoadAccount(params[1])
|
||||
if err != nil {
|
||||
@ -569,7 +567,7 @@ func csTransferHandler(service *ircService, server *Server, client *Client, comm
|
||||
server.snomasks.Send(sno.LocalOpers, message)
|
||||
server.logger.Info("opers", message)
|
||||
}
|
||||
status, err := channel.Transfer(client, target, oper != nil)
|
||||
status, err := channel.Transfer(client, target, hasPrivs)
|
||||
if err == nil {
|
||||
switch status {
|
||||
case channelTransferComplete:
|
||||
|
@ -1080,6 +1080,9 @@ func schemaChangeV21To22(config *Config, tx *buntdb.Tx) error {
|
||||
if !strings.HasPrefix(key, settingsPrefix) {
|
||||
return false
|
||||
}
|
||||
if value == "" {
|
||||
return true
|
||||
}
|
||||
account := strings.TrimPrefix(key, settingsPrefix)
|
||||
if _, err := tx.Get("account.verified " + account); err != nil {
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user