Commit Graph
76 Commits
Author SHA1 Message Date
Florent Le Coz 60569993b4 Make the password work when we join our first channel on that server
Because we need to wait for the welcome message, when we connect to the
server, before sending the JOIN command, we need to also save the value of
the password to reuse it when we actually send the JOIN command
2015-01-14 13:48:34 +01:00
Emmanuel Gil Peyrot e4fcbd3030 Add support for password-protected IRC rooms. 2015-01-14 12:38:46 +01:00
Florent Le Coz e2e2f30894 Remove a dummy commented line 2015-01-12 22:57:08 +01:00
Florent Le Coz b79dbefbe7 If we sent a message to a user, their notices are considered private messages
fix #2882
2015-01-12 22:50:06 +01:00
Florent Le Coz d8da7984b2 Implement PING, user to user only (XMPP and IRC side, using CTCP PING)
ref #2757
2014-11-12 08:12:43 +01:00
Florent Le Coz e1d69806ed Rename iq_responder_callback_t to irc_… and add the equivalent to wait for iqs 2014-11-12 06:17:25 +01:00
Florent Le Coz 41e8a3ba9b Send a proper error on IRC message 438 (nickname change too fast)
fix #2576
2014-08-08 00:47:05 +02:00
Florent Le Coz e3ea0d62c7 Use generic send_presence_error() instead of almost identical specializations 2014-08-08 00:46:27 +02:00
Florent Le Coz 11a31db2d5 Send the reason of the connection close to the user 2014-07-15 15:39:25 +02:00
Florent Le Coz 04d999168a Add a level of inheritance above SocketHandler
SocketHandler has been renamed to TCPSocketHandler
SocketHandler is now a simple interface with a few methods, used only by
Poller.

This way we can inherite from the new SocketHandler class, to handle other
types of sockets, and still make them manageable by the poller without any
change in the Poller class.
2014-07-02 03:01:09 +02:00
Florent Le Coz 26ffc8fe12 Implement a way to add callbacks, waiting for an IRC event to return an iq 2014-06-19 22:21:49 +02:00
Florent Le Coz a705b9af7b Remove a duplicate “connection closed” message 2014-06-19 01:10:13 +02:00
Florent Le Coz 7c1a38999c Rewrite the whole IID usage
IRC users and channels are now distinguished by the separator used in the
IID (% or !).

ref #2468
2014-06-11 02:37:11 +02:00
Florent Le Coz 23f32ba39e Implement TLS support using Botan
For now, it tries two TLS ports and then connects to the non-tls port.  In
the future we would like the user to be able to configure that.

