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

234 Commits

Author SHA1 Message Date
Evgeny Khramtsov
b0379db5a1 Fix formatting 2019-07-10 23:46:42 +03:00
Evgeny Khramtsov
d1b5844d64
Merge pull request #2900 from aquarhead/protect-muc-owner
Protect against bad muc#owner requests
2019-07-10 23:46:08 +03:00
Evgeny Khramtsov
43da45cf67 Improve type specs of mod_muc_room 2019-07-09 15:21:17 +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
80beb6d6f6 Improve formatting of exceptions 2019-07-07 22:12:14 +03: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
a2a061c1c8 Avoid using broad p1_queue:queue() type wherever possible 2019-06-28 22:16:29 +03:00
Evgeny Khramtsov
39cf8d86d6 Avoid using broad map() type wherever possible 2019-06-27 15:22:27 +03:00
Evgeny Khramtsov
b479fe5315 Use correct stacktrace in logging macros
By calling erlang:get_stacktrace() inside a lager function
we obtain actually a stacktrace of the lager function, not
the one we got during exception. This is not a problem for
newest Erlang versions though.
2019-06-26 00:05:41 +03:00
Paweł Chmielowski
7b35690bc9 Store muc_subscribers in process dict if get_subscribed_rooms not available 2019-06-25 16:41:47 +02: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
a02cff0e78 Use new configuration validator 2019-06-14 12:33:26 +03:00
Paweł Chmielowski
d48c067681 Return jid_malformed error when sending presence without nick to conference 2019-06-13 18:42:02 +02: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
LOU Xun
8d6455460d
Protect against bad muc#owner requests 2019-06-06 15:40:13 +00: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
eac7a77b6a Fix room state cleanup from db on change of persistent option change 2019-04-30 17:34:49 +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
Paweł Chmielowski
17444ba84e Allow non-moderator subscribers to get list of room subscribers 2019-04-25 14:52:47 +02:00
Paweł Chmielowski
875b2daff1 Add hook room_destroyed called when room gets destroyed 2019-04-17 18:56:25 +02:00
Paweł Chmielowski
c96a925fde Add hooks for tracking mucsub subscriptions changes 2019-04-15 12:03:30 +02: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
Paweł Chmielowski
063869603a Include id in mucsub notification message 2019-03-28 14:43:28 +01:00
Paweł Chmielowski
5077d39600 Add check for ljid when setting up subscribers 2019-03-14 15:54:51 +01:00
Evgeny Khramtsov
0715e62a41 Use jid() instead of ljid() 2019-03-14 14:34:15 +03: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
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