Commit Graph
100 Commits
Author SHA1 Message Date
Florent Le Coz 0d9c1ba313 Merge branch 'master' into dummy_chan 2014-04-15 04:45:59 +02:00
Florent Le Coz 804b686f1c Fix the leave-muc presence stanza 2014-04-15 04:45:20 +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 7f74f62e56 Merge branch 'master' into dummy_chan 2014-04-15 04:11:27 +02:00
Florent Le Coz c64bb0bde9 Improved doc rule in the cmake thing 2014-04-13 20:28:42 +02:00
Florent Le Coz 8246849fdf Do not link with pthread 2014-04-13 19:16:18 +02:00
Florent Le Coz 020325dbb0 [WIP] DummyIrcChannel 2014-04-13 15:37:56 +02:00
Florent Le Coz d2a7fd129a Do not print an error message from expat if the error was "parsing finished" 2014-04-11 23:34:42 +02:00
Florent Le Coz f00f5c3ffb Do not use exceptions for missing tags, improvement in code simplicity 2014-04-11 23:06:13 +02:00
Florent Le Coz a20c60a0d8 Messages coming from the IRC server are of type "chat" 2014-04-10 20:11:17 +02:00
Florent Le Coz 65601a96d2 The default type for message stanza is "normal" 2014-03-28 01:48:08 +01: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 44b72b743e The absence of a from attribute is an unrecoverable error, just ignore it 2014-03-28 01:47:05 +01:00
Florent Le Coz 3c5f823621 Send a stanza error when receiving bad stanzas
Whether this is a bad-request (missing XML attributes or elements) or an
internal server error.
2014-03-28 01:16:05 +01:00
Florent Le Coz 2ffbfb71dd Idem 2014-03-24 21:29:46 +01:00
Florent Le Coz 1208ba2524 Use the correct type of error 2014-03-24 21:29:12 +01:00
Florent Le Coz e47b164a43 Send an error presence whenever a user tries to join an invalid room 2014-03-24 21:08:09 +01:00
Florent Le Coz cdc3183d9e Introduce two new bool, to know if the xmpp component should try to reconnect
If we never succeeded our connection+auth process, means we should probably
not attempt any-more, and just give up.  If we ever did, this means a
reconnect is a good idea
2014-03-24 20:39:59 +01:00
Florent Le Coz ffc820e234 Reconnected immediately to the XMPP whenever it closes the connection 2014-03-24 20:31:02 +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 3b1bf740a3 Fix the CMakeLists.txt regarding ronn 2014-03-14 01:34:35 +01:00
Florent Le Coz 930696e48a Remove useless cast 2014-03-10 00:12:42 +01:00
Florent Le Coz 601159e8e2 Fix a bus error by not going above an array boundary 2014-03-03 21:02:55 +01:00
Florent Le Coz db6ea52b44 Provide details about what error the XML parser encountered 2014-02-28 01:18:21 +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 df774d45a9 Use scatter/gather io with sendmsg to avoid concataning strings all the time 2014-02-27 23:43:05 +01:00
Florent Le Coz e2b9e80244 Fix a wrong comment 2014-02-26 01:15:44 +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 f6029d5bcf Add missing stdexcept includes 2014-02-24 21:03:51 +01:00
Florent Le Coz 5f82c93754 Use store() instead of operator=() for std::atomic<bool> objects 2014-02-24 21:02:21 +01:00
Florent Le Coz 541af5236e Consider that the connect() succeded if errno EISCONN
Apparently on some systems, subsquent connect() calls may fail with EISCONN
error, to indicate that the connection succeded in the background, instead
of returning 0.
2014-02-22 23:36:03 +01:00
Florent Le Coz 730cc6e1bd Save the addrinfo values for reuse on subsequent connect() call 2014-02-22 23:35:14 +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 61ca40fa0e Delete empty bridges objects 2014-02-20 02:31:16 +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 e390b79a12 Do not receive SIGPIPE when send() is called on a closed socket
The error is handled using the return value
2014-02-20 00:00:05 +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 aeae88dd32 Move CMake’s config.h(.cmake) files into src/ 2014-02-19 02:49:22 +01:00
Florent Le Coz 6804f31546 Set sigaction.sa_flags to 0 2014-02-19 02:38:58 +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 8fd2746696 Reload the conf on SIGUSR1/2 2014-02-19 02:24:00 +01:00
Florent Le Coz 754dd898a7 Fix a typo in Find* comments 2014-02-19 01:48:55 +01:00
Florent Le Coz 293cab0d37 Fix FindIconv cmake module to correctly compile the c++ test code 2014-02-19 01:11:46 +01:00
Florent Le Coz e43de640e9 Build the man page as part of the build process, if ronn is found 2014-02-17 03:07:27 +01:00
Florent Le Coz c5b4be0e17 Little man page update 2014-02-17 02:31:14 +01:00
Florent Le Coz 7cfc79179c Make install rule 2014-02-17 02:12:12 +01:00
Florent Le Coz 6700d5daf2 Fix quit messages not being sent to XMPP 2014-02-17 01:56: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 abcf16bc28 Log (xmpp) stream-level errors 2014-02-17 01:31:19 +01:00
Florent Le Coz 6dbf36b974 Revert "Do not include an empty item XML element in join presences"
This reverts commit e3b91475ff.
2014-02-17 01:21:38 +01:00
Florent Le Coz 274859c096 Handle most generic error IRC messages 2014-02-08 08:22:42 +01:00
Florent Le Coz d46e7ee8c9 Enable TCP keepalive on sockets 2014-02-08 08:14:24 +01:00
Florent Le Coz eb2a2e75c2 Add missing logger include 2014-02-08 08:14:08 +01:00
Florent Le Coz e3b91475ff Do not include an empty item XML element in join presences 2014-02-08 08:04:33 +01:00
Florent Le Coz da85617428 Use strerror and log_error instead of perrror 2014-02-08 07:59:02 +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 de7b3503a4 Jidprep also handles the resource part 2014-01-28 03:30:12 +01:00
Florent Le Coz b71547a32b Fix the build system to correctly include config.h 2014-01-14 21:45:56 +01:00
Florent Le Coz d1c6d64546 Add missing stdexcept includes 2014-01-13 20:19:10 +01:00
Florent Le Coz feb77bbdad Do not change the affiliation/role to "none"/"participant" when changing nick
fixes #2436
2014-01-13 20:14:12 +01:00
Florent Le Coz af2d232059 Little README fixes 2014-01-13 20:11:36 +01:00
Florent Le Coz 48b4f7b83f Remove cryptopp dependency, directly include a simple sha1 implementation 2014-01-13 20:11:36 +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 7701c90763 Add missing errno.h includes 2014-01-04 02:48:08 +01:00
Florent Le Coz b513683041 Document the shutdown procedure 2014-01-04 02:04:38 +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 baf03a7e20 Do not throw an exception when recv returns and error, just close the socket 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
Florent Le Coz 483e17020d Be verbose about the connection status, and some errors 2014-01-04 01:59:35 +01:00
Florent Le Coz 9df757fc67 Handle topic changes 2014-01-04 01:59:35 +01:00
Florent Le Coz b8ce9ed43d Check that channels are joined before acting on objects in it 2014-01-04 01:59:34 +01:00
Florent Le Coz 3afb63a650 Shutdown cleanly on SIGINT 2014-01-04 01:59:14 +01:00
Florent Le Coz df59a09163 Do not mismatch password and hostname in the config error help message 2013-12-24 14:04:12 +01:00
Florent Le Coz 983477084c connect() returns a boolean 2013-12-24 14:03:40 +01:00
Florent Le Coz 2ecb637f0c Read a variable number of bytes, 4096 by default 2013-12-23 17:07:43 +01:00
Florent Le Coz e35472a6cb Correctly send the part message to IRC
By fixing a namespace when looking for an XML element containing that message
2013-12-23 17:02:46 +01:00
Florent Le Coz 7d8ce3b563 Use XML-sanitized strings when serializing stanzas for the XMPP server 2013-12-15 00:34:30 +01:00
Florent Le Coz 3960e4d5af Functions to provide xml-valid strings
By removing invalid chars, see http://www.w3.org/TR/xml/#charsets
2013-12-15 00:34:13 +01:00
Florent Le Coz b29290f73a Lowercase the chan names in two missing cases 2013-12-09 03:53:01 +01:00
Florent Le Coz bb094e5058 Document the log_file and log_level configuration options 2013-12-08 20:33:36 +01:00
Florent Le Coz 2aa868c7cc Document the bare-JID-for-IRC-users feature 2013-12-08 20:28:57 +01:00
Florent Le Coz 8e2dd573bb Provide the doc in markdown format
The included man page is now generated from this markdown file, using ronn
2013-12-08 20:23:35 +01:00
Florent Le Coz b11126a19d Provide a JID for IRC users, and add a stringprep dependency for this 2013-12-08 20:14:12 +01:00
Florent Le Coz cb718def0c Put utils::tolower definition in its own cpp file 2013-12-08 18:02:24 +01:00
Florent Le Coz fb01f78b0a Rewrite the FindIconv module cleanly 2013-12-08 15:57:10 +01:00
Florent Le Coz 2c9680bc03 Rewrite the FindCryptopp cmake module cleanly 2013-12-08 15:57:06 +01:00
Florent Le Coz e2117bcb0a Enforce a simple limit of 400 bytes for IRC messages body
The limit for the whole message is 512 bytes, we limit the body to 400
(instead of doing a calculation based on the command name and the other
parameters), because it's simple, easy and that’s enough.

fixes #2416
2013-12-08 04:47:05 +01:00
Florent Le Coz 6fa548a194 Display all the MODE arguments in the message 2013-12-03 19:56:57 +01:00
Florent Le Coz a4c845ab6c Use the logger everywhere 2013-12-03 19:15:37 +01:00
Florent Le Coz 2662ed89e2 Add a logger class 2013-12-03 19:15:37 +01:00
Florent Le Coz 6bd176f15e Fix a parenthesis ambiguity 2013-12-03 18:49:43 +01:00
Florent Le Coz 050cf1fd60 xml-escape the tail in an XmlNode 2013-12-02 13:15:51 +01:00
Florent Le Coz d6832fbcc9 :3 2013-11-28 21:09:27 +01:00