mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-11 06:29:29 +01:00
commit
9aeb80dbf3
@ -288,10 +288,11 @@ func csOpHandler(service *ircService, server *Server, client *Client, command st
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
channelName := channelInfo.Name()
|
channelName := channelInfo.Name()
|
||||||
|
founder := channelInfo.Founder()
|
||||||
|
|
||||||
clientAccount := client.Account()
|
clientAccount := client.Account()
|
||||||
if clientAccount == "" || clientAccount != channelInfo.Founder() {
|
if clientAccount == "" {
|
||||||
service.Notice(rb, client.t("Only the channel founder can do this"))
|
service.Notice(rb, client.t("You're not logged into an account"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,11 +307,26 @@ func csOpHandler(service *ircService, server *Server, client *Client, command st
|
|||||||
target = client
|
target = client
|
||||||
}
|
}
|
||||||
|
|
||||||
// give them privs
|
var givenMode modes.Mode
|
||||||
givenMode := modes.ChannelOperator
|
if target == client {
|
||||||
if clientAccount == target.Account() {
|
if clientAccount == founder {
|
||||||
givenMode = modes.ChannelFounder
|
givenMode = modes.ChannelFounder
|
||||||
|
} else {
|
||||||
|
givenMode = channelInfo.getAmode(clientAccount)
|
||||||
|
if givenMode == modes.Mode(0) {
|
||||||
|
service.Notice(rb, client.t("You don't have any stored privileges on that channel"))
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if clientAccount == founder {
|
||||||
|
givenMode = modes.ChannelOperator
|
||||||
|
} else {
|
||||||
|
service.Notice(rb, client.t("Only the channel founder can do this"))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
applied, change := channelInfo.applyModeToMember(client,
|
applied, change := channelInfo.applyModeToMember(client,
|
||||||
modes.ModeChange{Mode: givenMode,
|
modes.ModeChange{Mode: givenMode,
|
||||||
Op: modes.Add,
|
Op: modes.Add,
|
||||||
|
Loading…
Reference in New Issue
Block a user