Commit Graph

187 Commits

Author SHA1 Message Date
Evgeniy Khramtsov 55604b2d97 Move force_node_config defaults into ejabberd.yml.example 2018-03-23 16:08:12 +03:00
Christophe Romain 0bda169a5a Remove items of unregistered user (#2129) 2018-03-22 11:59:24 +01:00
Christophe Romain 7ba6fae67c Improve result of XEP-0060 §6.5.9.12 (#2288)
Moving get_item result control to keep item-not-found on transaction
error when node does not exists
2018-03-17 10:59:34 +01:00
Christophe Romain 7beb19b01e Fix result of XEP-0060 §6.5.9.12 (#2288) 2018-03-16 17:48:42 +01:00
Christophe Romain a84dd0f627 Add transient notification condition (#2267) 2018-03-16 17:26:51 +01:00
Christophe Romain d8f9219b4f Refactor publish_item conditions (#2267) 2018-03-16 17:17:53 +01:00
Evgeniy Khramtsov 99b41146b1 Get rid of catch-all in mod_pubsub 2018-03-13 22:10:58 +03:00
Evgeniy Khramtsov 2785f1dfd2 Introduce force_node_config for mod_pubsub
The option can be used to override configuration options of a
particular PubSub node. Example:

mod_pubsub:
  ...
  force_node_config:
    "eu.siacs.conversations.axolotl.*":
      access_model: whitelist
    "*":
      persist_items: true

Fixes #2276
2018-03-11 16:54:35 +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 2269d290d8 Switch to newer fast_xml and xmpp and update record fields in the code 2018-01-25 20:02:47 +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 9d94361466 Process 'name' option for all route-registering modules
The option allows to set arbitrary text for disco#info identity name.
Previously, option 'name' was supported by mod_proxy65 and mod_http_upload
only. Now, all the following modules support this option as well:
- mod_disco
- mod_irc
- mod_muc
- mod_multicast
- mod_pubsub
- mod_vcard

Example:
```
modules:
  ...
  mod_disco:
    name: "Cool XMPP Server"
  ...
```
2018-01-08 11:29:17 +03:00
Evgeniy Khramtsov cdc7c1d1ed Update copyright dates 2018-01-05 23:18:58 +03:00
Christophe Romain 439fe0b504 Fix check_opt_range when no boundary is configured 2017-12-28 13:51:26 +01:00
Christophe Romain af9183cd54 Add pubsub#multi-items to features list (#2162) 2017-12-20 11:54:12 +01:00
Holger Weiss 5968bc9318 Send last PEP items to owner on initial presence
Closes #2112.
2017-12-13 18:59:06 +01:00
Holger Weiss 03246f5ff4 mod_pubsub: Send last items on initial presence
Wait until we got initial presence from the client before sending the
last items of nodes the JID is subscribed to.

Closes #2132.
2017-12-12 12:21:33 +01:00
Holger Weiss b661bee4b1 Support pubsub#publish-options PRECONDITIONs
Support PubSub publishing options that are specified as PRECONDITIONs as
per XEP-0060 v1.14.
2017-12-12 01:04:14 +01:00
Christophe Romain a5849a0dab Fix num_subscribers on node metadata (#2122) 2017-11-30 15:27:34 +01:00
Christophe Romain 514c25caef PubSub: PEP services must send notifications to the account owner (#2108) 2017-11-16 15:31:28 +01:00
Christophe Romain 62aab0fce4 Fix select_type race on plugin_init 2017-11-15 19:04:47 +01:00
Christophe Romain e706e24b92 Cleanup pubsub subscriptions quering, fix pep case 2017-11-15 11:16:15 +01:00
Christophe Romain e697a3e262 Add missing type conversion from 675cc3e 2017-10-31 11:59:53 +01:00
Christophe Romain 675cc3e0ea Allow auth and pubsub plugin to use Elixir module 2017-10-31 11:04:32 +01:00
Christophe Romain dbdda745af Delete cached item on node removal (#2071) 2017-10-27 21:16:25 +02:00
Evgeniy Khramtsov 2161063e5e Don't forget to convert ljid() to jid() 2017-10-26 10:29:23 +03:00
Evgeniy Khramtsov 29462f0053 Make it possible to convert to SQL for any current db_type
It is now possible to run `export` command even when the current `db_type` is not `sql`
2017-10-25 21:21:52 +03:00
Christophe Romain 8028a9545a Cosmetic change, remove useless case 2017-10-25 11:48:56 +02:00
Christophe Romain 8b588d2ff3 Add basic PubSub meta-data support (#1421) 2017-10-25 10:34:11 +02:00
Christophe Romain b0fa27395f Add missing fix from 07a193d4d, Fix purge_offline (#2057) 2017-10-24 15:35:01 +02:00
Christophe Romain 126653e01b Pubsub: implment '6.5.7 Requesting the Most Recent Items' 2017-09-27 20:54:50 +02:00
Christophe Romain 07a193d4dc PubSub: fix RSM support (#1994)(#2Â014) 2017-09-27 10:51:37 +02:00
Christophe Romain cf09ed2df2 PubSub: fix node_options, default options only apply on first plugin 2017-09-27 09:29:04 +02:00
Christophe Romain 7ad525b542 PubSub: broadcast updated configuration (#1945) 2017-09-18 12:48:20 +02:00
Evgeniy Khramtsov e4d21c1941 Introduce mod_avatar
The purpose of the module is to cope with legacy and modern
XMPP clients posting avatars. It automatically converts vCard based
avatars (XEP-0153) to PEP based avatars (XEP-0084) and vice versa.
Also, the module supports convertation between avatar image formats on
the fly: this is controlled by `convert` option. For example, to
convert all avatars into PNG format, configure the module as:

mod_avatar:
  convert:
    default: png

In order to convert only `webp` format to `jpeg`, set the following:

mod_avatar:
  convert:
    webp: jpeg

Note: the module depends on mod_vcard, mod_vcard_xupdate and mod_pubsub.
Also, ejabberd should be built with --enable-graphics option.
2017-09-17 10:26:48 +03:00
Christophe Romain 68fb12153e Revert "Temporary remove recent last_item refactor"
This reverts commit 1820b4f63b.
2017-08-14 15:25:45 +02:00
Christophe Romain 1820b4f63b Temporary remove recent last_item refactor 2017-08-14 09:43:02 +02:00
Christophe Romain fd7bf7fed3 Fix typo from 9c5427e0c 2017-08-11 17:54:53 +02:00
Christophe Romain 7a90cda8ff Process on_user_offline only from valid sessions 2017-08-11 12:05:14 +02:00
Christophe Romain 024713a441 Remove temporary debug 2017-08-11 10:53:19 +02:00
Christophe Romain 32fbfe1981 Use correct c2s process sending PEP with multi devices 2017-08-11 10:32:36 +02:00
Christophe Romain 9c5427e0c2 PubSub: refactor send_last_items remove send_loop 2017-08-11 10:20:33 +02:00
Christophe Romain e903348dd3 Fix pubsub send_loop after 3fec7824 2017-08-09 11:34:36 +02: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
Christophe Romain 06450f4a82 Keep disco#info on PEP compatible with XEP-0060 (#1717) 2017-08-03 15:48:23 +02:00
Christophe Romain ce0beb550c Move pubsub sql export to pubsub_db_sql module 2017-08-03 15:34:01 +02:00
Christophe Romain 96c0483533 Fix Xref from 5dcc97c 2017-08-03 14:54:06 +02:00
Badlop 5dcc97c85a Preliminary export PubSub data from Mnesia tables to SQL file (#1571) 2017-08-03 10:53:01 +02:00