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
90
Issues
90
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
131ef994
Commit
131ef994
authored
Dec 26, 2017
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Include the <fin><set><first/><last/></></> nodes in the MAM iq result
fix
#3322
parent
37340e59
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
src/xmpp/biboumi_component.cpp
src/xmpp/biboumi_component.cpp
+18
-1
src/xmpp/xmpp_component.cpp
src/xmpp/xmpp_component.cpp
+3
-1
src/xmpp/xmpp_component.hpp
src/xmpp/xmpp_component.hpp
+1
-1
tests/end_to_end/__main__.py
tests/end_to_end/__main__.py
+4
-1
No files found.
src/xmpp/biboumi_component.cpp
View file @
131ef994
...
@@ -725,7 +725,24 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza)
...
@@ -725,7 +725,24 @@ bool BiboumiComponent::handle_mam_request(const Stanza& stanza)
if
(
!
line
.
col
<
Database
::
Nick
>
().
empty
())
if
(
!
line
.
col
<
Database
::
Nick
>
().
empty
())
this
->
send_archived_message
(
line
,
to
.
full
(),
from
.
full
(),
query_id
);
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
true
;
}
}
return
false
;
return
false
;
...
...
src/xmpp/xmpp_component.cpp
View file @
131ef994
...
@@ -640,13 +640,15 @@ void XmppComponent::send_iq_version_request(const std::string& from,
...
@@ -640,13 +640,15 @@ void XmppComponent::send_iq_version_request(const std::string& from,
this
->
send_stanza
(
iq
);
this
->
send_stanza
(
iq
);
}
}
void
XmppComponent
::
send_iq_result_full_jid
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
const
std
::
string
&
from_full_jid
)
void
XmppComponent
::
send_iq_result_full_jid
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
const
std
::
string
&
from_full_jid
,
std
::
unique_ptr
<
XmlNode
>
inner
)
{
{
Stanza
iq
(
"iq"
);
Stanza
iq
(
"iq"
);
iq
[
"from"
]
=
from_full_jid
;
iq
[
"from"
]
=
from_full_jid
;
iq
[
"to"
]
=
to_jid
;
iq
[
"to"
]
=
to_jid
;
iq
[
"id"
]
=
id
;
iq
[
"id"
]
=
id
;
iq
[
"type"
]
=
"result"
;
iq
[
"type"
]
=
"result"
;
if
(
inner
)
iq
.
add_child
(
std
::
move
(
inner
));
this
->
send_stanza
(
iq
);
this
->
send_stanza
(
iq
);
}
}
...
...
src/xmpp/xmpp_component.hpp
View file @
131ef994
...
@@ -203,7 +203,7 @@ public:
...
@@ -203,7 +203,7 @@ public:
*/
*/
void
send_iq_result
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
const
std
::
string
&
from
);
void
send_iq_result
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
const
std
::
string
&
from
);
void
send_iq_result_full_jid
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
void
send_iq_result_full_jid
(
const
std
::
string
&
id
,
const
std
::
string
&
to_jid
,
const
std
::
string
&
from_full_jid
);
const
std
::
string
&
from_full_jid
,
std
::
unique_ptr
<
XmlNode
>
inner
=
nullptr
);
void
handle_handshake
(
const
Stanza
&
stanza
);
void
handle_handshake
(
const
Stanza
&
stanza
);
void
handle_error
(
const
Stanza
&
stanza
);
void
handle_error
(
const
Stanza
&
stanza
);
...
...
tests/end_to_end/__main__.py
View file @
131ef994
...
@@ -130,6 +130,7 @@ def match(stanza, xpath):
...
@@ -130,6 +130,7 @@ def match(stanza, xpath):
'dataform'
:
'jabber:x:data'
,
'dataform'
:
'jabber:x:data'
,
'version'
:
'jabber:iq:version'
,
'version'
:
'jabber:iq:version'
,
'mam'
:
'urn:xmpp:mam:2'
,
'mam'
:
'urn:xmpp:mam:2'
,
'rms'
:
'http://jabber.org/protocol/rsm'
,
'delay'
:
'urn:xmpp:delay'
,
'delay'
:
'urn:xmpp:delay'
,
'forward'
:
'urn:xmpp:forward:0'
,
'forward'
:
'urn:xmpp:forward:0'
,
'client'
:
'jabber:client'
,
'client'
:
'jabber:client'
,
...
@@ -1852,7 +1853,9 @@ if __name__ == '__main__':
...
@@ -1852,7 +1853,9 @@ if __name__ == '__main__':
),
),
partial
(
expect_stanza
,
partial
(
expect_stanza
,
"/iq[@type='result'][@id='id1'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']"
),
(
"/iq[@type='result'][@id='id1'][@from='#foo%{irc_server_one}'][@to='{jid_one}/{resource_one}']"
,
"/iq/mam:fin/rms:set/rsm:last"
,
"/iq/mam:fin/rsm:set/rsm:first"
)),
# Retrieve an empty archive by specifying an early “end” date
# Retrieve an empty archive by specifying an early “end” date
partial
(
send_stanza
,
"""<iq to='#foo%{irc_server_one}' from='{jid_one}/{resource_one}' type='set' id='id2'>
partial
(
send_stanza
,
"""<iq to='#foo%{irc_server_one}' from='{jid_one}/{resource_one}' type='set' id='id2'>
...
...
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