mirror of
https://github.com/ergochat/ergo.git
synced 2025-02-16 21:50:39 +01:00
commit
8b74cd1fd3
@ -1513,7 +1513,8 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
|
|||||||
}
|
}
|
||||||
|
|
||||||
inviteOnly := channel.flags.HasMode(modes.InviteOnly)
|
inviteOnly := channel.flags.HasMode(modes.InviteOnly)
|
||||||
if inviteOnly && !channel.ClientIsAtLeast(inviter, modes.ChannelOperator) {
|
hasPrivs := channel.ClientIsAtLeast(inviter, modes.ChannelOperator)
|
||||||
|
if inviteOnly && !hasPrivs {
|
||||||
rb.Add(nil, inviter.server.name, ERR_CHANOPRIVSNEEDED, inviter.Nick(), chname, inviter.t("You're not a channel operator"))
|
rb.Add(nil, inviter.server.name, ERR_CHANOPRIVSNEEDED, inviter.Nick(), chname, inviter.t("You're not a channel operator"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -1523,7 +1524,10 @@ func (channel *Channel) Invite(invitee *Client, inviter *Client, rb *ResponseBuf
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if inviteOnly {
|
// #1876: INVITE should override all join restrictions, including +b and +l,
|
||||||
|
// not just +i. so we need to record it on a per-client basis iff the inviter
|
||||||
|
// is privileged:
|
||||||
|
if hasPrivs {
|
||||||
invitee.Invite(chcfname, createdAt)
|
invitee.Invite(chcfname, createdAt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user