ソースを参照

fix #1876

INVITE did not exempt from +b unless the channel was coincidentally also +i.
This was a regression introduced in v2.4.0.
tags/v2.9.0-rc1
Shivaram Lingamneni 2年前
コミット
e15c355f18
1個のファイルの変更6行の追加2行の削除
  1. 6
    2
      irc/channel.go

+ 6
- 2
irc/channel.go ファイルの表示

@@ -1513,7 +1513,8 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
1513 1513
 	}
1514 1514
 
1515 1515
 	inviteOnly := channel.flags.HasMode(modes.InviteOnly)
1516
-	if inviteOnly && !channel.ClientIsAtLeast(inviter, modes.ChannelOperator) {
1516
+	hasPrivs := channel.ClientIsAtLeast(inviter, modes.ChannelOperator)
1517
+	if inviteOnly && !hasPrivs {
1517 1518
 		rb.Add(nil, inviter.server.name, ERR_CHANOPRIVSNEEDED, inviter.Nick(), chname, inviter.t("You're not a channel operator"))
1518 1519
 		return
1519 1520
 	}
@@ -1523,7 +1524,10 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
1523 1524
 		return
1524 1525
 	}
1525 1526
 
1526
-	if inviteOnly {
1527
+	// #1876: INVITE should override all join restrictions, including +b and +l,
1528
+	// not just +i. so we need to record it on a per-client basis iff the inviter
1529
+	// is privileged:
1530
+	if hasPrivs {
1527 1531
 		invitee.Invite(chcfname, createdAt)
1528 1532
 	}
1529 1533
 

読み込み中…
キャンセル
保存