瀏覽代碼

SAMODE +f shouldn't require channel privileges

Reported by @Mikaela; normally this requires +o or higher on the
channel that is the target of the forward, but SAMODE should bypass
this check.
tags/v2.8.0
Shivaram Lingamneni 2 年之前
父節點
當前提交
4bffdba610
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3
    3
      irc/modes.go

+ 3
- 3
irc/modes.go 查看文件

267
 				} else if ch == channel {
267
 				} else if ch == channel {
268
 					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, chname, string(change.Mode), utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("You can't forward a channel to itself")))
268
 					rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, chname, string(change.Mode), utils.SafeErrorParam(change.Arg), fmt.Sprintf(client.t("You can't forward a channel to itself")))
269
 				} else {
269
 				} else {
270
-					if !ch.ClientIsAtLeast(client, modes.ChannelOperator) {
271
-						rb.Add(nil, client.server.name, ERR_CHANOPRIVSNEEDED, details.nick, ch.Name(), client.t("You must be a channel operator in the channel you are forwarding to"))
272
-					} else {
270
+					if isSamode || ch.ClientIsAtLeast(client, modes.ChannelOperator) {
273
 						change.Arg = ch.Name()
271
 						change.Arg = ch.Name()
274
 						channel.setForward(change.Arg)
272
 						channel.setForward(change.Arg)
275
 						applied = append(applied, change)
273
 						applied = append(applied, change)
274
+					} else {
275
+						rb.Add(nil, client.server.name, ERR_CHANOPRIVSNEEDED, details.nick, ch.Name(), client.t("You must be a channel operator in the channel you are forwarding to"))
276
 					}
276
 					}
277
 				}
277
 				}
278
 			case modes.Remove:
278
 			case modes.Remove:

Loading…
取消
儲存