Commit Graph

161 Commits

Author SHA1 Message Date
Badlop 6e0161470e Update newest copyright year to 2021 (#3464) 2021-01-27 17:02:06 +01:00
Jing Sun 5af7532504
mod_muc/mod_muc_room: add option limits for password and captcha_whitelist (#2255) 2021-01-21 16:58:05 +01:00
Paweł Chmielowski 73f8aded17 Make mod_muc_admin command work correctly with hibernated rooms
This should first try to unhibernate rooms before trying to send messages
to processes handling them.
2020-10-13 13:00:57 +02:00
Stu Tomlinson bd11a00f8f
Use include_lib() to include headers from dependencies (#3369) 2020-09-03 13:45:57 +02:00
Badlop 66c2f45bff Show nick also in oneself list of subscriptions (#3206) 2020-08-26 19:32:29 +02:00
Paweł Chmielowski 8a645a2d3d Don't forget not-persistent rooms in load_permanent_rooms
Only non-persistent rooms that we are storing are those that were hibernated
but also have mucsub subscribers in them. I don't think it makes sense to
destroy those rooms on restart/reload if we didn't destroy them in first
place when last member did leave room, let just handle those rooms like
they are persistent, and kill them only when all user unsubscribe from them
or they are destroyed from api.
2020-08-06 11:44:44 +02:00
Badlop 2febd1c220 Copy more option explanations from ejabberd Docs site 2020-04-08 18:49:41 +02:00
Badlop 2d32c66fd7 Update copyright to 2020 (#3149) 2020-01-28 15:49:23 +01:00
Evgeny Khramtsov 97da380acd Generate ejabberd.yml.5 man page from source code directly
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).
2020-01-08 12:24:51 +03:00
Evgeny Khramtsov 5770946f03 Correctly handle unicode in log messages 2019-09-23 15:17:20 +03:00
Badlop a157e22c2f When join new room with password, set pass and password_protected (#2668) 2019-08-13 11:37:32 +02: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
Evgeny Khramtsov 554f4fc851 Change time unit of hibernation_timeout option to 'second'
This is done for the sake of consistency with other options
2019-07-16 23:42:38 +03:00
Evgeny Khramtsov 15b4b3fa1b Fix typos using codespell 2019-07-16 22:07:39 +03:00
Evgeny Khramtsov cc2f674805 Avoid record duplication 2019-07-16 18:34:05 +03:00
Evgeny Khramtsov 76d4c178a7 Use econf:timeout/2 2019-07-16 18:02:32 +03:00
Paweł Chmielowski 6b3d0d154e Add code for hibernating inactive muc_room processes 2019-07-16 15:09:58 +02:00
Evgeny Khramtsov a00496a38f Compile some regexps as unicode 2019-07-15 15:26:47 +03:00
Evgeny Khramtsov 061c754c68 Fix regexp matching 2019-07-15 15:07:56 +03:00
Evgeny Khramtsov 87b8344ede Attach mod_muc_room processes to a supervisor 2019-07-15 12:43:05 +03:00
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