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
This commit is contained in:
ouwou
2022-04-05 22:01:53 -04:00
parent 9767e1e7fd
commit 49685c3989
75 changed files with 518 additions and 709 deletions

View File

@@ -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());