diff options
author | louiz’ <louiz@louiz.org> | 2017-12-26 20:21:18 +0100 |
---|---|---|
committer | louiz’ <louiz@louiz.org> | 2017-12-26 20:21:18 +0100 |
commit | 131ef9946fff0f5cfd794203e819df931b72600f (patch) | |
tree | c81ac414bc7bf87fbc5785074a7c35e6300bd3e4 /src/xmpp/biboumi_component.cpp | |
parent | 37340e593ffb61eaccc444a1efdb3aa6f784a14a (diff) | |
download | biboumi-131ef9946fff0f5cfd794203e819df931b72600f.tar.gz biboumi-131ef9946fff0f5cfd794203e819df931b72600f.tar.bz2 biboumi-131ef9946fff0f5cfd794203e819df931b72600f.tar.xz biboumi-131ef9946fff0f5cfd794203e819df931b72600f.zip |
Include the <fin><set><first/><last/></></> nodes in the MAM iq result
fix #3322
Diffstat (limited to 'src/xmpp/biboumi_component.cpp')
-rw-r--r-- | src/xmpp/biboumi_component.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/xmpp/biboumi_component.cpp b/src/xmpp/biboumi_component.cpp index 51ca78d..a998fbe 100644 --- a/src/xmpp/biboumi_component.cpp +++ b/src/xmpp/biboumi_component.cpp @@ -725,7 +725,24 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza) if (!line.col<Database::Nick>().empty()) this->send_archived_message(line, to.full(), from.full(), query_id); } - this->send_iq_result_full_jid(id, from.full(), to.full()); + { + auto fin_ptr = std::make_unique<XmlNode>("fin"); + { + XmlNode& fin = *(fin_ptr.get()); + fin["xmlns"] = MAM_NS; + XmlSubNode set(fin, "set"); + set["xmlns"] = RSM_NS; + if (!lines.empty()) + { + XmlSubNode first(set, "first"); + first["index"] = "0"; + first.set_inner(lines[0].col<Database::Uuid>()); + XmlSubNode last(set, "last"); + last.set_inner(lines[lines.size() - 1].col<Database::Uuid>()); + } + } + this->send_iq_result_full_jid(id, from.full(), to.full(), std::move(fin_ptr)); + } return true; } return false; |