diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-21 23:49:42 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-21 23:49:42 -0500 |
commit | 547124c94f8808d6dca407af7b6eb0d29ac12e45 (patch) | |
tree | ef79ad6ee56c6e4e294f5b946803558b592bbe59 /components | |
parent | 7b6fb861acc395a913180d8e8d2d3d503a1cf2fc (diff) | |
download | abaddon-portaudio-547124c94f8808d6dca407af7b6eb0d29ac12e45.tar.gz abaddon-portaudio-547124c94f8808d6dca407af7b6eb0d29ac12e45.zip |
view and delete invites, more tweaking
Diffstat (limited to 'components')
-rw-r--r-- | components/completer.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/components/completer.cpp b/components/completer.cpp index f07bee6..26d5cf2 100644 --- a/components/completer.cpp +++ b/components/completer.cpp @@ -178,15 +178,17 @@ void Completer::CompleteEmojis(const Glib::ustring &term) { }; int i = 0; - for (const auto tmp : guild->Emojis) { - const auto emoji = discord.GetEmoji(tmp.ID); - if (!emoji.has_value()) continue; - if (emoji->IsAnimated.has_value() && *emoji->IsAnimated) continue; - if (term.size() > 0) - if (!StringContainsCaseless(emoji->Name, term)) continue; - if (i++ > MaxCompleterEntries) break; - - const auto entry = make_entry(emoji->Name, "<:" + emoji->Name + ":" + std::to_string(emoji->ID) + ">", emoji->GetURL()); + if (guild->Emojis.has_value()) { + for (const auto tmp : *guild->Emojis) { + const auto emoji = discord.GetEmoji(tmp.ID); + if (!emoji.has_value()) continue; + if (emoji->IsAnimated.has_value() && *emoji->IsAnimated) continue; + if (term.size() > 0) + if (!StringContainsCaseless(emoji->Name, term)) continue; + if (i++ > MaxCompleterEntries) break; + + const auto entry = make_entry(emoji->Name, "<:" + emoji->Name + ":" + std::to_string(emoji->ID) + ">", emoji->GetURL()); + } } // if <15 guild emojis match then load up stock |