Commit Graph

165 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron ffbf8d5faa Convert acl to exmpp.
SVN Revision: 1398
2008-07-01 09:41:32 +00:00
Jean-Sébastien Pédron f55274c7fb o Use jlib:short_bare_jid/1.
o  Rewrite is_auth_packet/1 to use new formats.
o  Don't convert <presence/> before calling ejabberd_sm:set_presence/7.
o  Don't convert broadcast children, because it's an internal special
element.

SVN Revision: 1397
2008-07-01 09:17:48 +00:00
Jean-Sébastien Pédron 8c33e12616 Use the new clause of exmpp_stanza:reply_with_error/2, exmpp_iq:error/2,
exmpp_iq:error_without_original/2 and the new exmpp_jid:make_bare_jid/1.

SVN Revision: 1394
2008-07-01 08:01:06 +00:00
Jean-Sébastien Pédron 06965000a5 Before doing any routing, the router print a warning if old structures
are used. Then it converts the structures to the old format and route
them. The router doesn't care about the structures format but the
conversion is necesary for code called from this module.

In C2S and S2S, no conversion is done before calling
ejabberd_router:route/3.

SVN Revision: 1392
2008-06-30 16:55:03 +00:00
Jean-Sébastien Pédron cc033b3b98 o Use the new functions from jlib.
o  Use the new exmpp_xml:node_to_list/3.

SVN Revision: 1391
2008-06-30 15:51:23 +00:00
Jean-Sébastien Pédron d05c2ee8a1 Use -include_lib instead of -include to include exmpp.hrl. This is a
better solution than specifying the path (with -I) on erlc(1) command
line.

SVN Revision: 1388
2008-06-30 12:13:15 +00:00
Jean-Sébastien Pédron b32aba27c1 o Use the new exmpp namespace macro names.
o  Update send_element/2 to use exmpp new to_list functions.

SVN Revision: 1384
2008-06-27 13:46:08 +00:00
Jean-Sébastien Pédron 1a311a30b5 o Use a macro in ?DEFAULT_NS instead of the namespace atom directly.
o  Comment DBGFSM our again.
o  Remove macro ERR_SERVICE_UNAVAILABLE.
o  In wait_for_auth and is_auth_packet, an empty resource is returned as
'undefined', not the empty string in the {auth, ...} tuple.
o  In handle_sync_event, remove a debugging printf.
o  In handle_info({route, ...}), use macro IS_PRESENCE & friends instead
of direct matching with NS_JABBER_CLIENT and name. This way, the S2S
doesn't have to change the namespace of all its incoming stanzas to
NS_JABBER_CLIENT.
o  In send_element, for stanzas under the NS_JABBER_SERVER namespace, lie
to exmpp_xml by telling it that this namespace is the default one.

SVN Revision: 1382
2008-06-26 15:47:21 +00:00
Jean-Sébastien Pédron 999f3233bb Fix short JID comparison in get_subscribed_and_online; it was using
'undefined' instead of empty strings.

SVN Revision: 1381
2008-06-25 13:27:03 +00:00
Jean-Sébastien Pédron 07651d712f Finish ejabberd_c2s conversion with the functions related to offline
stanzas.

SVN Revision: 1380
2008-06-25 12:37:45 +00:00
Jean-Sébastien Pédron 6f931ce4fd Convert all presence-related functions.
SVN Revision: 1378
2008-06-24 16:12:56 +00:00
Jean-Sébastien Pédron e93e846e16 o Use the new exmpp_stream:opening_reply/3 function in wait_for_stream/2.
o  The function terminate/3 is converted to exmpp.

SVN Revision: 1377
2008-06-24 09:44:56 +00:00
Jean-Sébastien Pédron 4e2e68a3fb The handle_info clause that treats routing order is now converted.
In-memory sets and dict still use the short JID form with empty strings
for unspecified fields. Users are able to connect to ejabberd but some
features don't seem to work proprerly.

