24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-02 21:17:12 +02:00
Commit Graph

244 Commits

Author SHA1 Message Date
Holger Weiss
29dcc9b94c PubSub: Add delete_expired_pubsub_items command
Support XEP-0060's pubsub#item_expire feature by adding a command for
deleting expired PubSub items.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-10-30 13:19:30 +02:00
Badlop
506e2f3b97 Use specific syntax so modules and top-level will be links
If we use _`whatever`_ here in ejabberd man pages,
it is converted to *`whatever`* in markdown,
and docs.ejabberd.im/Makefile converts to the proper links
2021-08-23 14:04:49 +02:00
Holger Weiss
8d5025076f PubSub: Add delete_old_pubsub_items command
Add a command for keeping only the specified number of items on each
node and removing all older items.  This might be especially useful if
nodes may be configured to have no 'max_items' limit.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-22 12:44:50 +02:00
Holger Weiss
1b0e59bb13 PubSub: Support unlimited number of items
Allow for setting the mod_pubsub option 'max_items_node' to 'unlimited'.
If clients then request a 'max_items' limit of 'max', old items aren't
deleted when publishing new ones.

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-21 12:29:37 +02:00
Holger Weiss
8f8de0403b PubSub: Support 'max_items=max' node configuration
Let clients request the maximum limit for the node configuration option
'max_items' by specifying the special value 'max' instead of an integer.
This was added to XEP-0060, revision 1.17.0 (and clarified in revision
1.20.0).

