Commit 88499d03 authored by louiz’'s avatar louiz’

If the maxHistoryLength is negative, make it 0

Instead of doing a broken SQL request that returns weird lines
parent 91285d14
......@@ -136,8 +136,10 @@ void Database::store_muc_message(const std::string& owner, const Iid& iid,
line.update();
}
std::vector<db::MucLogLine> Database::get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server, const int limit)
std::vector<db::MucLogLine> Database::get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server, int limit)
{
if (limit < 0)
limit = 0;
auto res = litesql::select<db::MucLogLine>(*Database::db,
db::MucLogLine::Owner == owner &&
db::MucLogLine::IrcChanName == chan_name &&
......
......@@ -49,7 +49,7 @@ public:
const std::string& server,
const std::string& channel);
static std::vector<db::MucLogLine> get_muc_logs(const std::string& owner, const std::string& chan_name, const std::string& server,
const int limit);
int limit);
static void store_muc_message(const std::string& owner, const Iid& iid,
time_point date, const std::string& body, const std::string& nick);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment