Mercurial > prosody-modules
view mod_muc_moderation_delay/mod_muc_moderation_delay.lua @ 6319:04c3273cb81f
mod_auth_cyrus: Add empty 'profile' table to SASL handler objects
This is for compatibility with Prosody's built-in util.sasl objects.
A SASL profile table usually includes methods supported by the backend, which
can be used by SASL mechanism handlers to perform operations (such as testing
the password). It also optionally contains a 'cb' field with channel binding
method handlers.
The Cyrus backend doesn't support channel binding, and doesn't have the same
concept of auth backend methods (it handles all that internally, and Prosody
has no insight or control over it).
Thus, we create an empty profile which informs Prosody that the SASL handler
does not support any of the auth or channel binding methods. Some features
will not work, but they didn't work anyway. This just makes it explicit.
This fixes a traceback in mod_sasl2_fast, which expected SASL handlers to
always contain a 'profile' field.
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 04 Sep 2025 10:14:46 +0100 |
| parents | 959382fac20c |
| children |
line wrap: on
line source
-- mod_muc_moderation_delay -- -- SPDX-FileCopyrightText: 2024 John Livingston <https://www.john-livingston.fr/> -- SPDX-License-Identifier: AGPL-3.0-only -- -- This file is AGPL-v3 licensed. -- Please see the Peertube livechat plugin copyright information. -- https://livingston.frama.io/peertube-plugin-livechat/credits/ -- local add_disco_form = module:require("config").add_disco_form; local config_submitted = module:require("config").config_submitted; local add_form_option = module:require("config").add_form_option; local handle_broadcast_message = module:require("delay").handle_broadcast_message; -- form_position: the position in the room config form (this value will be passed as priority for the "muc-config-form" hook). -- By default, field will be between muc#roomconfig_changesubject and muc#roomconfig_moderatedroom local form_position = module:get_option_number("moderation_delay_form_position") or 80-2; -- Plugin dependencies local mod_muc = module:depends "muc"; -- muc-disco and muc-config to configure the feature: module:hook("muc-disco#info", add_disco_form); module:hook("muc-config-submitted/muc#roomconfig_moderation_delay", config_submitted); module:hook("muc-config-form", add_form_option, form_position); -- intercept muc-broadcast-message, and broadcast with delay if required. -- Priority is negative, as we want it to be the last handler. module:hook("muc-broadcast-message", handle_broadcast_message, -1000);