fix #2435
2014-06-08 05:07:54 +02:00
Florent Le Coz c2311b2893 Send (every 240s) a PING command to all connected irc servers
fix #2452
2014-05-30 16:08:23 +02:00
Florent Le Coz 6c2d03da4e Send an error presence when the connection to the IRC server fails 2014-05-28 01:27:41 +02:00
Florent Le Coz 34739728f9 Fix a by-one error in the CHANTYPES parsing 2014-05-27 02:35:39 +02:00
Florent Le Coz aea923bcb9 Use the CHANTYPES values to differentiate channel or user notices
It also happens to fix #2517 because this used to create buggy channels
named "auth" and stuf like that.
2014-05-27 02:30:11 +02:00
Florent Le Coz 796af0531e Add support for CHANTYPES isupport element, to know the prefixes of channels 2014-05-27 02:17:58 +02:00
Florent Le Coz 5507adbe94 SocketHandlers own the poller and add themself into it only when the socket is created
We want to call socket() with the parameters provided by getaddrinfo, so we
can’t addd the fd into the poller immediately. We need to wait the
connection attempt, and then the SocketHandler can call add_socket_handler
itself, if the connection succeeds, or is in progress.
2014-05-27 01:01:44 +02:00
Florent Le Coz 579ca4bdb6 Forward iq version results to IRC 2014-05-07 02:02:47 +02:00
Florent Le Coz 5ec05cb0ed Forward CTCP version request to XMPP 2014-05-06 22:50:37 +02:00
Florent Le Coz f6e6b8905b Use C++14 string_literals 2014-04-29 21:50:13 +02:00
Florent Le Coz c6059e5a21 Upgrade to C++14 2014-04-28 18:46:25 +02:00
Florent Le Coz 77a84fd2d9 NOTICE from channels are displayed in the channel, with a green "[notice]" 2014-04-25 00:35:57 +02:00
Florent Le Coz 3bc6f18347 Add an explanatory topic on the dummy channel 2014-04-15 05:22:32 +02:00
Florent Le Coz 28065d3d52 Do not disconnect from the IRC server if the dummy channel is joined 2014-04-15 05:08:07 +02:00
Florent Le Coz 5739d418e2 Better way to leave the dummy room 2014-04-15 04:56:50 +02:00
Florent Le Coz cfca16bbec Ability to leave the dummy channel 2014-04-15 04:44:51 +02:00
Florent Le Coz 576fb3d132 Correctly use the dummy channel whenever we interract with an empty-string chan 2014-04-15 04:44:09 +02:00
Florent Le Coz 020325dbb0 [WIP] DummyIrcChannel 2014-04-13 15:37:56 +02:00
Florent Le Coz e971f64f92 Catch all exception produced by a received message (irc or xmpp) 2014-03-28 01:47:48 +01:00
Florent Le Coz e196d2f1f4 Do not send data if we are connected, send it only once we actually are 2014-03-24 18:37:31 +01:00
Florent Le Coz 86d4347af8 Avoid unnecessary copies by recv()ing data directly into the expat buffer 2014-02-28 01:14:38 +01:00
Florent Le Coz 76b131e13a Do not try to connect to an irc server if we are connected or connecting 2014-02-25 02:10:45 +01:00
Florent Le Coz 99aba5667d Connection to servers does not block the process anymore 2014-02-22 21:42:24 +01:00
Florent Le Coz 190c4ff176 QUIT the irc server when the last channel is left 2014-02-20 02:19:50 +01:00
Florent Le Coz 16be9af3fc Send unavailable presence to all muc when the IRC server closes the connection 2014-02-19 23:59:43 +01:00
Florent Le Coz 112197f6ab Fix the joined flag on channels, avoid sending the topic twice when joining 2014-02-19 02:38:22 +01:00
Florent Le Coz cf9f3a1f28 Include role and affiliation in the join presence of the nick change process 2014-02-17 01:43:58 +01:00
Florent Le Coz c8b41d5e35 Be verbose about IRC server connection failures, and handle them properly 2014-02-08 07:52:22 +01:00
Florent Le Coz fef9c8193d Also set the role and affiliation of users already in the chan 2014-01-06 01:22:43 +01:00
Florent Le Coz d90c1978de Fix a bug when receiving a topic change
The number of arguments is not always the same
2014-01-04 01:59:36 +01:00
Florent Le Coz fbec16f1a2 Possibility to change a channel's topic 2014-01-04 01:59:36 +01:00
Florent Le Coz e840704b58 Convert received modes into roles and affiliations 2014-01-04 01:59:36 +01:00
Florent Le Coz acf769d83a Use isupport informations to know the user modes when joining
Also remove the duplicate send_self_join methods, user only send_user_join
2014-01-04 01:59:36 +01:00
Florent Le Coz a075517824 Basic isupport support
CHANMODES and PREFIX only
2014-01-04 01:59:36 +01:00
Florent Le Coz 43cc60e4a9 Handle nickname conflicts by sending the correct XMPP error presence 2014-01-04 01:59:35 +01:00
Florent Le Coz e8e592d1ac Remove disconnected IrcClients 2014-01-04 01:59:35 +01:00
Florent Le Coz aa53276859 Keep a "connected" state in the SocketHandler class 2014-01-04 01:59:35 +01:00