mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-19 20:11:59 +03:00
allow multiple components to display shared user menu
This commit is contained in:
@@ -330,13 +330,11 @@ Permission DiscordClient::ComputeOverwrites(Permission base, Snowflake member_id
|
||||
return perms;
|
||||
}
|
||||
|
||||
bool DiscordClient::CanManageMember(Snowflake channel_id, Snowflake actor, Snowflake target) const {
|
||||
const auto *channel = GetChannel(channel_id);
|
||||
if (channel == nullptr) return false;
|
||||
const auto *guild = GetGuild(channel->GuildID);
|
||||
bool DiscordClient::CanManageMember(Snowflake guild_id, Snowflake actor, Snowflake target) const {
|
||||
const auto *guild = GetGuild(guild_id);
|
||||
if (guild != nullptr && guild->OwnerID == target) return false;
|
||||
const auto actor_highest_id = GetMemberHighestRole(channel->GuildID, actor);
|
||||
const auto target_highest_id = GetMemberHighestRole(channel->GuildID, target);
|
||||
const auto actor_highest_id = GetMemberHighestRole(guild_id, actor);
|
||||
const auto target_highest_id = GetMemberHighestRole(guild_id, target);
|
||||
const auto *actor_highest = GetRole(actor_highest_id);
|
||||
const auto *target_highest = GetRole(target_highest_id);
|
||||
if (actor_highest == nullptr) return false;
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
bool HasChannelPermission(Snowflake user_id, Snowflake channel_id, Permission perm) const;
|
||||
Permission ComputePermissions(Snowflake member_id, Snowflake guild_id) const;
|
||||
Permission ComputeOverwrites(Permission base, Snowflake member_id, Snowflake channel_id) const;
|
||||
bool CanManageMember(Snowflake channel_id, Snowflake actor, Snowflake target) const; // kick, ban, edit nickname (cant think of a better name)
|
||||
bool CanManageMember(Snowflake guild_id, Snowflake actor, Snowflake target) const; // kick, ban, edit nickname (cant think of a better name)
|
||||
|
||||
void SendChatMessage(std::string content, Snowflake channel);
|
||||
void DeleteMessage(Snowflake channel_id, Snowflake id);
|
||||
|
||||
Reference in New Issue
Block a user