Commit Graph

173 Commits

Author SHA1 Message Date
Paweł Chmielowski f86055378d Optimize room_unused_* commands
Previously to check if hibernated room was old enough we had to fetch info
about all rooms from database. Now we repurpose created_at field in sql
to store that info, that allow us to have more efficient query just for it.
2022-02-18 14:02:04 +01:00
Badlop b3211b1f71 Update copyright year to 2022 2022-02-11 09:39:25 +01:00
Badlop c92478f7c2 Use the same wording in all the identical options db_type and ram_db_type 2022-02-03 18:21:51 +01:00
Alexey Shchepin a26c9d2475 Optimize user removal handling in mod_muc 2021-12-20 09:42:02 +03:00
Alexey Shchepin 8b7da70b57 Handle user removal in mod_muc 2021-12-14 09:55:55 +03:00
Badlop 2f5b15129a Fix previous commit: add forgotten endline blankspaces 2021-09-14 15:13:37 +02:00
Badlop f8167fc5d0 Update documentation to match the implemented options values (#3675) 2021-09-14 13:47:41 +02:00
Alexey Shchepin 5abc03ff8f Optimize MucSub processing 2021-09-13 08:20:47 +03: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
Badlop 2e2667bbd7 Update documentation: mod_muc ram_db_type supports SQL since 17.04 (#3632) 2021-07-08 12:29:16 +02:00
Badlop c2821be94c Use the new 'note' field to annotate changes in 20.01..21.03 2021-05-05 11:57:05 +02:00
Paweł Chmielowski ca5d5f3b4c Use monitors to track muc rooms
This should prevent keeping rooms that were hard killed from in
online table.
2021-03-03 11:32:05 +01:00
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