Skip to content

Commit

Permalink
Separated database logic from mod_muc into backend modules #1758
Browse files Browse the repository at this point in the history
Separated database logic from mod_muc into backend modules

Add load_permanent_rooms_at_startup option

New result format for some mod_muc functions

Document mod_muc.backend option

Remove mnesia migrations from mod_muc

Replace catch with try..catch

Simplify mod_muc Mnesia code

Subtruct unset_nick from set_nick function

Do not allow to use a nick if DB returns an error

Add MUC registration tests

Test registration over S2S

Move generic s2s code into s2s_helper

Use s2s_helper in muc_SUITE

Disable fed1 cover for MUC-over-S2S tests

Increase timeout for hibernation tests

Add muc_SUITE:can_found_in_db_when_stopped testcase/1

Replace issue= with event= (we've decided to use event= everywhere!)

Check that Nick is not empty in mod_muc:set_nick

Return ok | {error,_} from store_room/4

Return ok | {error,_} from forget_room callback

Do not create room if we have any backend issues

Return {ok, Rooms}|{error,_} from mod_muc_db:get_rooms/1

Fix muc_SUITE to use updated mod_muc API
  • Loading branch information
arcusfelis authored Mar 14, 2018
1 parent b2dcd62 commit f8a01ae
Show file tree
Hide file tree
Showing 11 changed files with 785 additions and 295 deletions.
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ addons:
- slapd
- ldap-utils
- golang # used for google drive test results upload
hosts:
# travis tries to resolve muc.localhost and fails
# used in MUC + s2s tests combination
- muc.localhost
before_install:
- tools/configure $REL_CONFIG
install:
Expand Down
2 changes: 2 additions & 0 deletions doc/modules/mod_muc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Also `mod_muc_log` is a logging submodule.
### Options
* `host` (string, default: `"conference.@HOST@"`): Subdomain for MUC service to reside under.
`@HOST@` is replaced with each served domain.
* `backend` (atom, default: `mnesia`): Storage backend. Currently only `mnesia` is supported.
* `access` (atom, default: `all`): Access Rule to determine who is allowed to use the MUC service.
* `access_create` (atom, default: `all`): Who is allowed to create rooms.
* `access_admin` (atom, default: `none`): Who is the administrator in all rooms.
Expand All @@ -27,6 +28,7 @@ Also `mod_muc_log` is a logging submodule.
* `user_presence_shaper` (atom, default: `none`): Shaper for user presences processed by a room (global for the room).
* `max_user_conferences` (non-negative, default: 10): Specifies the number of rooms that a user can occupy simultaneously.
* `http_auth_pool` (atom, default: `none`): If an external HTTP service is chosen to check passwords for password-protected rooms, this option specifies the HTTP pool name to use (see [External HTTP Authentication](#external-http-authentication) below).
* `load_permanent_rooms_at_startup` (boolean, default: false) - Load all rooms at startup (can be unsafe when there are many rooms, that's why disabled).
* `hibernate_timeout` (timeout, default: `90000`): Timeout (in milliseconds) defining the inactivity period after which the room's process should be hibernated.
* `hibernated_room_check_interval` (timeout, default: `infinity`): Interval defining how often the hibernated rooms will be checked (a timer is global for a node).
* `hibernated_room_timeout` (timeout, default: `inifitniy`): A time after which a hibernated room is stopped (deeply hibernated).
Expand Down
13 changes: 13 additions & 0 deletions include/mod_muc.hrl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-record(muc_room, {
name_host,
opts
}).

-record(muc_online_room, {name_host,
pid
}).

-record(muc_registered, {
us_host,
nick
}).
Loading

0 comments on commit f8a01ae

Please sign in to comment.