|
@ -379,7 +379,7 @@ size_t Jupiter::IRC::Client::messageChannels(const Jupiter::ReadableString &mess |
|
|
|
|
|
|
|
|
int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
Jupiter::ReferenceString line{in_line}; // TODO: remove this
|
|
|
Jupiter::ReferenceString line{in_line}; // TODO: remove this
|
|
|
if (line.isNotEmpty()) |
|
|
if (!line.empty()) |
|
|
{ |
|
|
{ |
|
|
Jupiter::IRC::Client::writeToLogs(line); |
|
|
Jupiter::IRC::Client::writeToLogs(line); |
|
|
if (m_output != nullptr) { |
|
|
if (m_output != nullptr) { |
|
@ -390,7 +390,7 @@ int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
|
|
|
|
|
|
auto first_split = jessilib::split_once_view(line, " "sv); |
|
|
auto first_split = jessilib::split_once_view(line, " "sv); |
|
|
Jupiter::ReferenceString w1 = first_split.first; |
|
|
Jupiter::ReferenceString w1 = first_split.first; |
|
|
if (w1.isNotEmpty()) |
|
|
if (!w1.empty()) |
|
|
{ |
|
|
{ |
|
|
int numeric = asInt(first_split.second); |
|
|
int numeric = asInt(first_split.second); |
|
|
if (w1[0] == ':') { //Messages
|
|
|
if (w1[0] == ':') { //Messages
|
|
@ -802,7 +802,7 @@ int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
auto sender = getSender(line); |
|
|
auto sender = getSender(line); |
|
|
if (sender.isNotEmpty()) { |
|
|
if (!sender.empty()) { |
|
|
this->OnServerNotice(channel_name, sender, message); |
|
|
this->OnServerNotice(channel_name, sender, message); |
|
|
for (auto& plugin: Jupiter::plugins) { |
|
|
for (auto& plugin: Jupiter::plugins) { |
|
|
plugin->OnServerNotice(this, channel_name, sender, message); |
|
|
plugin->OnServerNotice(this, channel_name, sender, message); |
|
@ -864,7 +864,7 @@ int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
} |
|
|
} |
|
|
else if (jessilib::equalsi(command_token, "PART"sv)) { |
|
|
else if (jessilib::equalsi(command_token, "PART"sv)) { |
|
|
auto nick = getSender(line); |
|
|
auto nick = getSender(line); |
|
|
if (nick.isNotEmpty()) { |
|
|
if (!nick.empty()) { |
|
|
std::string_view channel_name = getLineToken(2); |
|
|
std::string_view channel_name = getLineToken(2); |
|
|
if (!channel_name.empty()) { |
|
|
if (!channel_name.empty()) { |
|
|
Channel* channel = getChannel(channel_name); |
|
|
Channel* channel = getChannel(channel_name); |
|
@ -898,7 +898,7 @@ int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
std::string_view channel_name = getLineToken(2); |
|
|
std::string_view channel_name = getLineToken(2); |
|
|
if (!channel_name.empty()) { |
|
|
if (!channel_name.empty()) { |
|
|
Jupiter::ReferenceString kicker = getSender(line); |
|
|
Jupiter::ReferenceString kicker = getSender(line); |
|
|
if (kicker.isNotEmpty()) { |
|
|
if (!kicker.empty()) { |
|
|
std::string_view kicked_nickname = getLineToken(3); |
|
|
std::string_view kicked_nickname = getLineToken(3); |
|
|
if (!kicked_nickname.empty()) { |
|
|
if (!kicked_nickname.empty()) { |
|
|
Channel* channel = getChannel(channel_name); |
|
|
Channel* channel = getChannel(channel_name); |
|
@ -966,7 +966,7 @@ int Jupiter::IRC::Client::process_line(std::string_view in_line) { |
|
|
if (!channel_name.empty()) { |
|
|
if (!channel_name.empty()) { |
|
|
if (m_chan_types.find(channel_name[0]) != std::string::npos) { |
|
|
if (m_chan_types.find(channel_name[0]) != std::string::npos) { |
|
|
auto nick = getSender(line); |
|
|
auto nick = getSender(line); |
|
|
if (nick.isNotEmpty()) { |
|
|
if (!nick.empty()) { |
|
|
std::string_view mode_line = line.substr(std::min(line.find(' ', 2), line.size())); |
|
|
std::string_view mode_line = line.substr(std::min(line.find(' ', 2), line.size())); |
|
|
if (!mode_line.empty()) { |
|
|
if (!mode_line.empty()) { |
|
|
mode_line.remove_prefix(1); |
|
|
mode_line.remove_prefix(1); |
|
|