diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-04-05 22:01:53 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-04-05 22:01:53 -0400 |
commit | 49685c39895af67d7ffcc50fdc02150b6ee44f72 (patch) | |
tree | 5c5c262f95a30e58582a285b467d05954ff5f35c /src/discord/websocket.cpp | |
parent | 9767e1e7fdef9262211ec676b4f0d4c30ff10649 (diff) | |
download | abaddon-portaudio-49685c39895af67d7ffcc50fdc02150b6ee44f72.tar.gz abaddon-portaudio-49685c39895af67d7ffcc50fdc02150b6ee44f72.zip |
fix up a bunch of clang-tidy stuff
mostly changing references, which i hope doesnt break stuff with models (TreeRow, iterators) since they gave me some strange problems in the past
Diffstat (limited to 'src/discord/websocket.cpp')
-rw-r--r-- | src/discord/websocket.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/discord/websocket.cpp b/src/discord/websocket.cpp index c7e43e9..46a4b90 100644 --- a/src/discord/websocket.cpp +++ b/src/discord/websocket.cpp @@ -1,18 +1,18 @@ #include "websocket.hpp" -#include <functional> +#include <utility> -Websocket::Websocket() {} +Websocket::Websocket() = default; -void Websocket::StartConnection(std::string url) { +void Websocket::StartConnection(const std::string &url) { m_websocket.disableAutomaticReconnection(); m_websocket.setUrl(url); - m_websocket.setOnMessageCallback(std::bind(&Websocket::OnMessage, this, std::placeholders::_1)); + m_websocket.setOnMessageCallback([this](auto &&msg) { OnMessage(std::forward<decltype(msg)>(msg)); }); m_websocket.setExtraHeaders(ix::WebSocketHttpHeaders { { "User-Agent", m_agent } }); // idk if this actually works m_websocket.start(); } void Websocket::SetUserAgent(std::string agent) { - m_agent = agent; + m_agent = std::move(agent); } bool Websocket::GetPrintMessages() const noexcept { @@ -31,11 +31,6 @@ void Websocket::Stop(uint16_t code) { m_websocket.stop(code); } -bool Websocket::IsOpen() const { - auto state = m_websocket.getReadyState(); - return state == ix::ReadyState::Open; -} - void Websocket::Send(const std::string &str) { if (m_print_messages) printf("sending %s\n", str.c_str()); |