aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/mod_muc.lua
Commit message (Collapse)AuthorAgeFilesLines
* plugins: Prefix module imports with prosody namespaceKim Alvefur2023-03-241-9/+9
|
* MUC: Add note about non-existant room methodKim Alvefur2023-01-201-1/+1
|
* mod_muc: Better map restrict_room_creation to role permissions (behaviour ↵Matthew Wild2022-09-291-21/+8
| | | | | | | | | | | | | | | | | | change) With this change and 427dd01f0864, room creation is now effectively restricted to parent-host users by default. This is a better default than previous Prosody versions (where room creation was not restricted). The "local" option for restrict_room_creation is no longer used (any value other than true/false won't change the default behaviour). restrict_room_creation = true will grant prosody:admin the ability to create rooms. restrict_room_creation = false disables all permission checks. Anything between these two can be achieved using custom roles and permissions.
* Switch to a new role-based authorization framework, removing is_admin()Matthew Wild2022-06-151-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We began moving away from simple "is this user an admin?" permission checks before 0.12, with the introduction of mod_authz_internal and the ability to dynamically change the roles of individual users. The approach in 0.12 still had various limitations however, and apart from the introduction of roles other than "admin" and the ability to pull that info from storage, not much actually changed. This new framework shakes things up a lot, though aims to maintain the same functionality and behaviour on the surface for a default Prosody configuration. That is, if you don't take advantage of any of the new features, you shouldn't notice any change. The biggest change visible to developers is that usermanager.is_admin() (and the auth provider is_admin() method) have been removed. Gone. Completely. Permission checks should now be performed using a new module API method: module:may(action_name, context) This method accepts an action name, followed by either a JID (string) or (preferably) a table containing 'origin'/'session' and 'stanza' fields (e.g. the standard object passed to most events). It will return true if the action should be permitted, or false/nil otherwise. Modules should no longer perform permission checks based on the role name. E.g. a lot of code previously checked if the user's role was prosody:admin before permitting some action. Since many roles might now exist with similar permissions, and the permissions of prosody:admin may be redefined dynamically, it is no longer suitable to use this method for permission checks. Use module:may(). If you start an action name with ':' (recommended) then the current module's name will automatically be used as a prefix. To define a new permission, use the new module API: module:default_permission(role_name, action_name) module:default_permissions(role_name, { action_name[, action_name...] }) This grants the specified role permission to execute the named action(s) by default. This may be overridden via other mechanisms external to your module. The built-in roles that developers should use are: - prosody:user (normal user) - prosody:admin (host admin) - prosody:operator (global admin) The new prosody:operator role is intended for server-wide actions (such as shutting down Prosody). Finally, all usage of is_admin() in modules has been fixed by this commit. Some of these changes were trickier than others, but no change is expected to break existing deployments. EXCEPT: mod_auth_ldap no longer supports the ldap_admin_filter option. It's very possible nobody is using this, but if someone is then we can later update it to pull roles from LDAP somehow.
* MUC: Add method for getting the occupant id salt to allow reuseKim Alvefur2021-10-051-0/+1
|
* MUC: Allow modules a chance to act prior to room destructionKim Alvefur2021-12-051-3/+7
|
* MUC: Report number of live rooms to statsmanagerKim Alvefur2021-03-281-0/+5
| | | | Should help inform on whether the cache size should be increased.
* MUC: Merge mod_muc_occupant_id into a sub-module (thanks pep.!)Matthew Wild2020-11-241-0/+2
|
* MUC: Don't default room name to JID localpart (API breaking change)Kim Alvefur2020-08-291-3/+13
| | | | | | | | | | | | | Behavior with turning empty name into localpart was originally introduced in 711eb5bf94b4 This has caused some problems for clients, making it difficult to differentiate between a room actually named like the localpart from a room without a name. Breaking: The function signature of the :get_name() method changes from always returning a string to optional string.
* MUC: Add ad-hoc command setting affiliation in a room (fixes #1174)Kim Alvefur2020-03-211-0/+43
| | | | | | | | | | This gives service admins a way to set an arbitrary affiliation in any room. Enables various administrative use cases such as room ownership reassignment or recovery. Reduces the need for the admins-as-owners feature, as this can be used by admins to make themselves owner in any room when needed, instead of being owners all the time.
* MUC: Add initial hats support (broadcast only)Matthew Wild2020-03-181-0/+1
| | | | | | | | Based on the currently-deferred XEP-0317. The protocol differs a little (because XEP-0317 is incomplete), therefore currently we use a custom namespace. The plan is to update and finish XEP-0317.
* Merge 0.11->trunkMatthew Wild2020-02-131-1/+2
|\
| * mod_muc: Allow control over the server-admins-are-room-owners feature (see ↵Matthew Wild2020-02-131-1/+2
| | | | | | | | #1174)
* | MUC: Indicate the component as origin of various errors where there's no roomKim Alvefur2019-11-261-6/+6
| | | | | | | | A room that doesn't exist can't return an error, can it?
* | MUC: Indicate that the room is the origin of various errors where 'from' is ↵Kim Alvefur2019-11-251-1/+1
| | | | | | | | an occupant JID
* | MUC: Strictly validate room JID on creationKim Alvefur2019-11-011-0/+8
| | | | | | | | This should prevent any MUCs with invalid JID (according to current normalization routine)
* | MUC: Add controls for whose presence is broadcast (closes #1335)Lance Stout2019-10-201-0/+7
| | | | | | | | Committed by Zash
* | MUC: Move check for explicit room join earlier in room creation flowKim Alvefur2018-11-271-1/+1
|/
* MUC: Use defaults from config in create_room() if no config providedMatthew Wild2018-11-151-12/+18
|
* MUC: Add support for registering with a MUC, including reserving a nickname ↵Matthew Wild2018-09-031-0/+6
| | | | as per XEP-0045
* MUC: Add support for storing additional data with MUC affiliationsMatthew Wild2018-09-031-2/+2
| | | | | | XEP-0045 registration provides examples of registering a nickname and various other details. This also allows modules to store arbitrary private data about an affiliated entity.
* MUC: Normalize indentationKim Alvefur2018-08-221-3/+3
|
* MUC: Fix traceback when failing to restore a roomMatthew Wild2018-08-171-0/+3
| | | | | When a room exists in the DB but cannot be loaded (e.g. due to max_rooms or a pre-restore handler) restore_room()/get_room_from_jid() returns false.
* MUC: Pass missing argument to log messageKim Alvefur2018-08-171-1/+1
|
* MUC: Allow destruction of tombstones (eg via telnet or adhoc command)Kim Alvefur2018-08-031-0/+3
| | | | | Otherwise this just updates the timestamp, which is probably the opposite of what the user wanted
* MUC: Split long lines [luacheck strict]Kim Alvefur2018-08-031-4/+8
|
* mod_muc: Fire event when room is (and about to be) restoredMatthew Wild2018-08-031-0/+4
|
* mod_muc: Add commentMatthew Wild2018-08-031-0/+1
|
* MUC: Add some comments clarifying methodsMatthew Wild2018-07-171-0/+2
|
* MUC: Add new iteration methods, all_rooms/live_rooms to eventually replace ↵Matthew Wild2018-07-171-10/+20
| | | | each_room
* MUC: Rename variable for consistency with other code that uses the term 'live'Matthew Wild2018-07-171-3/+3
|
* MUC: Return 'gone' error for destroyed rooms in other cases than attempted joinKim Alvefur2018-07-161-7/+7
| | | | | | | Lock expiry -> Reset Admin wants to join -> Reset Still locked -> cancel, gone Don't return error in response to an error
* MUC: Add sections in room config formMatthew Wild2018-07-131-0/+2
|
* MUC: Include redirect in 'gone' error for destroyed roomsKim Alvefur2018-07-111-0/+4
|
* MUC: Send an 'gone' error instead of unavailable + <destroyed>Kim Alvefur2018-07-111-5/+1
| | | | | List discussion here: https://mail.jabber.org/pipermail/standards/2018-July/035228.html
* MUC: Allow an admin to recreate destroyed roomsKim Alvefur2018-07-111-2/+2
|
* MUC: Add support for storing a tombstone for destroyed rooms (#1182)Kim Alvefur2018-07-111-0/+42
|
* MUC: Remove room state on successful restoration from diskKim Alvefur2018-07-111-1/+6
|
* MUC: Purge saved room state when deleting a roomKim Alvefur2018-07-111-0/+1
|
* MUC: Log a debug message when a non-persistent room becomes empty and is ↵Kim Alvefur2018-07-111-0/+1
| | | | destroyed
* MUC: Flag rooms being destroyed (fixes #887)Kim Alvefur2018-07-101-0/+1
|
* mod_muc: Add support for muc_room_default_allow_member_invitesMatthew Wild2018-07-061-0/+1
|
* MUC: Add config option to allow members to invite other members to the room ↵Matthew Wild2018-07-061-0/+2
| | | | (previously only owners/admins could do this)
* MUC: Remove affiliation notify support, nothing uses itMatthew Wild2018-06-271-2/+0
|
* MUC: Measure cache hits and missesKim Alvefur2018-06-231-0/+4
|
* MUC: Rename eviction hit rate measureKim Alvefur2018-06-231-2/+2
|
* MUC: Expose method for creating a bare room objectKim Alvefur2018-06-061-0/+1
|
* MUC: Track rooms created via internal public APIKim Alvefur2018-06-061-1/+1
| | | | Fixes muc:create() in the telnet console
* MUC: Allow passing config to public create_room APIKim Alvefur2018-04-141-2/+2
|
* MUC: Fix Ooo (thanks pep.)Kim Alvefur2018-06-031-6/+6
| | | | What time is it?