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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Buquet
biboumi
Commits
0cd848e5
Commit
0cd848e5
authored
Mar 31, 2018
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send the stanza-id for messages received by other users
fix #3347
parent
99c36489
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+4
-4
tests/end_to_end/__main__.py
tests/end_to_end/__main__.py
+4
-2
No files found.
src/bridge/bridge.cpp
View file @
0cd848e5
...
...
@@ -819,19 +819,19 @@ void Bridge::send_irc_version_request(const std::string& irc_hostname, const std
void
Bridge
::
send_message
(
const
Iid
&
iid
,
const
std
::
string
&
nick
,
const
std
::
string
&
body
,
const
bool
muc
)
{
const
auto
encoding
=
in_encoding_for
(
*
this
,
iid
);
std
::
string
uuid
{};
if
(
muc
)
{
#ifdef USE_DATABASE
const
auto
xmpp_body
=
this
->
make_xmpp_body
(
body
,
encoding
);
if
(
!
nick
.
empty
()
&&
this
->
record_history
)
Database
::
store_muc_message
(
this
->
get_bare_jid
(),
iid
.
get_local
(),
iid
.
get_server
(),
std
::
chrono
::
system_clock
::
now
(),
std
::
get
<
0
>
(
xmpp_body
),
nick
);
uuid
=
Database
::
store_muc_message
(
this
->
get_bare_jid
(),
iid
.
get_local
(),
iid
.
get_server
(),
std
::
chrono
::
system_clock
::
now
(),
std
::
get
<
0
>
(
xmpp_body
),
nick
);
#endif
for
(
const
auto
&
resource
:
this
->
resources_in_chan
[
iid
.
to_tuple
()])
{
this
->
xmpp
.
send_muc_message
(
std
::
to_string
(
iid
),
nick
,
this
->
make_xmpp_body
(
body
,
encoding
),
this
->
user_jid
+
"/"
+
resource
,
{},
utils
::
gen_uuid
());
this
->
user_jid
+
"/"
+
resource
,
uuid
,
utils
::
gen_uuid
());
}
}
else
...
...
tests/end_to_end/__main__.py
View file @
0cd848e5
...
...
@@ -1344,8 +1344,10 @@ if __name__ == '__main__':
partial
(
send_stanza
,
"<message from='{jid_one}/{resource_one}' to='#foo%{irc_server_one}' type='groupchat'><body>coucou</body></message>"
),
# Receive the message, forwarded to the two users
partial
(
expect_unordered
,
[
(
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_one}/{resource_one}'][@type='groupchat']/body[text()='coucou']"
,),
(
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='coucou']"
,)
(
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_one}/{resource_one}'][@type='groupchat']/body[text()='coucou']"
,
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
),
(
"/message[@from='#foo%{irc_server_one}/{nick_one}'][@to='{jid_two}/{resource_one}'][@type='groupchat']/body[text()='coucou']"
,
"/message/stable_id:stanza-id[@by='#foo%{irc_server_one}'][@id]"
)
]),
# Send a private message, to a in-room JID
...
...
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