Commit Graph

226 Commits

Author SHA1 Message Date
Evgeny Khramtsov a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Paweł Chmielowski 456e87e8b2 Copy p1_time_compat:unique_timestamp() to misc and make use of it 2019-02-27 11:00:02 +01:00
Evgeny Khramtsov 1684436bfe Merge branch 'mix' 2019-02-21 12:36:33 +03:00
Badlop 55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Paweł Chmielowski c88a2d0569 Add code for handling deprecations of get_stacktrace() 2018-12-13 11:46:53 +01:00
Evgeny Khramtsov 33202d59c0 Merge branch 'master' into mix 2018-12-10 17:07:28 +03:00
Evgeny Khramtsov 8295bcebec Fix (un)setting of priority 2018-12-10 17:06:21 +03:00
Evgeny Khramtsov 74e8c0376f Merge branch 'master' into mix 2018-12-10 11:57:04 +03:00
Evgeny Khramtsov 6cd8d1025c Don't lose carbons on presence change or session resumption 2018-12-10 11:53:27 +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
Evgeny Khramtsov 109ed8f2f6 Keep info about carbons inside session table
Accordingly, Mnesia/SQL/Riak table 'carboncopy' is not used anymore
and can be safely removed.

As a consequence, the commit deprecates the following options of
mod_carboncopy:
- ram_db_type
- use_cache
- cache_size
- cache_missed
- cache_life_time

Fixes #2663
2018-12-01 13:33:44 +03:00
Evgeny Khramtsov 5d27c975dc Keep last handled stanzas number in cache rather than session table 2018-11-30 16:19:00 +03:00
Evgeny Khramtsov 2d246f61dd Fix some dialyzer warnings 2018-09-09 09:59:08 +03:00
Evgeniy Khramtsov 88d0b71d58 Get stacktrace out of lager context
Calling erlang:get_stacktrace() inside lager functions produces
stacktraces of the logging function itself, not the function which has failed.
2018-09-01 19:37:26 +03:00
Evgeniy Khramtsov 8faa6afa67 Require Redis version >= 3.2.0
Since we now use Lua scripting for cleaning up c2s sessions
the minimum supported Redis version is 3.2.0 or above because
we need to work correctly with Redis replication mechanism.