SVN Revision: 1376
2008-06-24 08:55:24 +00:00
Jean-Sébastien Pédron e95df7999f Convert JID to the expected form outside of the C2S (empty fields must
be set to the empty string). This fixes the broken routing.

SVN Revision: 1375
2008-06-23 11:47:10 +00:00
Jean-Sébastien Pédron 2a43998444 o Change the usage of #state.lang somewhat.
o  Fix value of DefaultLang: it doesn't contain the whole serialized
attribute.
o  Use exmpp_jid:make_bare_jid/2 more.

I started to work on the second half of the module and discovered
several annoying things:
o  JID are represented in two forms: the #jid record and the
{N, D, R} tuple.
o  Sometimes, #xmlelement may contain non-#xml* tuples in their
children. This is the case for some <presence/> stanzas. Their
children are used to pass random data.
I'm less and less convicted that ejabberd_c2s can be fully converted
without starting to work on other modules.

SVN Revision: 1370
2008-06-20 14:54:59 +00:00
Jean-Sébastien Pédron 389b5e6448 First bunch of modifications to use exmpp. All FSM state function are
updated. But other functions are not for now.

Users are able to connect to ejabberd but some features may not work.

SVN Revision: 1368
2008-06-20 12:52:29 +00:00
Badlop ff94e586eb * src/ejabberd_c2s.erl: Bugfix: deliver messages when first
presence is Invisible (thanks to Dariusz Markowicz)(EJAB-262)

SVN Revision: 1348
2008-06-09 23:43:47 +00:00
Mickaël Rémond cf42ea0bcb * src/ejabberd_c2s.erl: user_send_packet hook now called on all packets including presence packets (EJAB-634)
SVN Revision: 1341
2008-05-22 10:19:35 +00:00
Mickaël Rémond a664579b58 * src/ejabberd_c2s.erl: Added C2S blacklist support (EJAB-625).
* src/mod_ip_blacklist.erl: Likewise.
* src/jlib.erl: Added IP format tuple to string function.
* src/ejabberd_socket.erl: Properly handled c2s start failure (happen for blacklisted IP).

SVN Revision: 1317
2008-05-05 16:22:06 +00:00
Badlop c88a4650ba * src/ejabberd_c2s.erl: Added forbidden_session_hook
* src/acl.erl: New access types: resource, resource_regexp and
resource_glob
* doc/guide.tex: Likewise

SVN Revision: 1301
2008-04-25 09:25:31 +00:00
Alexey Shchepin 797544333c * src/mod_register.erl: Restrict registration frequency per IP or
user
* src/ejabberd_c2s.erl: Pass IP to the c2s_unauthenticated_iq hook
* src/ejabberd_config.erl: Added registration_timeout option
* src/treap.erl: Treaps implementation

SVN Revision: 1299
2008-04-22 21:51:32 +00:00
Badlop 96f0c001d9 * src/ejabberd_auth.erl: Improve anonymous authentication to not
remove rosters accidentally (EJAB-549). New functions in
ejabberd_auth to get/check password and know which module accepted
the authentication. New element 'auth_module' in ejabberd_c2s
record 'statedata'. Cyrsasl provides a new property in the
response: {auth_module, AuthModule}.
* src/ejabberd_auth_anonymous.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/cyrsasl_anonymous.erl: Likewise
* src/cyrsasl_digest.erl: Likewise
* src/cyrsasl_plain.erl: Likewise

SVN Revision: 1297
2008-04-22 17:41:30 +00:00
Mickaël Rémond b8b2bde8d0 *src/ejabberd_c2s.erl: Uniform default value for empty privacy list. Fixes (EJAB-603).
SVN Revision: 1281
2008-04-10 08:14:38 +00:00
Badlop 2c8cc8ae2d * src/ejabberd_c2s.erl (process_presence_probe): Don't route a
presence probe to oneself (EJAB-498)

