diff options
author | George Hazan <george.hazan@gmail.com> | 2024-05-04 13:36:17 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-05-04 13:36:17 +0300 |
commit | 083417981721437390d3ec9939a7595034287498 (patch) | |
tree | 94dfac111e027c6e5604bf195cf95dddc089bb5a /protocols/Discord/src/guilds.cpp | |
parent | 6df6c02d33c109e30fa438a50b57e5359d096cc4 (diff) |
Discord: we don't check permissions for folders
Diffstat (limited to 'protocols/Discord/src/guilds.cpp')
-rw-r--r-- | protocols/Discord/src/guilds.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp index bf8336be1b..67fb04928b 100644 --- a/protocols/Discord/src/guilds.cpp +++ b/protocols/Discord/src/guilds.cpp @@ -178,11 +178,6 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS CMStringW wszName = pch["name"].as_mstring();
CDiscordUser *pUser;
- // check permissions to enter the channel
- auto permissions = pGuild->CalcPermissionOverride(m_ownId, pch["permission_overwrites"]);
- if (!(permissions & Permission::VIEW_CHANNEL))
- return nullptr;
-
// filter our all channels but the text ones
switch (pch["type"].as_int()) {
case 4: // channel group
@@ -206,6 +201,11 @@ CDiscordUser* CDiscordProto::ProcessGuildChannel(CDiscordGuild *pGuild, const JS return pUser;
case 0: // text channel
+ // check permissions to enter the channel
+ auto permissions = pGuild->CalcPermissionOverride(m_ownId, pch["permission_overwrites"]);
+ if (!(permissions & Permission::VIEW_CHANNEL))
+ return nullptr;
+
pUser = FindUserByChannel(channelId);
if (pUser == nullptr) {
// missing channel - create it
|