summaryrefslogtreecommitdiff
path: root/src/bridge
diff options
context:
space:
mode:
authorlouiz’ <louiz@louiz.org>2018-04-29 22:18:26 +0200
committerlouiz’ <louiz@louiz.org>2018-04-29 22:18:26 +0200
commitb0168fd45b3683c2d6f61ccae67dcd5b918a363d (patch)
tree6b3e035f6edfef0b9a8aac1813259b9c95ebcf35 /src/bridge
parent0887be6eef24929fd594239e9569fc5cee54aba0 (diff)
downloadbiboumi-b0168fd45b3683c2d6f61ccae67dcd5b918a363d.tar.gz
biboumi-b0168fd45b3683c2d6f61ccae67dcd5b918a363d.tar.bz2
biboumi-b0168fd45b3683c2d6f61ccae67dcd5b918a363d.tar.xz
biboumi-b0168fd45b3683c2d6f61ccae67dcd5b918a363d.zip
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
Diffstat (limited to 'src/bridge')
-rw-r--r--src/bridge/bridge.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bridge/bridge.cpp b/src/bridge/bridge.cpp
index 1c646fe..7a0157a 100644
--- a/src/bridge/bridge.cpp
+++ b/src/bridge/bridge.cpp
@@ -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)
{