Skip to content

Commit

Permalink
media_session_id is not required
Browse files Browse the repository at this point in the history
  • Loading branch information
braindigitalis committed Sep 25, 2024
1 parent 12f6bef commit 39eeece
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/dpp/cluster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
7 changes: 6 additions & 1 deletion src/dpp/discordclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<discord_client*>(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);
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/dpp/discordvoiceclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 39eeece

Please sign in to comment.