Commit Graph

207 Commits

Author SHA1 Message Date
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
Paweł Chmielowski 77ac0584ed Remove now() calls that sneaked in in pull requests 2019-02-27 09:56:31 +01:00
Badlop e18522f74c Once just_created isn't true, use it to keep room process creation (#2787) 2019-02-11 16:56:33 +01:00
Paweł Chmielowski ea32d3f02c Send mucsub subscriber notification events with from set to room jid 2019-02-11 13:04:06 +01:00
AquarHEAD Lou 3f3e04812b
Rename two presence functions
send_self_presence is actually implementing XEP-0115, while
send_initial_presence is implementing the "self-presence" step as
described in XEP-0045
2019-01-27 16:48:05 +00:00
Paweł Chmielowski 9e0baef233 Make last commit compile on R19 2019-01-22 14:40:01 +01:00
Paweł Chmielowski 74731a5816 Make sure that room_destroyed is called even when some code throws in terminate
We observed that some code was throwing exception in muc_room:terminate()
and that make this room not properly unregister itself from muc_online
table.
2019-01-22 14:22:23 +01: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
Paweł Chmielowski c88a2d0569 Add code for handling deprecations of get_stacktrace() 2018-12-13 11:46:53 +01:00
Evgeny Khramtsov 624485fe26 Implement XEP-0410: MUC Self-Ping optimization
Fixes #2630
2018-11-29 12:16:12 +03:00
Evgeny Khramtsov 3f901b3793 Advertise disco#info and disco#items by MUC room
Fixes #2661
2018-11-29 10:35:03 +03:00
Evgeny Khramtsov 1d80addb7d Get rid of 'catch-all' statements 2018-11-15 15:07:58 +03:00
Evgeny Khramtsov 43498b39c1 Replace dict with maps
This will improve performance and memory consumptions of large MUCs
2018-11-15 14:13:45 +03:00
Badlop da9bcc3370 Recover logging of user joining room, lost in 32de9a56 (thanks to elexis1) 2018-11-09 13:21:35 +01:00
Holger Weiss 30393bb690 Move unwrap_mucsub_message/1 into misc 2018-10-25 01:22:57 +02:00
Holger Weiss a8b11b6474 Move some functions from xmpp back into ejabberd 2018-10-25 01:05:45 +02:00
Badlop b010a1a0a0 Affiliations other than admin and owner cannot invite to members_only rooms
This is explained in the paragraph:
 If the room is members-only, the service MAY also add the invitee to the
 member list. (Note: Invitation privileges in members-only rooms SHOULD be
 restricted to room admins; if a member without privileges to edit the
 member list attempts to invite another user, the service SHOULD return
 a <forbidden/> error to the occupant; for details, see the Modifying the
 Member List section of this document.)
https://xmpp.org/extensions/xep-0045.html#invite-mediated
2018-10-17 12:57:18 +02:00
Paweł Chmielowski 914fae3d3e Change logic for archiving mucsub messages
This change should apply usual logic for message wrapped in mucsub except
check for groupchat message, so messages without bodies for example
should be rejected
2018-10-10 18:12:35 +02:00
Badlop e054c2800b Allow a subscribed owner/admin to kick lower-affiliation moderator 2018-09-25 10:55:57 +02:00
Badlop 49f1b4a691 Allow an occupant owner/admin to kick lower-affiliation moderator 2018-09-25 10:55:56 +02:00
Badlop 8b61c7fe4b Allow a subscribed owner/admin to kick participants and visitors 2018-09-25 10:55:54 +02:00
Badlop 9bac2fa185 Allow a subscribed owner/admin to change participant<->visitor 2018-09-25 10:55:51 +02:00
Paweł Chmielowski 0394baaa7a Allow changing invitation message from muc_invite hook 2018-09-21 16:37:52 +02: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
Holger Weiss adf0d7de91 mod_muc_room: Fix the room's CAPS hash
Don't forget the room's xdata when calculating the CAPS hash.
2018-09-14 00:18:17 +02:00
Paweł Chmielowski 79c511a441 Add information about real sender to mucsub message meta 2018-09-06 13:36:59 +02: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
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
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 6acac7c93f Render roomname, allowinvites and allowpm in room disco#info 2018-06-19 14:02:45 +03:00
Evgeniy Khramtsov 49b08949b1 Do not check for deprecated types
Since we support only Erlang >= OTP-17.5, the check for old-style
dict/queue/etc types is no longer needed
2018-06-14 18:58:35 +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 4337300fce Always display room's xdata in disco#info 2018-06-01 09:07:16 +03:00
Evgeniy Khramtsov cab8005bf3 Display muc#roomconfig_changesubject in room's disco#info
Fixes #2449
2018-06-01 08:56:56 +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 ca28faa51a Fix get_affiliation/2 2018-04-24 12:07:10 +03:00
Evgeniy Khramtsov 06ce884aa8 Add stubs for affiliation-specific backend callbacks 2018-04-23 11:35:43 +03:00
Evgeniy Khramtsov 63dba3fd64 Merge branch 'master' into muc-self-presence 2018-03-03 21:09:27 +03:00
Evgeniy Khramtsov da1a5036fe Revert "Support for default values in default_room_opts"
This reverts commit 5054a9933f.
The commit is plain wrong: similar options are not required to
be in pair.
2018-03-03 21:08:05 +03:00
Badlop 5054a9933f Support for default values in default_room_opts 2018-02-26 17:22:37 +01:00
Evgeniy Khramtsov 0acc69e303 Use nicks in disco#items or disco#info report 2018-02-21 10:25:15 +03:00
Evgeniy Khramtsov 32e5a3255d Export aux functions from mod_muc_room 2018-02-16 08:28:33 +03:00
Evgeniy Khramtsov ffe02c46e4 Let a MUC room to route presences from its bare JID
The goal for this is to provide entity capabilities (XEP-0115) and
vCard-based avatar hash (XEP-0153)
2018-02-12 17:37:36 +03:00
Evgeniy Khramtsov 2269d290d8 Switch to newer fast_xml and xmpp and update record fields in the code 2018-01-25 20:02:47 +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