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
5739d418
Commit
5739d418
authored
Apr 15, 2014
by
louiz’
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better way to leave the dummy room
parent
0d9c1ba3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
2 deletions
+26
-2
src/bridge/bridge.cpp
src/bridge/bridge.cpp
+3
-1
src/irc/irc_channel.cpp
src/irc/irc_channel.cpp
+6
-0
src/irc/irc_channel.hpp
src/irc/irc_channel.hpp
+1
-0
src/irc/irc_client.cpp
src/irc/irc_client.cpp
+11
-1
src/irc/irc_client.hpp
src/irc/irc_client.hpp
+5
-0
No files found.
src/bridge/bridge.cpp
View file @
5739d418
...
...
@@ -44,7 +44,9 @@ void Bridge::shutdown()
{
for
(
auto
it
=
this
->
irc_clients
.
begin
();
it
!=
this
->
irc_clients
.
end
();
++
it
)
{
it
->
second
->
send_quit_command
(
"Gateway shutdown"
);
const
std
::
string
exit_message
(
"Gateway shutdown"
);
it
->
second
->
send_quit_command
(
exit_message
);
it
->
second
->
leave_dummy_channel
(
exit_message
);
}
}
...
...
src/irc/irc_channel.cpp
View file @
5739d418
...
...
@@ -48,6 +48,12 @@ void IrcChannel::remove_user(const IrcUser* user)
}
}
void
IrcChannel
::
remove_all_users
()
{
this
->
users
.
clear
();
this
->
self
.
reset
();
}
DummyIrcChannel
::
DummyIrcChannel
()
:
IrcChannel
(),
joining
(
false
)
...
...
src/irc/irc_channel.hpp
View file @
5739d418
...
...
@@ -24,6 +24,7 @@ public:
const
std
::
map
<
char
,
char
>
prefix_to_mode
);
IrcUser
*
find_user
(
const
std
::
string
&
name
)
const
;
void
remove_user
(
const
IrcUser
*
user
);
void
remove_all_users
();
protected:
std
::
unique_ptr
<
IrcUser
>
self
;
...
...
src/irc/irc_client.cpp
View file @
5739d418
...
...
@@ -199,7 +199,7 @@ void IrcClient::send_part_command(const std::string& chan_name, const std::strin
if
(
channel
->
joined
==
true
)
{
if
(
chan_name
.
empty
())
this
->
bridge
->
send_muc_leave
(
Iid
(
std
::
string
(
"%"
)
+
this
->
hostname
),
std
::
string
(
this
->
current_nick
),
""
,
tru
e
);
this
->
leave_dummy_channel
(
status_messag
e
);
else
this
->
send_message
(
IrcMessage
(
"PART"
,
{
chan_name
,
status_message
}));
}
...
...
@@ -652,3 +652,13 @@ DummyIrcChannel& IrcClient::get_dummy_channel()
{
return
this
->
dummy_channel
;
}
void
IrcClient
::
leave_dummy_channel
(
const
std
::
string
&
exit_message
)
{
if
(
!
this
->
dummy_channel
.
joined
)
return
;
this
->
dummy_channel
.
joined
=
false
;
this
->
dummy_channel
.
joining
=
false
;
this
->
dummy_channel
.
remove_all_users
();
this
->
bridge
->
send_muc_leave
(
Iid
(
std
::
string
(
"%"
)
+
this
->
hostname
),
std
::
string
(
this
->
current_nick
),
exit_message
,
true
);
}
src/irc/irc_client.hpp
View file @
5739d418
...
...
@@ -198,6 +198,11 @@ public:
* Get a reference to the unique dummy channel
*/
DummyIrcChannel
&
get_dummy_channel
();
/**
* Leave the dummy channel: forward a message to the user to indicate that
* he left it, and mark it as not joined.
*/
void
leave_dummy_channel
(
const
std
::
string
&
exit_message
);
const
std
::
string
&
get_hostname
()
const
{
return
this
->
hostname
;
}
std
::
string
get_nick
()
const
{
return
this
->
current_nick
;
}
...
...
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