forked from OpenGamers/abaddon
remove mark all as read (it doesnt work on API end)
This commit is contained in:
parent
61cde0f7e1
commit
436024b4a0
@ -911,26 +911,6 @@ void DiscordClient::UnmuteChannel(Snowflake channel_id, const sigc::slot<void(Di
|
||||
});
|
||||
}
|
||||
|
||||
void DiscordClient::MarkAllAsRead(const sigc::slot<void(DiscordError code)> &callback) {
|
||||
AckBulkData data;
|
||||
for (const auto &[unread, mention_count] : m_unread) {
|
||||
const auto iter = m_last_message_id.find(unread);
|
||||
if (iter == m_last_message_id.end()) continue;
|
||||
auto &e = data.ReadStates.emplace_back();
|
||||
e.ID = unread;
|
||||
e.LastMessageID = iter->second;
|
||||
}
|
||||
|
||||
if (data.ReadStates.empty()) return;
|
||||
|
||||
m_http.MakePOST("/read-states/ack-bulk", nlohmann::json(data).dump(), [callback](const http::response_type &response) {
|
||||
if (CheckCode(response))
|
||||
callback(DiscordError::NONE);
|
||||
else
|
||||
callback(GetCodeFromResponse(response));
|
||||
});
|
||||
}
|
||||
|
||||
void DiscordClient::MuteGuild(Snowflake id, const sigc::slot<void(DiscordError code)> &callback) {
|
||||
m_http.MakePATCH("/users/@me/guilds/" + std::to_string(id) + "/settings", R"({"muted":true})", [callback](const http::response_type &response) {
|
||||
if (CheckCode(response))
|
||||
|
@ -146,7 +146,6 @@ public:
|
||||
void MarkGuildAsRead(Snowflake guild_id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
void MuteChannel(Snowflake channel_id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
void UnmuteChannel(Snowflake channel_id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
void MarkAllAsRead(const sigc::slot<void(DiscordError code)> &callback);
|
||||
void MuteGuild(Snowflake id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
void UnmuteGuild(Snowflake id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
void MuteThread(Snowflake id, const sigc::slot<void(DiscordError code)> &callback);
|
||||
|
@ -168,7 +168,6 @@ void MainWindow::OnViewSubmenuPopup() {
|
||||
|
||||
m_menu_view_friends.set_sensitive(discord_active);
|
||||
m_menu_view_mark_guild_as_read.set_sensitive(discord_active);
|
||||
m_menu_view_mark_all_as_read.set_sensitive(discord_active);
|
||||
|
||||
auto channel_id = GetChatActiveChannel();
|
||||
m_menu_view_pins.set_sensitive(false);
|
||||
@ -228,12 +227,10 @@ void MainWindow::SetupMenu() {
|
||||
m_menu_view_threads.set_label("Threads");
|
||||
m_menu_view_mark_guild_as_read.set_label("Mark Server as Read");
|
||||
m_menu_view_mark_guild_as_read.add_accelerator("activate", m_accels, GDK_KEY_Escape, Gdk::SHIFT_MASK, Gtk::ACCEL_VISIBLE);
|
||||
m_menu_view_mark_all_as_read.set_label("Mark All as Read");
|
||||
m_menu_view_sub.append(m_menu_view_friends);
|
||||
m_menu_view_sub.append(m_menu_view_pins);
|
||||
m_menu_view_sub.append(m_menu_view_threads);
|
||||
m_menu_view_sub.append(m_menu_view_mark_guild_as_read);
|
||||
m_menu_view_sub.append(m_menu_view_mark_all_as_read);
|
||||
|
||||
m_menu_bar.append(m_menu_file);
|
||||
m_menu_bar.append(m_menu_discord);
|
||||
@ -300,10 +297,6 @@ void MainWindow::SetupMenu() {
|
||||
discord.MarkGuildAsRead(*channel->GuildID, NOOP_CALLBACK);
|
||||
}
|
||||
});
|
||||
|
||||
m_menu_view_mark_all_as_read.signal_activate().connect([] {
|
||||
Abaddon::Get().GetDiscordClient().MarkAllAsRead(NOOP_CALLBACK);
|
||||
});
|
||||
}
|
||||
|
||||
MainWindow::type_signal_action_connect MainWindow::signal_action_connect() {
|
||||
|
@ -67,7 +67,6 @@ private:
|
||||
Gtk::MenuItem m_menu_view_pins;
|
||||
Gtk::MenuItem m_menu_view_threads;
|
||||
Gtk::MenuItem m_menu_view_mark_guild_as_read;
|
||||
Gtk::MenuItem m_menu_view_mark_all_as_read;
|
||||
void OnViewSubmenuPopup();
|
||||
|
||||
public:
|
||||
|
Loading…
Reference in New Issue
Block a user