summaryrefslogtreecommitdiff
path: root/discord/channel.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2020-09-24 02:43:27 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2020-09-24 02:43:27 -0400
commita8630f53b1b391cd2851955aa7585c53a996edd6 (patch)
treeaa234ed30936e34bba962c0a1af9530c39d2fbb4 /discord/channel.cpp
parent83417819186394e8d840167841103211ebe5fe33 (diff)
downloadabaddon-portaudio-a8630f53b1b391cd2851955aa7585c53a996edd6.tar.gz
abaddon-portaudio-a8630f53b1b391cd2851955aa7585c53a996edd6.zip
put PermissionOverwrite in the store where it belongs
Diffstat (limited to 'discord/channel.cpp')
-rw-r--r--discord/channel.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/discord/channel.cpp b/discord/channel.cpp
index 482d731..d104337 100644
--- a/discord/channel.cpp
+++ b/discord/channel.cpp
@@ -1,3 +1,4 @@
+#include "../abaddon.hpp"
#include "channel.hpp"
void from_json(const nlohmann::json &j, Channel &m) {
@@ -21,9 +22,6 @@ void from_json(const nlohmann::json &j, Channel &m) {
JS_ON("last_pin_timestamp", m.LastPinTimestamp);
}
-std::optional<PermissionOverwrite> Channel::GetOverwrite(Snowflake id) const {
- auto ret = std::find_if(PermissionOverwrites.begin(), PermissionOverwrites.end(), [id](const auto x) { return x.ID == id; });
- if (ret != PermissionOverwrites.end())
- return *ret;
- return std::nullopt;
+const PermissionOverwrite *Channel::GetOverwrite(Snowflake id) const {
+ return Abaddon::Get().GetDiscordClient().GetPermissionOverwrite(ID, id);
}