Send a item-not-found error when the “after” value is not in the archive
This commit is contained in:
@@ -22,6 +22,7 @@ class Database
|
||||
{
|
||||
public:
|
||||
using time_point = std::chrono::system_clock::time_point;
|
||||
struct RecordNotFound: public std::exception {};
|
||||
|
||||
struct Uuid: Column<std::string> { static constexpr auto name = "uuid_"; };
|
||||
|
||||
|
||||
@@ -467,8 +467,12 @@ void BiboumiComponent::handle_iq(const Stanza& stanza)
|
||||
#ifdef USE_DATABASE
|
||||
else if ((query = stanza.get_child("query", MAM_NS)))
|
||||
{
|
||||
if (this->handle_mam_request(stanza))
|
||||
stanza_error.disable();
|
||||
try {
|
||||
if (this->handle_mam_request(stanza))
|
||||
stanza_error.disable();
|
||||
} catch (const Database::RecordNotFound& exc) {
|
||||
error_name = "item-not-found";
|
||||
}
|
||||
}
|
||||
else if ((query = stanza.get_child("query", MUC_OWNER_NS)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user