diff --git a/src/dpp/cluster.cpp b/src/dpp/cluster.cpp index 46aec35a5d..ff7345428c 100644 --- a/src/dpp/cluster.cpp +++ b/src/dpp/cluster.cpp @@ -154,6 +154,11 @@ void cluster::log(dpp::loglevel severity, const std::string &msg) const { dpp::log_t logmsg(nullptr, msg); logmsg.severity = severity; logmsg.message = msg; + size_t pos{0}; + while ((pos = logmsg.message.find(token, pos)) != std::string::npos) { + logmsg.message.replace(pos, token.length(), "*****"); + pos += 5; + } on_log.call(logmsg); } } diff --git a/src/dpp/discordclient.cpp b/src/dpp/discordclient.cpp index 0aac3d6aae..d2ba64437f 100644 --- a/src/dpp/discordclient.cpp +++ b/src/dpp/discordclient.cpp @@ -456,9 +456,14 @@ void discord_client::log(dpp::loglevel severity, const std::string &msg) const { if (!creator->on_log.empty()) { /* Pass to user if they've hooked the event */ - dpp::log_t logmsg(nullptr, msg); + dpp::log_t logmsg(const_cast(this), msg); logmsg.severity = severity; logmsg.message = msg; + size_t pos{0}; + while ((pos = logmsg.message.find(token, pos)) != std::string::npos) { + logmsg.message.replace(pos, token.length(), "*****"); + pos += 5; + } creator->on_log.call(logmsg); } } diff --git a/src/dpp/discordvoiceclient.cpp b/src/dpp/discordvoiceclient.cpp index f94d2c37a4..3e44d6aedc 100644 --- a/src/dpp/discordvoiceclient.cpp +++ b/src/dpp/discordvoiceclient.cpp @@ -666,9 +666,6 @@ bool discord_voice_client::handle_frame(const std::string &data, ws_opcode opcod send_silence(20); } - /* Set the session id */ - this->sessionid = j["d"]["media_session_id"]; - /* Fire on_voice_ready */ if (!creator->on_voice_ready.empty()) { voice_ready_t rdy(nullptr, data);