mirror of
https://github.com/celisej567/abaddon.git
synced 2026-09-06 20:15:19 +03:00
dont print identify message to console
mainly since i feel its only a matter of time before someone copy pastes it somewhere and itd be my fault also typedef -> using
This commit is contained in:
@@ -2012,7 +2012,10 @@ void DiscordClient::SendIdentify() {
|
||||
msg.ClientState.HighestLastMessageID = "0";
|
||||
msg.ClientState.ReadStateVersion = 0;
|
||||
msg.ClientState.UserGuildSettingsVersion = -1;
|
||||
const bool b = m_websocket.GetPrintMessages();
|
||||
m_websocket.SetPrintMessages(false);
|
||||
m_websocket.Send(msg);
|
||||
m_websocket.SetPrintMessages(b);
|
||||
}
|
||||
|
||||
void DiscordClient::SendResume() {
|
||||
|
||||
@@ -15,6 +15,14 @@ void Websocket::SetUserAgent(std::string agent) {
|
||||
m_agent = agent;
|
||||
}
|
||||
|
||||
bool Websocket::GetPrintMessages() const noexcept {
|
||||
return m_print_messages;
|
||||
}
|
||||
|
||||
void Websocket::SetPrintMessages(bool show) noexcept {
|
||||
m_print_messages = show;
|
||||
}
|
||||
|
||||
void Websocket::Stop() {
|
||||
Stop(ix::WebSocketCloseConstants::kNormalClosureCode);
|
||||
}
|
||||
@@ -29,7 +37,8 @@ bool Websocket::IsOpen() const {
|
||||
}
|
||||
|
||||
void Websocket::Send(const std::string &str) {
|
||||
printf("sending %s\n", str.c_str());
|
||||
if (m_print_messages)
|
||||
printf("sending %s\n", str.c_str());
|
||||
m_websocket.sendText(str);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,9 @@ public:
|
||||
|
||||
void SetUserAgent(std::string agent);
|
||||
|
||||
bool GetPrintMessages() const noexcept;
|
||||
void SetPrintMessages(bool show) noexcept;
|
||||
|
||||
void Send(const std::string &str);
|
||||
void Send(const nlohmann::json &j);
|
||||
void Stop();
|
||||
@@ -26,9 +29,9 @@ private:
|
||||
std::string m_agent;
|
||||
|
||||
public:
|
||||
typedef sigc::signal<void> type_signal_open;
|
||||
typedef sigc::signal<void, uint16_t> type_signal_close;
|
||||
typedef sigc::signal<void, std::string> type_signal_message;
|
||||
using type_signal_open = sigc::signal<void>;
|
||||
using type_signal_close = sigc::signal<void, uint16_t>;
|
||||
using type_signal_message = sigc::signal<void, std::string>;
|
||||
|
||||
type_signal_open signal_open();
|
||||
type_signal_close signal_close();
|
||||
@@ -38,4 +41,6 @@ private:
|
||||
type_signal_open m_signal_open;
|
||||
type_signal_close m_signal_close;
|
||||
type_signal_message m_signal_message;
|
||||
|
||||
bool m_print_messages = true;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user