****** BACKWARD INCOMPATIBILITY WARNING *******
** THIS SHOULD BE ADDED TO THE RELEASE NOTES **
*** PACKAGE MAINTAINERS SHOULD BE INFORMED  ***
***********************************************
2018-07-15 09:52:03 +03:00
Badlop 3ec623f329 Make connected_users_info and user_sessions_info DB-agnostic (#2448)
The result returned by connected_users_info command has changed,
and is now similar to the result of user_sessions_info.

Notice that num_active_users and process_rosteritems still require Mnesia.
2018-06-15 11:28:57 +02:00
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
Evgeniy Khramtsov 5e446d50a8 Get rid of direct calls to 'session' Mnesia table
Fixes #2439
2018-05-30 19:21:56 +03:00
Evgeniy Khramtsov 680384c342 Reduce IQ handler code copying 2018-05-09 10:30:00 +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 c65dcfeda7 Export is_online/1 function 2018-02-05 15:13:13 +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 cdc7c1d1ed Update copyright dates 2018-01-05 23:18:58 +03:00
Holger Weiss 63a60f1cd8 ejabberd_sm: Fix get_session_sid/3
Let get_session_sid/3 cope with multiple session table entries for a
given resource.
2017-12-19 18:59:25 +01:00
Holger Weiss 5cf4e200ba mod_mam: Make sure a stanza ID is always added
Let mod_mam store incoming messages from a new hook in ejabberd_sm.
This makes sure all messages are tagged with a stanza ID, including
those that are forked to multiple resources in ejabberd_sm.

Closes #1344.
2017-11-09 00:21:40 +01:00
Holger Weiss ba9a79c89c Apply cosmetic changes to previous commit 2017-08-18 16:50:08 +02:00
Holger Weiss 13ad754ecc Suppress push notifications for online clients
When a client enabled push notifications during the current session,
notifications should be suppressed as long as the client is online.
Suppressing the notification didn't work for the case where the
notification was triggered by MAM, but this is now fixed.
2017-08-18 16:44:32 +02:00
Christophe Romain 7d626b4f5c Add support of section 4.9.3.16 on rfc6120 2017-08-10 12:17:31 +02:00
Christophe Romain 766b7c65a6 Merge pull request #1881 from weiss/push
Support XEP-0357: Push Notifications
2017-08-04 12:58:06 +02:00
Paweł Chmielowski 1274bcdba9 Change policy of user_resources command
This fixes issue #1908
2017-08-03 13:49:06 +02:00
Christophe Romain 2e88d001d6 Fix errors from 1a0db3d 2017-07-21 11:42:03 +02:00
Badlop 1a0db3de3a Describe commands arguments and results in ejabberd_sm, ext_mod, mod_mam 2017-07-21 11:26:53 +02:00
Holger Weiss d6f1d3df5b Support XEP-0357: Push Notifications
Closes #1379.
2017-07-20 20:22:50 +02:00
Holger Weiss 5802062746 Cosmetic change: Fix indentation errors 2017-05-24 17:16:16 +02:00
Evgeniy Khramtsov f782955c06 Implement cache for roster 2017-05-17 14:47:35 +03:00
Evgeniy Khramtsov cdb191bb48 Rename is_user_exists -> user_exists 2017-05-11 15:49:06 +03:00
Evgeniy Khramtsov 01a2c9fe12 Add type specs for Module:opt_type/1 2017-05-08 12:59:28 +03:00
Evgeniy Khramtsov b82b93f8f0 Don't validate an option in ejabberd_config:get_option() functions
The commit introduces the following changes:
* Now there is no need to pass validating function in
  ejabberd_config:get_option() functions, because the configuration
  keeps already validated values.
* New function ejabberd_config:get_option/1 is introduced
* Function ejabberd_config:get_option/3 is deprecated. If the function
  is still called, the second argument (validating function) is simply
  ignored.
* The second argument for ejabberd_config:get_option/2 is now
  a default value, not a validating function.
2017-04-29 11:39:40 +03:00
Evgeniy Khramtsov 0a7eb33772 Better process session close 2017-04-14 20:41:25 +03:00
Evgeniy Khramtsov e40baf0bda Use cache in front of Redis/SQL RAM backends 2017-04-14 13:57:52 +03:00
Christophe Romain cf784772c9 Merge pull request #1664 from weiss/fix-routing
Fix routing of groupchat and headline messages
2017-04-07 15:10:26 +02:00
Holger Weiss 179e8934cf ejabberd_sm: Fix routing of headline messages
As per RFC 6121, silently drop headline messages sent to the bare JID of
an offline user or to the full JID of an unavailable resource.
2017-04-05 21:03:13 +02:00
Holger Weiss 8bfb6fdd4e ejabberd_sm: Fix routing of groupchat messages
As per RFC 6121, don't (re)route groupchat messages sent to a bare JID
or to an unavailable resource.
2017-04-05 20:41:10 +02:00
Holger Weiss 89f81c89da ejabberd_sm: Fix typo in debug message 2017-04-05 20:23:28 +02:00
Evgeniy Khramtsov 6fa55e7c38 Set 'read_concurrency' for some ETS tables 2017-04-05 15:10:18 +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 c15d230a57 Return ejabberd_sm:stop/0 back 2017-02-24 12:39:44 +03:00
Evgeniy Khramtsov 67d6ca9f10 Improve startup procedure 2017-02-24 12:05:47 +03:00
Holger Weiss b475df2250 Include stanza ID with archived offline messages
Fixes #1480.
2017-02-23 16:55:35 +01:00