aboutsummaryrefslogtreecommitdiff
path: root/src/mod_block_strangers.erl (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-02-11Update copyright year to 2022Badlop1-1/+1
2021-03-09If stanza is type error, allow it passing (#3290)Badlop1-1/+2
2021-01-27Update newest copyright year to 2021 (#3464)Badlop1-1/+1
2020-09-03Use include_lib() to include headers from dependencies (#3369)Stu Tomlinson1-1/+1
2020-01-28Update copyright to 2020 (#3149)Badlop1-1/+1
2020-01-08Generate ejabberd.yml.5 man page from source code directlyEvgeny Khramtsov1-1/+52
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).
2019-09-23Correctly handle unicode in log messagesEvgeny Khramtsov1-2/+2
2019-07-10Add/improve type specsEvgeny Khramtsov1-0/+9
2019-06-22Improve extraction of translated stringsEvgeny Khramtsov1-4/+5
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-14Use new configuration validatorEvgeny Khramtsov1-17/+16
2019-01-08Update copyright to 2019 (#2756)Badlop1-1/+1
2018-11-29Drop some macros related to OTP<19Evgeny Khramtsov1-21/+1
2018-06-28Avoid code duplication when checking presence subscriptionEvgeniy Khramtsov1-13/+3
2018-06-27Don't check packets sent to selfEvgeniy Khramtsov1-1/+4
2018-06-14Get rid of ejabberd.hrl headerEvgeniy Khramtsov1-1/+0
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-02-17Introduce 'access' option for mod_block_strangerEvgeniy Khramtsov1-4/+10
The option is supposed to be used when `allow_local_users` and `allow_transports` are not enough. It's an ACL where `deny` means the message will be rejected (or a CAPTCHA would be generated for a presence), and `allow` means the sender is whitelisted and the stanza will pass through. The default value is `none`, which means nothing is whitelisted.
2018-01-26Fix a typo in call to create_captcha()Evgeniy Khramtsov1-1/+1
Thanks to Paul Schaub for spotting this
2018-01-26Introduce option 'captcha' for mod_block_strangersEvgeniy Khramtsov1-34/+111
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-24mod_block_strangers: Bounce groupchat to bare JIDHolger Weiss1-1/+8
If a blocked message is of type 'groupchat', address the error message to the bare JID (rather than sending it as MUC PM).
2018-01-23Introduce new gen_mod callback: mod_options/1Evgeniy Khramtsov1-7/+12
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-05Update copyright datesEvgeniy Khramtsov1-1/+1
2018-01-03mod_block_strangers: Bounce an error messageHolger Weiss1-2/+5
Return a stanza error when a message is rejected, in order to make legitimate users aware of the issue. Closes #2197.
2017-09-08Introduce option 'allow_transports'Evgeniy Khramtsov1-10/+39
This is a boolean option. If set to `true` and some server's JID is in user's roster, then messages from any user of this server are accepted even if no subscription present. The option is enabled by default.
2017-09-07Always accept messages from local (sub)domainsEvgeniy Khramtsov1-1/+1
2017-09-07Fix a typo and improve logging messageEvgeniy Khramtsov1-4/+4
2017-09-02Block messages from strangers before mod_mam/mod_offline processingEvgeniy Khramtsov1-18/+36
Fixes #1713
2017-07-27Revert "Fix get_module_opt call in mod_block_strangers"Christophe Romain1-4/+1
This reverts commit e5f64bc24af581b7e8ffd73e7490cc93423d960b.
2017-07-27Fix get_module_opt call in mod_block_strangersAlexey Shchepin1-1/+4
2017-06-29Add allow_local_users to mod_block_strangers (#1804, #1809)Alexey Shchepin1-2/+7
2017-05-17Implement cache for rosterEvgeniy Khramtsov1-27/+28
2017-04-30Don't validate an option in gen_mod:get*opt() functionsEvgeniy Khramtsov1-8/+2
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-03-21Don't block contacts with subscription=to in mod_block_strangers (#1609)Alexey Shchepin1-3/+9
2017-02-22Reload modules when reloading configuration fileEvgeniy Khramtsov1-1/+4
2017-01-23Compatibility with R17 in mod_block_strangersAlexey Shchepin1-1/+20
2017-01-23Check message subject in mod_block_strangersAlexey Shchepin1-1/+2
2017-01-17Drop only messages with <body/> in mod_block_strangersAlexey Shchepin1-1/+2
2017-01-16Stop hook on message drop in mod_block_strangersAlexey Shchepin1-1/+1
2017-01-16Use user_receive_packet hook in mod_block_strangersAlexey Shchepin1-11/+10
2017-01-16Remove stub in mob_block_strangersAlexey Shchepin1-4/+4
2017-01-16Add mod_block_strangersAlexey Shchepin1-0/+107