Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
louiz’
biboumi
Commits
464261d4
Commit
464261d4
authored
Apr 11, 2016
by
louiz’
Browse files
Support RPL_NOTPIC and 005
parent
606700f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/irc/irc_client.cpp
View file @
464261d4
...
...
@@ -34,6 +34,7 @@ static const std::unordered_map<std::string,
{
"NOTICE"
,
{
&
IrcClient
::
on_notice
,
{
2
,
0
}}},
{
"002"
,
{
&
IrcClient
::
forward_server_message
,
{
2
,
0
}}},
{
"003"
,
{
&
IrcClient
::
forward_server_message
,
{
2
,
0
}}},
{
"004"
,
{
&
IrcClient
::
on_server_myinfo
,
{
4
,
0
}}},
{
"005"
,
{
&
IrcClient
::
on_isupport_message
,
{
0
,
0
}}},
{
"RPL_LISTSTART"
,
{
&
IrcClient
::
on_rpl_liststart
,
{
0
,
0
}}},
{
"321"
,
{
&
IrcClient
::
on_rpl_liststart
,
{
0
,
0
}}},
...
...
@@ -41,6 +42,8 @@ static const std::unordered_map<std::string,
{
"322"
,
{
&
IrcClient
::
on_rpl_list
,
{
0
,
0
}}},
{
"RPL_LISTEND"
,
{
&
IrcClient
::
on_rpl_listend
,
{
0
,
0
}}},
{
"323"
,
{
&
IrcClient
::
on_rpl_listend
,
{
0
,
0
}}},
{
"RPL_NOTOPIC"
,
{
&
IrcClient
::
on_empty_topic
,
{
0
,
0
}}},
{
"331"
,
{
&
IrcClient
::
on_empty_topic
,
{
0
,
0
}}},
{
"RPL_MOTDSTART"
,
{
&
IrcClient
::
empty_motd
,
{
0
,
0
}}},
{
"375"
,
{
&
IrcClient
::
empty_motd
,
{
0
,
0
}}},
{
"RPL_MOTD"
,
{
&
IrcClient
::
on_motd_line
,
{
2
,
0
}}},
...
...
@@ -594,6 +597,10 @@ void IrcClient::on_isupport_message(const IrcMessage& message)
}
}
void
IrcClient
::
on_server_myinfo
(
const
IrcMessage
&
)
{
}
void
IrcClient
::
send_gateway_message
(
const
std
::
string
&
message
,
const
std
::
string
&
from
)
{
this
->
bridge
.
send_xmpp_message
(
this
->
hostname
,
from
,
message
);
...
...
@@ -690,6 +697,15 @@ void IrcClient::empty_motd(const IrcMessage&)
this
->
motd
.
erase
();
}
void
IrcClient
::
on_empty_topic
(
const
IrcMessage
&
message
)
{
const
std
::
string
chan_name
=
utils
::
tolower
(
message
.
arguments
[
message
.
arguments
.
size
()
-
1
]);
log_debug
(
"empty topic for "
<<
chan_name
);
IrcChannel
*
channel
=
this
->
get_channel
(
chan_name
);
if
(
channel
)
channel
->
topic
.
clear
();
}
void
IrcClient
::
on_motd_line
(
const
IrcMessage
&
message
)
{
const
std
::
string
body
=
message
.
arguments
[
1
];
...
...
src/irc/irc_client.hpp
View file @
464261d4
...
...
@@ -143,6 +143,10 @@ public:
* http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt
*/
void
on_isupport_message
(
const
IrcMessage
&
message
);
/**
* Does nothing yet. Isn’t that duplicating features from 005?
*/
void
on_server_myinfo
(
const
IrcMessage
&
message
);
/**
* Just empty the motd we kept as a string
*/
...
...
@@ -194,6 +198,10 @@ public:
* Save the topic in the IrcChannel
*/
void
on_topic_received
(
const
IrcMessage
&
message
);
/**
* Empty the topic
*/
void
on_empty_topic
(
const
IrcMessage
&
message
);
/**
* The channel has been completely joined (self presence, topic, all names
* received etc), send the self presence and topic to the XMPP user.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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