From eab0e100c4368b3a9b42c0f8cc0f6cc4faf0f1bc Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Fri, 25 Jun 2021 22:54:34 -0400 Subject: be more consistent with callbacks --- components/friendslist.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'components') diff --git a/components/friendslist.cpp b/components/friendslist.cpp index f31cc00..6541b0c 100644 --- a/components/friendslist.cpp +++ b/components/friendslist.cpp @@ -101,8 +101,8 @@ void FriendsList::OnRelationshipRemove(Snowflake id, RelationshipType type) { } void FriendsList::OnActionAccept(Snowflake id) { - const auto cb = [this](bool success, DiscordError code) { - if (!success) { + const auto cb = [this](DiscordError code) { + if (code != DiscordError::NONE) { Gtk::MessageDialog dlg(*dynamic_cast(get_toplevel()), "Failed to accept", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); dlg.set_position(Gtk::WIN_POS_CENTER); dlg.run(); @@ -133,8 +133,8 @@ void FriendsList::OnActionRemove(Snowflake id) { break; } if (Abaddon::Get().ShowConfirm(str, window)) { - const auto cb = [this, window](bool success) { - if (success) return; + const auto cb = [this, window](DiscordError code) { + if (code == DiscordError::NONE) return; Gtk::MessageDialog dlg(*window, "Failed to remove user", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); dlg.set_position(Gtk::WIN_POS_CENTER); dlg.run(); @@ -221,9 +221,9 @@ void FriendsListAddComponent::Submit() { m_requesting = true; m_label.set_text("Hang on..."); - const auto cb = [this](bool success, DiscordError code) { + const auto cb = [this](DiscordError code) { m_requesting = false; - if (success) { + if (code == DiscordError::NONE) { m_label.set_text("Success!"); } else { m_label.set_text("Failed: "s + GetDiscordErrorDisplayString(code)); -- cgit v1.2.3