mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-06 18:11:59 +00:00
Fix bug in permission resolution when dealing with timed out members
This would lead to timed out members having the read_messages permission set to True instead of False
This commit is contained in:
parent
3dddddc8f9
commit
77baa06a99
@ -732,12 +732,6 @@ class GuildChannel:
|
|||||||
if base.administrator:
|
if base.administrator:
|
||||||
return Permissions.all()
|
return Permissions.all()
|
||||||
|
|
||||||
if obj.is_timed_out():
|
|
||||||
# Timeout leads to every permission except VIEW_CHANNEL and READ_MESSAGE_HISTORY
|
|
||||||
# being explicitly denied
|
|
||||||
base.value &= Permissions._timeout_mask()
|
|
||||||
return base
|
|
||||||
|
|
||||||
# Apply @everyone allow/deny first since it's special
|
# Apply @everyone allow/deny first since it's special
|
||||||
try:
|
try:
|
||||||
maybe_everyone = self._overwrites[0]
|
maybe_everyone = self._overwrites[0]
|
||||||
@ -779,6 +773,12 @@ class GuildChannel:
|
|||||||
denied = Permissions.all_channel()
|
denied = Permissions.all_channel()
|
||||||
base.value &= ~denied.value
|
base.value &= ~denied.value
|
||||||
|
|
||||||
|
if obj.is_timed_out():
|
||||||
|
# Timeout leads to every permission except VIEW_CHANNEL and READ_MESSAGE_HISTORY
|
||||||
|
# being explicitly denied
|
||||||
|
# N.B.: This *must* come last, because it's a conclusive mask
|
||||||
|
base.value &= Permissions._timeout_mask()
|
||||||
|
|
||||||
return base
|
return base
|
||||||
|
|
||||||
async def delete(self, *, reason: Optional[str] = None) -> None:
|
async def delete(self, *, reason: Optional[str] = None) -> None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user