mam: Send “fin complete” only when appropriate
Also simplify how we did the whole “limit + 1” And fix one bad interpretation of the XEP for the case where the query has no after or before restriction. fix #3349
This commit is contained in:
@@ -1005,7 +1005,8 @@ void Bridge::send_room_history(const std::string& hostname, std::string chan_nam
|
||||
auto limit = coptions.col<Database::MaxHistoryLength>();
|
||||
if (history_limit.stanzas >= 0 && history_limit.stanzas < limit)
|
||||
limit = history_limit.stanzas;
|
||||
const auto lines = Database::get_muc_logs(this->user_jid, chan_name, hostname, limit, history_limit.since, {}, Id::unset_value, Database::Paging::last);
|
||||
const auto result = Database::get_muc_logs(this->user_jid, chan_name, hostname, limit, history_limit.since, {}, Id::unset_value, Database::Paging::last);
|
||||
const auto& lines = std::get<1>(result);
|
||||
chan_name.append(utils::empty_if_fixed_server("%" + hostname));
|
||||
for (const auto& line: lines)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user