1.4.10 updates
This commit is contained in:
@@ -1247,6 +1247,8 @@ command_result ConnectedClient::handleCommandChannelEdit(Command &cmd) {
|
||||
if(conversation)
|
||||
conversation->set_history_length(cmd[key->name]);
|
||||
}
|
||||
} else if(*key == property::CHANNEL_NEEDED_TALK_POWER) {
|
||||
channel->permissions()->set_permission(permission::i_client_needed_talk_power, {cmd[key->name].as<int>(), 0}, permission::v2::set_value, permission::v2::do_nothing);
|
||||
}
|
||||
|
||||
channel->properties()[key] = cmd[key->name].string();
|
||||
|
||||
@@ -1906,7 +1906,7 @@ command_result ConnectedClient::handleCommandLogView(ts::Command& cmd) {
|
||||
}
|
||||
string command = "cat \"" + log_path + "\"";
|
||||
command += " | grep -E ";
|
||||
command += "\"\\] \\[.*\\]( ){0,6}?" + server_identifier + " \\|\"";
|
||||
command += R"("\] \[.*\]( ){0,6}?)" + server_identifier + " \\|\"";
|
||||
|
||||
size_t beginpos = cmd[0].has("begin_pos") ? cmd["begin_pos"].as<size_t>() : 0ULL; //TODO test it?
|
||||
size_t file_index = 0;
|
||||
@@ -1927,7 +1927,7 @@ command_result ConnectedClient::handleCommandLogView(ts::Command& cmd) {
|
||||
if(beginpos != 0 && file_index + read > beginpos) { //We're done we just want to get the size later
|
||||
line_buffer += string(buffer.data(), beginpos - file_index);
|
||||
|
||||
lines.push_back({file_index, line_buffer});
|
||||
lines.emplace_back(file_index, line_buffer);
|
||||
if(lines.size() > max_lines) lines.pop_front();
|
||||
//debugMessage(LOG_GENERAL, "Final line {}", line_buffer);
|
||||
line_buffer = "";
|
||||
@@ -1955,7 +1955,7 @@ command_result ConnectedClient::handleCommandLogView(ts::Command& cmd) {
|
||||
if(length == 0) length = 1;
|
||||
|
||||
//debugMessage(LOG_GENERAL, "Got line {}", line_buffer.substr(0, index));
|
||||
lines.push_back({file_index + cut_offset, line_buffer.substr(0, index)});
|
||||
lines.emplace_back(file_index + cut_offset, line_buffer.substr(0, index));
|
||||
if(lines.size() > max_lines) lines.pop_front();
|
||||
|
||||
cut_offset += index + length;
|
||||
@@ -1968,7 +1968,7 @@ command_result ConnectedClient::handleCommandLogView(ts::Command& cmd) {
|
||||
}
|
||||
|
||||
if(!line_buffer.empty()) {
|
||||
lines.push_back({file_index - line_buffer.length(), line_buffer});
|
||||
lines.emplace_back(file_index - line_buffer.length(), line_buffer);
|
||||
if(lines.size() > max_lines) lines.pop_front();
|
||||
}
|
||||
}
|
||||
@@ -2004,8 +2004,13 @@ command_result ConnectedClient::handleCommandLogView(ts::Command& cmd) {
|
||||
|
||||
ts += type + " | | |" + line.substr(line.find('|') + 1);
|
||||
}
|
||||
|
||||
if(ts.length() > 1024)
|
||||
ts = ts.substr(0, 1024) + "...";
|
||||
result[index++]["l"] = ts;
|
||||
} else {
|
||||
if(line.length() > 1024)
|
||||
line = line.substr(0, 1024) + "...";
|
||||
result[index++]["l"] = line;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user