mirror of
https://github.com/uowuo/abaddon.git
synced 2026-08-15 05:19:58 +00:00
show dialog on unexpected socket close code
This commit is contained in:
1 parent
4af7dacb0f
commit
ceaf4649dc
2 files changed
+24
No files matched your search
@@ -240,6 +240,13 @@ void Abaddon::DiscordOnDisconnect(bool is_reconnecting, GatewayCloseCode close_c
|
||||
m_main_window->UpdateComponents();
|
||||
if (close_code == GatewayCloseCode::AuthenticationFailed) {
|
||||
Gtk::MessageDialog dlg(*m_main_window, "Discord rejected your token", false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
||||
dlg.set_position(Gtk::WIN_POS_CENTER);
|
||||
dlg.run();
|
||||
} else if (close_code != GatewayCloseCode::Normal) {
|
||||
Gtk::MessageDialog dlg(*m_main_window,
|
||||
"Lost connection with Discord's gateway. Try reconnecting (code " + std::to_string(static_cast<unsigned>(close_code)) + ")",
|
||||
false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
||||
dlg.set_position(Gtk::WIN_POS_CENTER);
|
||||
dlg.run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user