SVN Revision: 1275
2008-04-03 22:35:26 +00:00
Christophe Romain 56e9971435 Bug in get_conn_type since SVN r1194 crashes http-bind and http-poll (thanks to Brian Cully) (EJAB-526)
SVN Revision: 1197
2008-02-18 09:55:06 +00:00
Christophe Romain 04d688c1ba Retreive connection type in sm_register_connection_hook
SVN Revision: 1194
2008-02-15 16:35:32 +00:00
Badlop 2d2fcc8210 * doc/guide.tex: Updated copyright dates to 2008
* src/*: Likewise

SVN Revision: 1153
2008-01-15 17:02:57 +00:00
Christophe Romain 20c27ea9d9 EJAB-491 fix
SVN Revision: 1145
2008-01-11 01:39:10 +00:00
Christophe Romain b3bf437dd1 Send last published PEP event now checks the correct peer caps (EJAB-491)
SVN Revision: 1143
2008-01-10 15:02:54 +00:00
Mickaël Rémond 56fe3579bb * Applied copyright update patch 1.
SVN Revision: 1110
2007-12-24 11:41:41 +00:00
Christophe Romain 02eaf9eaec several pubsub/pep bugfix
SVN Revision: 1096
2007-12-22 00:04:05 +00:00
Badlop 60ea99d1a3 * src/ejabberd_c2s.erl: Increase the timeout of open socket
without authentication to 60 seconds because many Jabber clients
are not yet capable of handling this correctly (EJAB-355)

SVN Revision: 1040
2007-12-06 17:42:25 +00:00
Alexey Shchepin c3c782d882 * src/mod_caps.erl: CAPS support (thanks to Magnus Henoch)
* src/ejabberd_local.erl: Support for IQ responses
* src/jlib.erl: Added iq_query_or_response_info/1 function
* src/jlib.hrl: Added NS_PUBSUB_ERRORS and NS_CAPS

* src/mod_pubsub/Makefile.in: New pubsub+pep implementation
(thanks to Christophe Romain and Magnus Henoch)
* src/ejabberd_sm.erl: Added get_session_pid/3 function
* src/ejabberd_c2s.erl: Added get_subscribed_and_online/1 function

SVN Revision: 1004
2007-12-01 05:16:30 +00:00
Jérôme Sautret 96ded4535d * src/ejabberd_s2s.erl: don't use the resource of the sender to choose
a s2s connection to ensure that a muc room always uses the same
connection

Merge branch 'ejabberd_s2s'

Conflicts:

.gitignore
src/configure
src/ejabberd_c2s.erl
src/ejabberd_s2s.erl

SVN Revision: 963
2007-10-30 17:38:40 +00:00
Mickaël Rémond fd666398ee * src/ejabberd_c2s.erl: Added debug hook for c2s loop (EJAB-358).
SVN Revision: 946
2007-09-14 14:20:56 +00:00
Mickaël Rémond 8d3d59535d * src/ejabberd_c2s.erl: Hibernate inactive c2s processes (EJAB-356).
SVN Revision: 934
2007-09-14 14:18:01 +00:00
Mickaël Rémond f787a3ed71 * src/ejabberd_c2s.erl: Implements timeouts during session opening negociation (EJAB-355).
SVN Revision: 933
2007-09-14 14:17:42 +00:00
Mickaël Rémond afec054544 * src/ejabberd_c2s.erl: Option to prevent the use of Erlang OTP supervisor for transient processes (EJAB-354).
* src/ejabberd_s2s_in.erl: Likewise.
* src/ejabberd_s2s_out.erl: Likewise.
* src/mod_muc/mod_muc_room.erl: Likewise.
* src/configure.ac: Likewise.
* src/configure: Likewise.
* src/Makefile.in: Likewise.
* src/mod_muc/Makefile.in: Likewise.

SVN Revision: 931
2007-09-14 14:16:36 +00:00
Alexey Shchepin 9a6e8e3c55 * src/ejabberd_sm.erl: Updated the session table to store
additional session info
* src/ejabberd_c2s.erl: Report IP address to ejabberd_sm (thanks
to Christophe Romain)

SVN Revision: 772
2007-05-21 03:21:34 +00:00
Alexey Shchepin 8c326ea928 * src/mod_muc/mod_muc_room.erl: Corrected error messages when
trying to join members-only room (thanks to Badlop)

* src/ejabberd_c2s.erl: Added c2s_update_presence hook

SVN Revision: 770
2007-05-16 10:13:04 +00:00
Alexey Shchepin 372944df6c * src/ejabberd_sm.erl: Added set_presence_hook
* src/ejabberd_c2s.erl: Likewise

SVN Revision: 761
2007-05-03 15:45:24 +00:00
Alexey Shchepin fa6b6b8f5a * src/ejabberd_socket.erl: Added API for monitoring socket
processes
* src/ejabberd_frontend_socket.erl: Likewise
* src/ejabberd_c2s.erl: Added socket monitoring

* src/mod_muc/mod_muc_room.erl: Fixed the stop reason for the
destroy event

SVN Revision: 751
2007-04-12 06:08:32 +00:00
Alexey Shchepin 379b0d9e54 * src/ejabberd_c2s.erl: Init shaper with a default value first
after stream opening

* src/ejabberd_c2s.erl: Log failed SASL login attempts
* src/cyrsasl.erl: Updated API
* src/cyrsasl_plain.erl: Likewise
* src/cyrsasl_digest.erl: Likewise

SVN Revision: 735
2007-02-19 23:35:42 +00:00
Alexey Shchepin bb2ffb8765 * src/ejabberd_c2s.erl: Bugfix
SVN Revision: 691
2006-12-08 20:34:34 +00:00
Mickaël Rémond cc07020d34 * src/ejabberd_c2s.erl: User login in with negative priority must not
receive offline messages (Thanks to Badlop) (EJAB-158).

SVN Revision: 683
2006-11-28 09:59:29 +00:00
Alexey Shchepin fa7693d355 * src/mod_privacy.erl: Use hooks instead of direct function calls
* src/ejabberd_c2s.erl: Updated

SVN Revision: 659
2006-10-05 03:17:41 +00:00
Alexey Shchepin c72599cacd * src/ejabberd_frontend_socket.erl: Support for frontend
connection manager
* src/ejabberd_c2s.erl: Likewise
* src/ejabberd_listener.erl: Likewise
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_service.erl: Likewise
* src/ejabberd_socket.erl: Likewise
* src/web/ejabberd_http_poll.erl: Likewise

SVN Revision: 657
2006-10-01 01:53:37 +00:00
Alexey Shchepin aa478100d8 * src/ejabberd_socket.erl: Support for non-xml sockets
* src/ejabberd_c2s.erl: Likewise
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_service.erl: Likewise
* src/web/ejabberd_http.erl: Likewise

SVN Revision: 629
2006-09-25 03:51:11 +00:00
Alexey Shchepin 4d7cc9301a * src/ejabberd_socket.erl: All XML socket operations moved here
* src/ejabberd_listener.erl: Updated
* src/ejabberd_receiver.erl: Likewise
* src/ejabberd_c2s.erl: Likewise
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_s2s_out.erl: Likewise
* src/ejabberd_service.erl: Likewise

* src/mod_shared_roster.erl: Bugfix

* src/mod_roster_odbc.erl: Bugfix

SVN Revision: 599
2006-09-05 04:26:28 +00:00
Mickaël Rémond 9b8dcac5a7 * src/ejabberd_c2s.erl: Bugfix: added a missing catch and fixed
the error code used on unknown namespace.
* src/ejabberd_s2s_out.erl: Improved s2s connection negociation
(dialback namespace usage) when using tls.
* src/ejabberd_sm.erl: Fixed the error code used on unknown
namespace.
* src/mod_register.erl: ejabberd now sends iq result and stream
end on user remove.

SVN Revision: 590
2006-07-28 16:18:50 +00:00