Thanks to Ammonit Measurement GmbH for sponsoring this work.
2021-08-20 20:30:11 +02:00
Holger Weiss
99ffd9bb95 mod_pubsub: Fix check_opt_range/3 spec 2021-08-02 21:09:55 +02:00
Holger Weiss
2050cdffb4 PubSub: Use configured 'max_items' by default
If clients don't ask for a specific 'max_items' limit, use the value of
mod_pubsub's 'max_items_node' option as default, rather than the
hard-coded ?MAXITEMS value.  This makes sure clients cannot circumvent a
smaller, configured limit.
2021-07-28 18:53:15 +02:00
fdie
edae3c9cc5 fix gen_pubsub_node:get_state return value 2021-03-25 14:32:24 +01:00
Badlop
6e0161470e Update newest copyright year to 2021 (#3464) 2021-01-27 17:02:06 +01:00
Paweł Chmielowski
bb87b6f948 Rename function arguments 2021-01-25 20:00:07 +01:00
Paweł Chmielowski
07d28c3898 Skip reading pep nodes that we know won't be requested due to caps 2021-01-25 19:58:38 +01:00
Stu Tomlinson
bd11a00f8f
Use include_lib() to include headers from dependencies (#3369) 2020-09-03 13:45:57 +02:00
Holger Weiss
8daea451e3 mod_pubsub: Fix typo in 'hosts' documentation
Thanks to Melvin Keskin for spotting this.
2020-08-25 08:21:43 +02:00
Holger Weiss
65be619907 mod_pubsub: Remove 'dag' node plugin documentation
Commit c9d3beb9eb removed the 'dag'
node/nodetree plugins.
2020-08-18 06:50:33 +02:00
Badlop
9d923e8e6d Update syntax of some options so they are better displayed in Docs 2020-05-12 21:33:00 +02:00
Badlop
ce6fd654a0 Fix mod_pubsub indentation 2020-04-02 12:56:26 +02:00
Badlop
5ee2f48aea Add mod_pubsub configuration documentation 2020-04-02 12:56:23 +02:00
Badlop
2d32c66fd7 Update copyright to 2020 (#3149) 2020-01-28 15:49:23 +01:00
Evgeny Khramtsov
c604bdb897 Limit result set of disco#items for mod_pubsub
The size of a list of nodes returned for disco#items request
is now controlled by option 'max_nodes_discoitems'. The default
value is 100. The name and the default value of the option is
chosen to be consistent with mod_muc's 'max_rooms_discoitems' option.
2019-10-24 14:59:47 +03:00
Evgeny Khramtsov
e4a8afb15d Replace lager with built-in new logging API
This change requires Erlang/OTP-21.0 or higher.
The commit also deprecates the following options:
  - log_rotate_date
  - log_rate_limit

Furthermore, these options have no effect. The logger now fully
relies on log_rotate_size, that cannot be 0 anymore.

The loglevel option now accepts levels in literal formats.
Those are: none, emergency, alert, critical, error, warning, notice, info, debug.
Old integer values (0-5) are still supported and automatically converted
into literal format.
2019-10-18 19:12:32 +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
5a976719fb Introduce 'vcard' option for the modules supporting vCards
The mapping between vCard's XML elements and YAML elements
of 'vcard' option is straightforward. For example, if you
want mod_muc to return the following vCard:
```
<vCard xmlns='vcard-temp'>
  <FN>Conferences</FN>
  <ADR>
    <WORK/>
    <STREET>Elm Street</STREET>
  </ADR>
</vCard>
```
you need to set the configuration as:
```
modules:
  ...
  mod_muc:
    vcard:
      fn: Conferences
      adr:
        -
          work: true
          street: Elm Street
  ...
```
2019-08-02 13:59:42 +03:00
Paweł Chmielowski
51bf552c3f For pubsub items with max_item = 1 use order by in sql queries 2019-07-31 13:06:44 +02:00
Evgeny Khramtsov
8a2b2668cf Expose access_model and publish_model in pubsub#metadata
Fixes #2931
2019-07-30 10:45:32 +03:00
Evgeny Khramtsov
d64951c2b2 Improve handling of errors in tree_action/3 2019-07-29 22:24:26 +03:00
Evgeny Khramtsov
2cd930b7d5 Appropriately abort pubsub transaction 2019-07-29 21:44:30 +03:00
Evgeny Khramtsov
2da168cf05 Improve handling of errors in pubsub code 2019-07-29 17:13:16 +03:00
Christophe Romain
c0dc95d529 Fix wrong virtual host in mod_pubsub:send_stanza (#2930) 2019-07-22 10:13:27 +02:00
Evgeny Khramtsov
15b4b3fa1b Fix typos using codespell 2019-07-16 22:07:39 +03:00
Evgeny Khramtsov
4d877289fb Bump xmpp version and fix revealed bugs 2019-07-16 15:59:33 +03:00
Evgeny Khramtsov
f10de6439b Fix 'get-pending' command form generation 2019-07-16 15:09:51 +03:00
Evgeny Khramtsov
fd8e5ffce7 Avoid routing packets through a single process 2019-07-06 12:30:57 +03:00
Evgeny Khramtsov
a3e0cbbdd8 Make logging messages more consistent 2019-06-24 20:32:34 +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
Holger Weiss
026540f7e6 mod_pubsub: Check access_model when publishing PEP
Don't just adhere to the node's access_model when delivering the last
PEP item but also when a new item is published.

Many thanks to Philipp Hrist for spotting this.
2019-06-20 18:18:14 +02:00
Evgeny Khramtsov
0c4818daca Reflect recent pubsub changes in configuration transformer 2019-06-17 13:42:58 +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
Christophe Romain
88a3e1b510 Revert "Fix pubsub compliance XEP-0060 § 7.1.3.6 (#2864)"
This reverts commit 2fff4d1ea6.
This commit broke the XEP compliance. more details here
https://xmpp.org/extensions/xep-0060.html#events
2019-06-11 10:18:36 +02:00
Christophe Romain
2fff4d1ea6 Fix pubsub compliance XEP-0060 § 7.1.3.6 (#2864) 2019-05-07 16:23:36 +02:00
Paweł Chmielowski
538f35d05a Replace code using p1_time_compat wrapper with native functions
Since we now require R19, we shouldn't need that anymore.

There are still couple places where p1_time_compat:unique_timestamp() is
used as there is no direct equivalent.
2019-02-27 09:56:31 +01:00
Badlop
55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Holger Weiss
074ebd80f6 mod_pubsub: Improve PEP behavior for 'whitelist'
If a PEP node's access_model is set to 'whitelist' (or 'authorize'),
send last PEP notifications to the node owner.
2018-12-05 18:25:40 +01:00
Evgeny Khramtsov
1cdca1ab99 Support for XEP-0411: Bookmarks Conversion 2018-11-23 13:33:29 +03:00
Evgeniy Khramtsov
e9f219a0ac Improve wording 2018-07-14 16:52:09 +03:00
Stu Tomlinson
f9ed34db4d Enforce pubsub option required/rejected attributes
XEP-0060 states that 'node' and 'jid' attributes to <options> element MUST NOT
be included when <options> are specified at same time as <subscribe> :

https://xmpp.org/extensions/xep-0060.html#subscriber-configure-subandconfig

mod_pubsub will require 'node' and 'jid' attributes on standalone pubsub
options requests, and reject subscribe requests that have options that include
either 'node' or 'jid'
2018-07-14 11:55:38 +01:00
Evgeniy Khramtsov
68d12017cc Better detection of duplicated routes/hosts 2018-07-08 20:28:11 +03:00
Evgeniy Khramtsov
ed1ee6061e Move move randoms module to p1_utils repo 2018-07-05 11:51:49 +03:00
Evgeniy Khramtsov
9e83c45b3c Restore forgotten translations from previous commit 2018-06-20 12:50:36 +03:00