24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00
Commit Graph

209 Commits

Author SHA1 Message Date
Evgeniy Khramtsov
fd8e07af47 Get rid of ejabberd.hrl header
The header consisted of too many unrelated stuff and macros misuse.
Some stuff is moved into scram.hrl and type_compat.hrl.
All macros have been replaced with the corresponding function calls.

TODO: probably type_compat.hrl is not even needed anymore since
we support only Erlang >= OTP 17.5
2018-06-14 14:00:47 +03:00
Holger Weiss
3cf4fbc7b0 mod_roster: Use 'lserver' for configuration lookup 2018-04-13 00:12:07 +02:00
Evgeniy Khramtsov
bb20e5f3fa Apply some dirty hacks for mod_shared_roster
Probably this fixes #1846
2018-03-19 12:32:43 +03:00
Alexey Shchepin
e15595df64 Add 'new_sql_schema' config option, --enable-new-sql-schema now sets its default value to true (#2239) 2018-03-15 17:55:05 +03:00
Evgeniy Khramtsov
66fc1bf3b6 Remove 'iqdisc' option
Since we got rid of all bottle-neck processes and we have
a connection pool for every database, the option is no longer
needed and in fact is detrimental: in practice what you get
is just a bunch of overloaded processes in the IQ handlers pool
no matter how much you increase the `iqdisc` value.

Given that there are close to zero operators understanding
the meaning of the option and, hence, not using it all,
it's not simply deprecated but completely removed.

The commit also deprecates the following functions:
- gen_iq_handler:add_iq_handler/6
- gen_iq_handler:handle/5
- gen_iq_handler:iqdisc/1
2018-02-11 12:54:15 +03:00
Evgeniy Khramtsov
6e5439db5c Find and fix typos using 'codespell' 2018-01-27 19:35:38 +03:00
Evgeniy Khramtsov
4b012a99d2 Introduce option 'captcha' for mod_block_strangers
When the option is set to `true`, the module will generate
CAPTCHA challenges for incoming subscription requests. The option
also implies that option `drop` is set to `true`. Note that
the module won't generate CAPTCHA challenges for messages: they
will still be rejected if `drop` is set to `true`.

Fixes #2246
2018-01-26 15:02:06 +03:00
Evgeniy Khramtsov
ba2b650464 Introduce new gen_mod callback: mod_options/1
The callback is supposed to provide known options and their default
values, as long as the documentation. Passing default values into
get_mod functions is now deprecated: all defaults should be provided
by the Mod:mod_options/1 callback.
2018-01-23 10:54:52 +03:00
Evgeniy Khramtsov
cdc7c1d1ed Update copyright dates 2018-01-05 23:18:58 +03:00
Paweł Chmielowski
e6d1ff85f1 Use bare jid when processing roster subscriptions 2017-12-27 16:14:47 +01:00
Alexey Shchepin
78dfb832b8 Add SQL_INSERT macro and update SQL queries to use server_host field 2017-11-02 18:21:40 +03:00
Evgeniy Khramtsov
d7250111ce Reuse some translation strings 2017-09-24 14:32:37 +03:00
Badlop
101e808124 Fix warning in previous commit 2017-08-04 13:09:17 +02:00
Badlop
0516a3dc0e Remove unused 'managers' option, related to the deferred XEP-0321 (#1443) 2017-08-04 12:29:15 +02:00
Evgeniy Khramtsov
35d19b32f4 Implement cache for mod_privacy/mod_blocking 2017-05-20 22:36:32 +03:00
Evgeniy Khramtsov
fc794b680a Add cache options to the validator 2017-05-17 16:03:41 +03:00
Evgeniy Khramtsov
7165196211 Get rid of unused variable 2017-05-17 15:24:32 +03:00
Evgeniy Khramtsov
f782955c06 Implement cache for roster 2017-05-17 14:47:35 +03:00
Evgeniy Khramtsov
cf53d834e9 Introduce 'iqdisc' global option 2017-05-04 12:24:47 +03:00
Evgeniy Khramtsov
fddd6110e0 Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit:
* Now there is no need to pass validating function in
  gen_mod:get_opt() and gen_mod:get_module_opt() functions,
  because the modules' configuration keeps already validated values.
* New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are
  introduced.
* Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated.
  If the functions are still called, the "function" argument is
  simply ignored.
* Validating callback Mod:listen_opt_type/1 is introduced to validate
  listening options at startup.
2017-04-30 19:01:47 +03:00
Alexey Shchepin
069d28b1ed Get rid of p1_sha calls 2017-03-14 02:31:51 +03:00
Evgeniy Khramtsov
c1439ddd5b Get rid of jid:to_string/1 and jid:from_string/1 2017-02-26 10:07:12 +03:00
Evgeniy Khramtsov
603ec9cb19 Don't pass empty resource to jid:make() 2017-02-25 10:01:01 +03:00
Evgeniy Khramtsov
3c4057ff55 Reload modules when reloading configuration file 2017-02-22 19:46:47 +03:00
Evgeniy Khramtsov
940ca9311d Fix some dialyzer warnings 2017-02-18 09:36:27 +03:00
Evgeniy Khramtsov
8b2d308498 Change routing API
Now 'From' and 'To' arguments must be omitted in functions
and structures related to routing.
The commit deprecates the following functions:
     ejabberd_router:route/3 in favor of ejabberd_router:route/1
     ejabberd_router:route_error/4 in favor of ejabberd_router:route_error/2
     ejabberd_local:route_iq/4 in favor of ejabberd_local:route_iq/2
     ejabberd_local:route_iq/5 in favor of ejabberd_local:route_iq/3
The format of {route, From, To, Packet} is changed in favor of {route, Packet}
2017-02-16 11:10:24 +03:00
Evgeniy Khramtsov
435e5e6263 Make test suite working again 2017-01-23 13:51:05 +03:00
Evgeniy Khramtsov
d5d906184f Merge branch 'new_stream'
Conflicts:
	src/cyrsasl.erl
	src/ejabberd_c2s.erl
	src/ejabberd_cluster.erl
	src/ejabberd_frontend_socket.erl
	src/ejabberd_node_groups.erl
	src/ejabberd_router.erl
	src/mod_bosh.erl
	src/mod_ip_blacklist.erl
	src/mod_muc_mnesia.erl
	src/mod_offline.erl
	src/mod_proxy65_sm.erl
2017-01-20 19:35:46 +03:00
Evgeniy Khramtsov
0baaad30b1 Implement database backend interface for MUC, BOSH and auth_anonyous 2017-01-13 12:03:39 +03:00
Evgeniy Khramtsov
1e55e018e5 Adopt remaining code to support new hooks 2017-01-09 17:02:17 +03:00
Badlop
5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Evgeniy Khramtsov
309bdfbe28 Add xmpp_stream_out behaviour and rewrite s2s/SM code 2016-12-28 09:47:11 +03:00
Evgeniy Khramtsov
5cc8e807df Initial version of new XMPP stream behaviour (for review) 2016-12-11 15:03:37 +03:00
Christophe Romain
fbfbb96872 Improve ODBC import 2016-11-22 14:48:01 +01:00
Evgeniy Khramtsov
b8dcc911a3 Make common tests working again 2016-11-18 13:38:08 +03:00
Evgeniy Khramtsov
78a44e0176 Merge branch 'master' into xml-ng
Conflicts:
	src/adhoc.erl
	src/cyrsasl_oauth.erl
	src/ejabberd_c2s.erl
	src/ejabberd_config.erl
	src/ejabberd_service.erl
	src/gen_mod.erl
	src/mod_admin_extra.erl
	src/mod_announce.erl
	src/mod_carboncopy.erl
	src/mod_client_state.erl
	src/mod_configure.erl
	src/mod_echo.erl
	src/mod_mam.erl
	src/mod_muc.erl
	src/mod_muc_room.erl
	src/mod_offline.erl
	src/mod_pubsub.erl
	src/mod_stats.erl
	src/node_flat_sql.erl
	src/randoms.erl
2016-11-12 13:27:15 +03:00
Evgeniy Khramtsov
56c91d3c58 Add roster tests 2016-11-07 10:10:57 +03:00
Evgeniy Khramtsov
f6236d456d Add more tests for privacy lists and blocking command 2016-10-22 13:01:45 +03:00
Evgeniy Khramtsov
e987b88848 Make common tests working again 2016-09-13 12:30:05 +03:00
Evgeniy Khramtsov
31faa4eb9a Add more type specs 2016-08-12 13:17:42 +03:00
Evgeniy Khramtsov
522a186a38 Improve some type specs 2016-08-09 10:56:32 +03:00
Evgeniy Khramtsov
8b81b9ecb1 Rewrite PIEFXIS code to use XML generator 2016-08-04 13:37:07 +03:00
Evgeniy Khramtsov
9a8e197d7e Initial version based on XML generator 2016-07-18 15:01:32 +03:00
Evgeniy Khramtsov
4220a2b98c Make modules loading in a dependent order (#1191) 2016-07-06 14:58:48 +03:00
Paweł Chmielowski
3a8da27d86 Use {access,shaper}_rules_validator in other places where access rules are used 2016-06-21 13:18:24 +02:00
vthriller
f6ba91ff97 mod_roster should probably respect roster item changes introduced with roster_process_item hooks upon pushing 2016-05-19 13:45:42 +03:00
Evgeniy Khramtsov
9c369b7a8c Improve detection of databases supported by modules (#1092) 2016-04-27 17:10:50 +03:00
Evgeniy Khramtsov
398f1de5ae Clean mod_roster.erl from DB specific code 2016-04-14 10:58:32 +03:00
Evgeniy Khramtsov
fced8dc3d9 Replace some ?ERR_* macros with ?ERRT_* 2016-03-31 11:00:29 +03:00
Alexey Shchepin
79853ad44f Missed a few calls in previous commits 2016-03-02 02:00:02 +03:00
Alexey Shchepin
e21f25f5b9 Update more SQL queries 2016-03-02 00:12:49 +03:00
Alexey Shchepin
3d8219d8f9 Update mod_roster and ejabberd_auth_odbc SQL queries to the new API 2016-03-02 00:12:49 +03:00
Mickael Remond
dfc29ea03c Switch to Fast XML module 2016-02-03 19:03:17 +01:00
Evgeniy Khramtsov
b20db3b736 Initial version of migration script from Prosody to ejabberd 2016-01-28 14:23:51 +03:00
Badlop
f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Paweł Chmielowski
5c329a7699 Remove now() - part 1 2015-12-04 15:08:43 +01:00
Evgeniy Khramtsov
95265dd3ad Move JID related functions to jid.erl (#847) 2015-11-24 18:44:13 +03:00
Christophe Romain
6aeb9dcb38 cosmetic cleanup 2015-10-07 14:18:38 +02:00
Evgeniy Khramtsov
fb6267f38e Add config validation at startup 2015-06-01 15:38:27 +03:00
Badlop
0c725b5fac Document protocol support (EJABS-1620) 2015-05-21 17:04:05 +02:00
Badlop
b0b004b26e Revert "Add private and roster local handlers (EJAB-682)" due to #556
This reverts commit 2e194bd997.
2015-05-07 17:07:49 +02:00
Badlop
2e194bd997 Add private and roster local handlers to get listed in disco#info (EJAB-682) 2015-04-22 13:27:25 +02:00
Evgeniy Khramtsov
4af15df546 Add new 'default_db' option 2015-03-30 12:15:29 +03:00
Badlop
5a35405cd5 Update copyright dates to 2015 (EJAB-1733) 2015-01-08 17:34:43 +01:00
Christophe Romain
4205108f30 typo fix on roster subscription (EJAB-1711) 2014-07-31 11:50:22 +02:00
Evgeniy Khramtsov
792b5a24df Serialize records to proplists before storing then in Riak 2014-07-14 08:24:44 +04:00
Evgeniy Khramtsov
a5987633e0 Fix compile errors introduced by previous cherry picks 2014-07-10 14:16:33 +04:00
Evgeniy Khramtsov
6a73b96459 Fix roster versioning support when Riak backend is enabled 2014-07-10 13:54:06 +04:00
Evgeniy Khramtsov
e82219185b Add SQL to Riak converter 2014-07-10 13:29:01 +04:00
Evgeniy Khramtsov
0490c2f139 Improve Riak support 2014-07-10 13:26:37 +04:00
Alexey Shchepin
a4b02c38db Updated riak support 2014-07-10 13:15:15 +04:00
Evgeniy Khramtsov
87f8c2ecd8 Don't stop roster table conversion on broken askmessage 2014-06-09 10:55:05 +04:00
badlop
285c4c17cf Merge pull request #146 from jamielinux/master
Update FSF address
2014-04-11 13:35:46 +02:00
Badlop
633d47f784 Update copyright dates to 2014 (EJAB-1679) 2014-03-13 12:30:57 +01:00
Badlop
e211bf522e Support XEP-0321: Remote Roster Management (EJAB-1381) 2014-02-26 18:02:37 +01:00
Jamie Nguyen
8538997d61 Update FSF address 2014-02-22 10:27:40 +00:00
Badlop
5a1300bc70 Add access rule to mod_roster (EJAB-72) 2013-12-04 14:57:44 +01:00
Evgeniy Khramtsov
07c8bf5064 Fix roster version support 2013-09-24 18:59:20 +10:00
Evgeniy Khramtsov
ca6463ed78 Typo fix 2013-07-22 00:22:05 +10:00
Evgeniy Khramtsov
d58148fa8d Add SQL to Mnesia converter 2013-07-21 23:10:38 +10:00
Evgeniy Khramtsov
4dc80dddd4 Fix all calls to functions of p1_tls application 2013-06-20 18:40:44 +10:00
Evgeniy Khramtsov
4d8f770624 Switch to rebar build tool
Use dynamic Rebar configuration
Make iconv dependency optional
Disable transient_supervisors compile option
Add hipe compilation support
Only compile ibrowse and lhttpc when needed
Make it possible to generate an OTP application release
Add --enable-debug compile option
Add --enable-all compiler option
Add --enable-tools configure option
Add --with-erlang configure option.
Add --enable-erlang-version-check configure option.
Add lager support
Improve the test suite
2013-06-13 11:11:02 +02:00
Badlop
9deb294328 Accumulated patch to binarize and indent code 2013-03-14 10:33:02 +01:00
Alexey Shchepin
0ae400533c Update copyright dates 2013-01-24 16:25:13 +02:00
Evgeniy Khramtsov
0cc920579c Fix regression introduced in odbc/mnesia merge 2012-07-17 23:35:16 +10:00
Evgeniy Khramtsov
6719d9669b Fix get_subscription_lists/4 2012-04-29 19:34:57 +10:00
Evgeniy Khramtsov
437f68a9f3 Merge SQL and Mnesia code into one module (EJAB-1560) 2012-04-27 19:52:05 +10:00
Alexey Shchepin
b1e2538488 Update copyright dates 2012-02-23 17:52:34 +02:00
Badlop
5a0cfe7e2b Reorganize the push_item function, and handle version not_found (EJAB-1420) 2011-04-29 20:34:08 +02:00
Badlop
714dce84db No need to inform that XEP-0237 is optional; clarified in XEP version 1.2 2011-04-29 20:34:06 +02:00
Christophe Romain
fd52f2cb7d update copyright up to 2011 2011-02-14 13:50:55 +01:00
Badlop
414004eae4 Fix resending authorization problem 2010-02-24 13:14:45 +01:00
Badlop
7b76fdcde7 Update year of ProcessOne copyright from 2009 to 2010 (EJAB-1159)
SVN Revision: 2891
2010-01-12 16:11:32 +00:00
Badlop
d6f3182731 Move functions from roster_versioning to mod_roster (EJAB-964)
SVN Revision: 2429
2009-08-06 21:06:16 +00:00
Pablo Polvorin
53626d16e3 Support for roster versioning (EJAB-964)
Introduces two options for mod_roster and mod_roster_odbc:
- {versioning, true | false}   Enable or disable roster versioning on ejabberd.
- {store_current_id, true | false}   If true, the current roster version is stored on DB (internal or odbc). Otherwise it is calculated on the fly each time.

Performance:
Setting store_current_id to true should help in reducing the load for both ejabberd and the DB.

Details: 
If store_current_id is false,  the roster version is a hash of the entire roster. If store_current_id is true, the roster version is a hash, but of the current time
(this has to do with transactional semantics; we need to perform both the roster update and the version update on the same transaction, but we don't   
have the entire roster when we are changing a single item on DB. Loading it there requires significant changes to be introduced, so I opted for this simpler approach).

In either case, there is no difference for the clients, the roster version ID is opaque.

IMPORTANT:
mod_shared_roster is not compatible with the option 'store_current_id'.  Shared roster and roster versioning can be both enabled, but store_current_id MUST be set to false.

SVN Revision: 2428
2009-08-06 15:45:13 +00:00
Badlop
fec3742aaa Replace TYPE/1 with is_TYPE/1 (EJAB-922)
SVN Revision: 2057
2009-05-06 16:54:43 +00:00
Badlop
b0e749eca5 * src/mod_roster.erl: When account is deleted, cancel presence
subscription for all roster items (EJAB-790)
* src/mod_roster_odbc.erl: Likewise

SVN Revision: 1877
2009-02-16 14:49:20 +00:00
Badlop
43a98ab69b * src/web/ejabberd_web_admin.erl: Use textareas for large input
like ejabberd module options and listening port options. Show
result of POST more clearly. Ensure access rules are shown with
some minimum separation. Improve menu headers. (EJAB-562)
* src/web/ejabberd_web_admin.hrl: Likewise
* src/mod_offline.erl: Likewise
* src/mod_offline_odbc.erl: Likewise
* src/mod_roster.erl: Likewise
* src/mod_roster_odbc.erl: Likewise
* src/mod_shared_roster.erl: Likewise

SVN Revision: 1813
2009-01-12 21:48:34 +00:00
Badlop
f09509502e * doc/guide.tex: Update copyright date 2008 to 2009 (EJAB-842)
* doc/guide.html: Likewise
* src/*/*.erl: Likewise
* src/*/*.erl: Remove unneeded blankspaces in license text

SVN Revision: 1804
2009-01-12 14:44:42 +00:00
Badlop
14bc7cf77f * src/mod_roster.erl: Show hyperlinks to local contacts when
browsing roster of account in Web Admin (EJAB-480)
* src/mod_roster_odbc.erl: Likewise

SVN Revision: 1778
2009-01-07 01:38:45 +00:00