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
faa33c1a
Commit
faa33c1a
authored
Mar 22, 2018
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass an IrcClient* to send_muc_leave instead of doing an other search
parent
9ce01667
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
13 deletions
+9
-13
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+4
-9
src/bridge/bridge.hpp
src/bridge/bridge.hpp
+2
-1
src/irc/irc_client.cpp
src/irc/irc_client.cpp
+3
-3
No files found.
src/bridge/bridge.cpp
View file @
faa33c1a
...
...
@@ -429,7 +429,7 @@ void Bridge::leave_irc_channel(Iid&& iid, const std::string& status_message, con
}
else
if
(
channel
->
joined
)
{
this
->
send_muc_leave
(
iid
,
*
channel
->
get_self
(),
""
,
true
,
true
,
resource
);
this
->
send_muc_leave
(
iid
,
*
channel
->
get_self
(),
""
,
true
,
true
,
resource
,
irc
);
}
if
(
persistent
)
this
->
remove_resource_from_chan
(
key
,
resource
);
...
...
@@ -442,7 +442,7 @@ void Bridge::leave_irc_channel(Iid&& iid, const std::string& status_message, con
if
(
channel
&&
channel
->
joined
)
this
->
send_muc_leave
(
iid
,
*
channel
->
get_self
(),
"Biboumi note: "
+
std
::
to_string
(
resources
-
1
)
+
" resources are still in this channel."
,
true
,
true
,
resource
);
true
,
true
,
resource
,
irc
);
this
->
remove_resource_from_chan
(
key
,
resource
);
}
if
(
this
->
number_of_channels_the_resource_is_in
(
iid
.
get_server
(),
resource
)
==
0
)
...
...
@@ -860,14 +860,9 @@ void Bridge::send_presence_error(const Iid& iid, const std::string& nick,
void
Bridge
::
send_muc_leave
(
const
Iid
&
iid
,
const
IrcUser
&
user
,
const
std
::
string
&
message
,
const
bool
self
,
const
bool
user_requested
,
const
std
::
string
&
resource
)
const
std
::
string
&
resource
,
const
IrcClient
*
client
)
{
const
IrcClient
*
client
=
this
->
find_irc_client
(
iid
.
get_server
());
if
(
!
client
)
{
log_error
(
"Tried to send an unavailable presence for non existant client: "
,
std
::
to_string
(
iid
));
return
;
}
std
::
string
affiliation
;
std
::
string
role
;
std
::
tie
(
role
,
affiliation
)
=
get_role_affiliation_from_irc_mode
(
user
.
get_most_significant_mode
(
client
->
get_sorted_user_modes
()));
...
...
src/bridge/bridge.hpp
View file @
faa33c1a
...
...
@@ -173,7 +173,8 @@ public:
void
send_muc_leave
(
const
Iid
&
iid
,
const
IrcUser
&
nick
,
const
std
::
string
&
message
,
const
bool
self
,
const
bool
user_requested
,
const
std
::
string
&
resource
=
""
);
const
std
::
string
&
resource
,
const
IrcClient
*
client
);
/**
* Send presences to indicate that an user old_nick (ourself if self ==
* true) changed his nick to new_nick. The user_mode is needed because
...
...
src/irc/irc_client.cpp
View file @
faa33c1a
...
...
@@ -965,7 +965,7 @@ void IrcClient::on_part(const IrcMessage& message)
iid
.
set_local
(
chan_name
);
iid
.
set_server
(
this
->
hostname
);
iid
.
type
=
Iid
::
Type
::
Channel
;
this
->
bridge
.
send_muc_leave
(
iid
,
*
user_ptr
,
txt
,
self
,
true
);
this
->
bridge
.
send_muc_leave
(
iid
,
*
user_ptr
,
txt
,
self
,
true
,
{},
this
);
}
}
...
...
@@ -982,7 +982,7 @@ void IrcClient::on_error(const IrcMessage& message)
IrcChannel
*
channel
=
pair
.
second
.
get
();
if
(
!
channel
->
joined
)
continue
;
this
->
bridge
.
send_muc_leave
(
iid
,
*
channel
->
get_self
(),
leave_message
,
true
,
false
);
this
->
bridge
.
send_muc_leave
(
iid
,
*
channel
->
get_self
(),
leave_message
,
true
,
false
,
{},
this
);
}
this
->
channels
.
clear
();
this
->
send_gateway_message
(
"ERROR: "
+
leave_message
);
...
...
@@ -1007,7 +1007,7 @@ void IrcClient::on_quit(const IrcMessage& message)
iid
.
set_local
(
chan_name
);
iid
.
set_server
(
this
->
hostname
);
iid
.
type
=
Iid
::
Type
::
Channel
;
this
->
bridge
.
send_muc_leave
(
iid
,
*
user
,
txt
,
self
,
false
);
this
->
bridge
.
send_muc_leave
(
iid
,
*
user
,
txt
,
self
,
false
,
{},
this
);
channel
->
remove_user
(
user
);
}
}
...
...
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