feat(Core/Chat): new argument parsing and unify chat hyperlink parsing (#6243)

This commit is contained in:
Kargatum
2021-10-23 15:15:42 +07:00
committed by GitHub
parent 1101f9dd2a
commit bc9473482e
90 changed files with 4280 additions and 2508 deletions

View File

@@ -91,7 +91,7 @@ void RASession::Start()
_socket.close();
}
int RASession::Send(const char* data)
int RASession::Send(std::string_view data)
{
std::ostream os(&_writeBuffer);
os << data;
@@ -206,9 +206,9 @@ bool RASession::ProcessCommand(std::string& command)
return false;
}
void RASession::CommandPrint(void* callbackArg, const char* text)
void RASession::CommandPrint(void* callbackArg, std::string_view text)
{
if (!text || !*text)
if (text.empty())
{
return;
}

View File

@@ -40,13 +40,13 @@ public:
unsigned short GetRemotePort() const { return _socket.remote_endpoint().port(); }
private:
int Send(const char* data);
int Send(std::string_view data);
std::string ReadString();
bool CheckAccessLevel(const std::string& user);
bool CheckPassword(const std::string& user, const std::string& pass);
bool ProcessCommand(std::string& command);
static void CommandPrint(void* callbackArg, const char* text);
static void CommandPrint(void* callbackArg, std::string_view text);
static void CommandFinished(void* callbackArg, bool);
tcp::socket _socket;