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
99
Issues
99
List
Boards
Labels
Service Desk
Milestones
Merge Requests
12
Merge Requests
12
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
c3bb9fe2
Commit
c3bb9fe2
authored
Oct 23, 2016
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle forced-join by just sending an invitation
fix
#3116
parent
00eb18ba
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+13
-2
src/xmpp/biboumi_component.cpp
src/xmpp/biboumi_component.cpp
+4
-1
No files found.
src/bridge/bridge.cpp
View file @
c3bb9fe2
...
...
@@ -839,8 +839,19 @@ void Bridge::send_xmpp_message(const std::string& from, const std::string& autho
void
Bridge
::
send_user_join
(
const
std
::
string
&
hostname
,
const
std
::
string
&
chan_name
,
const
IrcUser
*
user
,
const
char
user_mode
,
const
bool
self
)
{
for
(
const
auto
&
resource
:
this
->
resources_in_chan
[
ChannelKey
{
chan_name
,
hostname
}])
const
auto
resources
=
this
->
resources_in_chan
[
ChannelKey
{
chan_name
,
hostname
}];
if
(
self
&&
resources
.
empty
())
{
// This was a forced join: no client ever asked to join this room,
// but the server tells us we are in that room anyway. XMPP can’t
// do that, so we invite all the resources to join that channel.
const
Iid
iid
(
chan_name
,
hostname
,
Iid
::
Type
::
Channel
);
this
->
send_xmpp_invitation
(
iid
,
""
);
}
else
{
for
(
const
auto
&
resource
:
resources
)
this
->
send_user_join
(
hostname
,
chan_name
,
user
,
user_mode
,
self
,
resource
);
}
}
void
Bridge
::
send_user_join
(
const
std
::
string
&
hostname
,
const
std
::
string
&
chan_name
,
...
...
src/xmpp/biboumi_component.cpp
View file @
c3bb9fe2
...
...
@@ -855,6 +855,9 @@ void BiboumiComponent::send_invitation(const std::string& room_target,
XmlNode
x
(
"x"
);
x
[
"xmlns"
]
=
MUC_USER_NS
;
XmlNode
invite
(
"invite"
);
if
(
author_nick
.
empty
())
invite
[
"from"
]
=
room_target
+
"@"
+
this
->
served_hostname
;
else
invite
[
"from"
]
=
room_target
+
"@"
+
this
->
served_hostname
+
"/"
+
author_nick
;
x
.
add_child
(
std
::
move
(
invite
));
message
.
add_child
(
std
::
move
(
x
));
...
...
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