Commit Graph

42 Commits

Author SHA1 Message Date
Stu Tomlinson bd11a00f8f
Use include_lib() to include headers from dependencies (#3369) 2020-09-03 13:45:57 +02:00
Badlop c0f7008e96 Use old http_uri, crypto and pg2 only with old Erlang/OTP (#3284) 2020-06-01 10:35:28 +02:00
Badlop 2febd1c220 Copy more option explanations from ejabberd Docs site 2020-04-08 18:49:41 +02:00
Evgeny Khramtsov 97da380acd Generate ejabberd.yml.5 man page from source code directly
Several documentation callbacks (doc/0 and mod_doc/0) are implemented
and `ejabberdctl man` command is added to generate a man page. Note
that the command requires a2x to be installed (which is a part of
asciidoc package).
2020-01-08 12:24:51 +03:00
Evgeny Khramtsov 5770946f03 Correctly handle unicode in log messages 2019-09-23 15:17:20 +03:00
Evgeny Khramtsov 2168489ddf Don't retain module option on gen_mod supervisor
When module's options were updated (e.g. by reloading ejabberd.yml)
and, later, the module's process crashed, gen_mod supervisor
restarts the process with outdated options. This is now fixed.
2019-08-04 21:46:18 +03:00
Evgeny Khramtsov 6f5d99275b Process unexpected messages uniformly 2019-07-12 11:55:36 +03:00
Evgeny Khramtsov fd8e5ffce7 Avoid routing packets through a single process 2019-07-06 12:30:57 +03:00
Evgeny Khramtsov 00f2a736eb Improve extraction of translated strings
Now every such string MUST be encapsulated into ?T() macro.
The macro itself is defined in include/translate.hrl.
Example:

-module(foo).
-export([bar/1]).
-include("translate.hrl").

bar(Lang) ->
    translate:translate(Lang, ?T("baz")).
2019-06-22 17:08:45 +03:00
Evgeny Khramtsov a205ebad2b Get rid of "well-known" type 2019-06-15 12:53:16 +03:00
Evgeny Khramtsov a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Evgeny Khramtsov a5ac1d15e7 Avoid badfun in multicast/6 2018-12-07 21:34:49 +03:00
Evgeny Khramtsov 0e954da3fa Fix wording 2018-12-07 20:48:13 +03:00
Evgeny Khramtsov 6afefd7bbf Fix submission-id and channel resource 2018-12-07 11:06:26 +03:00
Evgeny Khramtsov d5e4da54cf Update MIX code to reflect newest specification
Note that support for older specification is completely dropped,
i.e. no backward compatibility is provided since the XEPs are
still very experimental and being changed drastically
2018-12-05 13:14:29 +03:00
Evgeniy Khramtsov 68d12017cc Better detection of duplicated routes/hosts 2018-07-08 20:28:11 +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 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
Evgeniy Khramtsov 7a9d2cabc0 Improve code using new xmpp API 2017-12-06 17:21:57 +03:00
Evgeniy Khramtsov 3fec782494 Introduce 'hosts' option
The option can be used as a replacement of 'host' option
when several (sub)domains are needed to be registered for the module.
Note that you cannot combine both 'host' and 'hosts' in the config
because 'host' option is of a higher priority. Example:

mod_pubsub:
   ...
   hosts:
     - "pubsub1.@HOST@"
     - "pubsub2.@HOST@"

Fixes #1883
2017-08-08 17:46:26 +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 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 28f66ddd7c Attach modules to gen_mod's supervisor 2017-02-14 12:39:26 +03:00
Evgeniy Khramtsov f664e39374 Improve modules start/stop procedures 2017-02-14 10:25:08 +03:00
Badlop 5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Christophe Romain ed679279fd Cleanup file headers 2016-12-27 10:57:50 +01: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 e987b88848 Make common tests working again 2016-09-13 12:30:05 +03:00
Evgeniy Khramtsov c29a48695d Rename #error{} record to #stanza_error{} 2016-09-08 17:08:48 +03:00
Evgeniy Khramtsov 522a186a38 Improve some type specs 2016-08-09 10:56:32 +03:00
Christophe Romain bf45c9eeee Switch mix worker to transient 2016-08-01 14:09:16 +02:00
Evgeniy Khramtsov 0bcbd12776 Rewrite mod_mix to use XML generator 2016-07-31 08:51:47 +03:00
Evgeniy Khramtsov 4220a2b98c Make modules loading in a dependent order (#1191) 2016-07-06 14:58:48 +03:00
Evgeniy Khramtsov fced8dc3d9 Replace some ?ERR_* macros with ?ERRT_* 2016-03-31 11:00:29 +03:00
Evgeniy Khramtsov 357e48fb6b Make it possible to get virtual host of a registered route 2016-03-13 11:38:40 +03:00
Evgeniy Khramtsov e31799a3b1 Define mod_opt_type/1 callback 2016-03-09 11:19:15 +03:00
Evgeniy Khramtsov 1860801e36 Unregister hooks and iq handlers on terminate 2016-03-09 11:14:45 +03:00
Evgeniy Khramtsov b5121a346d Experimental MIX (XEP-0369) support 2016-03-08 20:04:29 +03:00