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

140 Commits

Author SHA1 Message Date
Evgeny Khramtsov
9cbc0685db Don't expose internal FSM API of mod_muc_room 2019-07-09 00:47:54 +03:00
Evgeny Khramtsov
fd8e5ffce7 Avoid routing packets through a single process 2019-07-06 12:30:57 +03:00
Evgeny Khramtsov
61a58f6e67 Do not call the same function twice 2019-07-06 10:21:01 +03:00
Paweł Chmielowski
756adaba55 Restore room when receiving message or generic iq for not started room 2019-07-05 13:46:48 +02:00
Paweł Chmielowski
d7e86d1d32 Limit number of rooms that we return for disco_items from muc
We will limit it to max_room_discoitems and return rsm that would allow
fetching more
2019-07-05 11:08:32 +02:00
Evgeny Khramtsov
b3caade0a0 Distribute routing of MUC messages accross all CPU cores
Also relay as less stanzas as possible through mod_muc workers
2019-07-05 10:35:31 +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
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
80b7d50628 Use system_time/1 instead of monotonic_time/1
The value of monotonic_time/1 may differ significantly between
nodes in a cluster due to different erlang:time_offset/0 values.

Thanks to Christoph Scholz for spotting this
2019-06-06 21:26:50 +03:00
Evgeny Khramtsov
3d8711f708 Avoid late arrival of get_disco_item response 2019-05-11 19:27:56 +03:00
Paweł Chmielowski
3d434cfcef Handle get_subscribed_rooms call from mod_muc_room pid
Previously sometimes we tried to post message to all online rooms, and
if that was called from muc room pid, we were not able to process that
message for that room and send response, and this did lead to timeout.
2019-05-06 19:15:48 +02:00
Paweł Chmielowski
b83d30fd07 Make get_subscribed_rooms work even for non-persistant rooms
This will store info about non-persistant rooms in db, but rooms with that
that option enabled will not be restored on server restart.

This will save info about room only on subscribers change.
2019-04-30 13:41:03 +02:00
Evgeny Khramtsov
e66f594901 Change mucsub API for database backends 2019-04-03 14:20:37 +03:00
Paweł Chmielowski
8e05fd1d24 Add option user_mucsub_from_muc_archive to mod_muc
This option disable storing separate mucsub message for each individual
subscriber but instead when user fetches archive virtual mucsub messages
are generated from muc archives.
2019-03-28 17:42:25 +01:00
Holger Weiss
333b010d54 mod_muc: Simplify room creation checks 2019-03-12 00:05:59 +01:00
Christoph Scholz
b5fa3b0e2b allow room recreate for admins even if nonempty 2019-03-05 16:51:57 +01: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
Christoph Scholz
5e7f234ac8 disallow room creation if archive not empty and
clear_archive_on_room_destroy is false
2019-02-18 13:42:45 +01:00
Evgeny Khramtsov
5e9945f060 Improve validation of configured language options 2019-01-19 11:29:45 +03:00
Christophe Romain
e4067df85e
Merge pull request #2748 from area-42/add_acl_for_mam_in_mod_muc
add acl for mam in mod_muc
2019-01-10 14:29:02 +01:00
Badlop
55417dfb37 Update copyright to 2019 (#2756) 2019-01-08 22:53:27 +01:00
Christoph Scholz
7e4287ff83 add acl for mam in mod_muc 2019-01-04 15:56:41 +01:00
Badlop
d5c1174385 Revert "New option tombstone_expiry locks recent room creation after destroy (#2546)"
This reverts commit efb4fd0d10.
2018-09-17 12:28:39 +02:00
Badlop
8f0e066135 In response with list of room subscriptions include also events (#2272) 2018-08-13 12:52:33 +02:00
Badlop
efb4fd0d10 New option tombstone_expiry locks recent room creation after destroy (#2546)
Setting the new mod_muc option tombstone_expiry to a positive integer
will make that any room destroyed gets replaced with a room tombstone.
That tombstone cannot be joined, so it blocks accessing the old room JID
until the expiry seconds have passed.
The default value is 0 seconds, so tombstones are not created.
2018-07-30 19:24:35 +02:00
Holger Weiss
326db5535c mod_muc: Don't set default for muc#roomconfig_lang
For the muc#roomconfig_lang setting, no default is preferable over a
possibly incorrect default value.
2018-07-16 15:15:36 +02:00
Holger Weiss
4b747c2c78 mod_muc: Increase 'max_user_conferences' default
Let up to 100 clients of a given account join MUC rooms by default.  The
old default value can be too small, e.g., when users join many (private)
rooms with multiple devices.
2018-07-10 01:00:06 +02:00
Evgeniy Khramtsov
68d12017cc Better detection of duplicated routes/hosts 2018-07-08 20:28:11 +03:00
Evgeniy Khramtsov
491993d401 Reload internal room's configuration when mod_muc is reloaded
Fixes #2513
2018-07-08 14:52:12 +03:00
Evgeniy Khramtsov
ed1ee6061e Move move randoms module to p1_utils repo 2018-07-05 11:51:49 +03:00
Evgeniy Khramtsov
50b645aa92 Move shaper to p1_utils repo 2018-07-05 09:31:55 +03:00
Evgeniy Khramtsov
9e83c45b3c Restore forgotten translations from previous commit 2018-06-20 12:50:36 +03: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
0f9db50c8d Support for roomconfig_lang/roominfo_lang
Now room owners are able to set a preferred language
for the discussions in the room, so other users can
discover rooms based on the language they wish to talk.

TODO: the language format should conform to RFC 5646.
      This check should be implemented in 'xmpp' library.

Fixes #2436
2018-05-30 08:11:58 +03:00
Evgeniy Khramtsov
680384c342 Reduce IQ handler code copying 2018-05-09 10:30:00 +03:00
Evgeniy Khramtsov
6774418a7f Introduce new mod_muc option: access_register
The option is an ACL rule defining who is able to register
nicknames within the conference service. The default is `all`
(for backward compatibility).
2018-04-24 12:29:59 +03:00
Tobias Koch
9188a7b838 Dialyzer checks always failed because the return value of the function 'get_subscribed_rooms' in 'mod_muc_sql' is different to the defined value in 'mod_muc'. Fix was to update the return value in 'mod_muc.erl'. 2018-02-12 15:12:46 +01: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
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
Evgeniy Khramtsov
a57c694f21 Fix SQL serialization
The regression is introduced in 11829906ac
Fixes #2121
2017-11-24 09:45:22 +03:00
Evgeniy Khramtsov
902c6d476b Prepare version 0.6.1 of XEP-0313 (MAM) support 2017-11-08 15:15:39 +03:00
Paweł Chmielowski
88558453fb Typo 2017-10-31 17:11:17 +01:00
Christophe Romain
0452ffc1df Optimize muc subscriptions handling 2017-10-31 14:00:41 +01:00
Evgeniy Khramtsov
251756de00 Catch all p1_fsm errors
Fixes #2012
2017-09-25 13:01:00 +03:00
Badlop
1d396b4716 Rewrite muc_register_nick and muc_unregister_nick to be DB independent (#1954)
Notice: The arguments expected have changed, instead of
  muc_register_nick Tim tim@example.org muc.example.org
  muc_unregister_nick Tim
it expects now:
  muc_register_nick Tim tim@example.org example.org
  muc_unregister_nick tim@example.org example.org
2017-08-24 10:40:54 +02:00
Evgeniy Khramtsov
a96d72330d Rename remove_room hook back 2017-08-10 14:49:05 +03:00