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
98
Issues
98
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
532228a3
Commit
532228a3
authored
Sep 18, 2015
by
louiz’
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Send a PASS IRC command if the “pass” config is sot by a user, on an IRC server
fix
#3068
parent
1691cf8f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
src/irc/irc_client.cpp
src/irc/irc_client.cpp
+12
-0
src/irc/irc_client.hpp
src/irc/irc_client.hpp
+1
-0
No files found.
src/irc/irc_client.cpp
View file @
532228a3
#include <utils/timed_events.hpp>
#include <database/database.hpp>
#include <irc/irc_message.hpp>
#include <irc/irc_client.hpp>
#include <bridge/bridge.hpp>
...
...
@@ -94,6 +95,12 @@ void IrcClient::on_connection_failed(const std::string& reason)
void
IrcClient
::
on_connected
()
{
#ifdef USE_DATABASE
auto
options
=
Database
::
get_irc_server_options
(
this
->
bridge
->
get_bare_jid
(),
this
->
get_hostname
());
if
(
!
options
.
pass
.
value
().
empty
())
this
->
send_pass_command
(
options
.
pass
.
value
());
#endif
this
->
send_nick_command
(
this
->
username
);
this
->
send_user_command
(
this
->
username
,
this
->
username
);
this
->
send_gateway_message
(
"Connected to IRC server"
s
+
(
this
->
use_tls
?
" (encrypted)"
:
""
)
+
"."
);
...
...
@@ -218,6 +225,11 @@ void IrcClient::send_nick_command(const std::string& nick)
this
->
send_message
(
IrcMessage
(
"NICK"
,
{
nick
}));
}
void
IrcClient
::
send_pass_command
(
const
std
::
string
&
password
)
{
this
->
send_message
(
IrcMessage
(
"PASS"
,
{
password
}));
}
void
IrcClient
::
send_kick_command
(
const
std
::
string
&
chan_name
,
const
std
::
string
&
target
,
const
std
::
string
&
reason
)
{
this
->
send_message
(
IrcMessage
(
"KICK"
,
{
chan_name
,
target
,
reason
}));
...
...
src/irc/irc_client.hpp
View file @
532228a3
...
...
@@ -85,6 +85,7 @@ public:
* Send the NICK irc command
*/
void
send_nick_command
(
const
std
::
string
&
username
);
void
send_pass_command
(
const
std
::
string
&
password
);
/**
* Send the JOIN irc command.
*/
...
...
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