mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-23 19:22:41 +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,13 +541,11 @@ func csTransferHandler(service *ircService, server *Server, client *Client, comm
|
|||||||
chname = regInfo.Name
|
chname = regInfo.Name
|
||||||
account := client.Account()
|
account := client.Account()
|
||||||
isFounder := account != "" && account == regInfo.Founder
|
isFounder := account != "" && account == regInfo.Founder
|
||||||
var oper *Oper
|
oper := client.Oper()
|
||||||
if !isFounder {
|
hasPrivs := oper.HasRoleCapab("chanreg")
|
||||||
oper = client.Oper()
|
if !isFounder && !hasPrivs {
|
||||||
if !oper.HasRoleCapab("chanreg") {
|
service.Notice(rb, client.t("Insufficient privileges"))
|
||||||
service.Notice(rb, client.t("Insufficient privileges"))
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
target := params[1]
|
target := params[1]
|
||||||
targetAccount, err := server.accounts.LoadAccount(params[1])
|
targetAccount, err := server.accounts.LoadAccount(params[1])
|
||||||
@ -569,7 +567,7 @@ func csTransferHandler(service *ircService, server *Server, client *Client, comm
|
|||||||
server.snomasks.Send(sno.LocalOpers, message)
|
server.snomasks.Send(sno.LocalOpers, message)
|
||||||
server.logger.Info("opers", message)
|
server.logger.Info("opers", message)
|
||||||
}
|
}
|
||||||
status, err := channel.Transfer(client, target, oper != nil)
|
status, err := channel.Transfer(client, target, hasPrivs)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
switch status {
|
switch status {
|
||||||
case channelTransferComplete:
|
case channelTransferComplete:
|
||||||
|
@ -1080,6 +1080,9 @@ func schemaChangeV21To22(config *Config, tx *buntdb.Tx) error {
|
|||||||
if !strings.HasPrefix(key, settingsPrefix) {
|
if !strings.HasPrefix(key, settingsPrefix) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
if value == "" {
|
||||||
|
return true
|
||||||
|
}
|
||||||
account := strings.TrimPrefix(key, settingsPrefix)
|
account := strings.TrimPrefix(key, settingsPrefix)
|
||||||
if _, err := tx.Get("account.verified " + account); err != nil {
|
if _, err := tx.Get("account.verified " + account); err != nil {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user