Commit 0142e5c3 authored by louiz’'s avatar louiz’
Browse files

Limit of 200 MAM messages, if no other limit has been set by the client

fix #3256
parent dc5ad49b
......@@ -627,6 +627,11 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza)
if (max)
limit = std::atoi(max->get_inner().data());
// If the archive is really big, and the client didn’t specify any
// limit, we avoid flooding it: we set an arbitrary max limit.
if (limit == -1 && start.empty() && end.empty()) {
limit = 100;
const auto lines = Database::get_muc_logs(from.bare(), iid.get_local(), iid.get_server(), limit, start, end);
for (const db::MucLogLine& line: lines)
Supports Markdown
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