Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
biboumi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
88
Issues
88
List
Boards
Labels
Service Desk
Milestones
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
louiz’
biboumi
Commits
d7055414
Commit
d7055414
authored
Feb 11, 2018
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send a item-not-found error when the “after” value is not in the archive
parent
0280343c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
src/database/database.hpp
src/database/database.hpp
+1
-0
src/xmpp/biboumi_component.cpp
src/xmpp/biboumi_component.cpp
+6
-2
tests/end_to_end/__main__.py
tests/end_to_end/__main__.py
+4
-1
No files found.
src/database/database.hpp
View file @
d7055414
...
...
@@ -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_"
;
};
...
...
src/xmpp/biboumi_component.cpp
View file @
d7055414
...
...
@@ -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
)))
{
...
...
tests/end_to_end/__main__.py
View file @
d7055414
...
...
@@ -2182,12 +2182,15 @@ if __name__ == '__main__':
"/message/mam:result[@queryid='qid2']/forward:forwarded/client:message[@from='#foo%{irc_server_one}/{nick_one}'][@type='groupchat']/client:body[text()='149']"
),
after
=
partial
(
save_value
,
"last_uuid"
,
partial
(
extract_attribute
,
"/message/mam:result"
,
"id"
))
),
# And it should not be marked as complete
partial
(
expect_stanza
,
(
"/iq[@type='result'][@id='id2'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']"
,
"/iq/mam:fin/rsm:set/rsm:last[text()='{last_uuid}']"
,
"/iq//mam:fin[@complete='true']"
,
"/iq//mam:fin"
)),
# Send a request with a non-existing ID set as the “after” value.
partial
(
send_stanza
,
"<iq to='#foo%{irc_server_one}' from='{jid_one}/{resource_one}' type='set' id='id3'><query xmlns='urn:xmpp:mam:2' queryid='qid3' ><set xmlns='http://jabber.org/protocol/rsm'><after>DUMMY_ID</after></set></query></iq>"
),
partial
(
expect_stanza
,
"/iq[@id='id3'][@type='error']/error[@type='cancel']/stanza:feature-not-implemented"
)
]),
Scenario
(
"channel_history_on_fixed_server"
,
[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment