Annotate

mod_broadcast/mod_broadcast.lua @ 6251:694f8fab07d4

: mod_sasl2*** : Update Compability for all of them diff --git a/mod_sasl2/README.md b/mod_sasl2/README.md --- a/mod_sasl2/README.md +++ b/mod_sasl2/README.md @@ -31,6 +31,7 @@ This module requires Prosody **trunk** a Prosody Version Status ----------------------- ---------------- - trunk as of 2024-11-24 Works + trunk as of 2025-05-25 Works + 0.13 Works 0.12 Does not work ----------------------- ---------------- diff --git a/mod_sasl2_bind2/README.md b/mod_sasl2_bind2/README.md --- a/mod_sasl2_bind2/README.md +++ b/mod_sasl2_bind2/README.md @@ -16,5 +16,6 @@ This module depends on [mod_sasl2]. It e Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Works 0.12 Does not work diff --git a/mod_sasl2_fast/README.md b/mod_sasl2_fast/README.md --- a/mod_sasl2_fast/README.md +++ b/mod_sasl2_fast/README.md @@ -33,5 +33,6 @@ clients being logged out unexpectedly. Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Work 0.12 Does not work diff --git a/mod_sasl2_sm/README.md b/mod_sasl2_sm/README.md --- a/mod_sasl2_sm/README.md +++ b/mod_sasl2_sm/README.md @@ -17,5 +17,6 @@ configuration options. Prosody-Version Status --------------- ---------------------- - trunk Works as of 2024-12-21 + trunk Works as of 2025-05-25 + 0.13 Work 0.12 Does not work diff --git a/mod_sasl_ssdp/README.md b/mod_sasl_ssdp/README.md --- a/mod_sasl_ssdp/README.md +++ b/mod_sasl_ssdp/README.md @@ -18,8 +18,8 @@ There are no configuration options for t # Compatibility -For SASL2 (XEP-0388) clients, it is compatible with the mod_sasl2 community module. - -For clients using RFC 6120 SASL, it requires Prosody trunk 33e5edbd6a4a or -later. It is not compatible with Prosody 0.12 (it will load, but simply -won't do anything) for "legacy SASL". + Prosody-Version Status + --------------- ---------------------- + trunk Works as of 2025-05-25 + 0.13 Works + 0.12 Does not work
author Menel <menel@snikket.de>
date Mon, 12 May 2025 11:07:45 +0200
parent 1016:9f7c97e55593
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1015
0fc9e1f086c1 mod_broadcast: Allow admins to broadcast
Matthew Wild <mwild1@gmail.com>
parents: 786
diff changeset
1 local is_admin = require "core.usermanager".is_admin;
786
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
2 local allowed_senders = module:get_option_set("broadcast_senders", {});
1016
9f7c97e55593 mod_broadcast: Allow overriding from address on the broadcast stanza
Matthew Wild <mwild1@gmail.com>
parents: 1015
diff changeset
3 local from_address = module:get_option_string("broadcast_from");
786
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5 local jid_bare = require "util.jid".bare;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 function send_to_online(message)
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 local c = 0;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 for hostname, host_session in pairs(hosts) do
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 if host_session.sessions then
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 for username in pairs(host_session.sessions) do
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
12 c = c + 1;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 message.attr.to = username.."@"..hostname;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 module:send(message);
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 return c;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 function send_message(event)
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22 local stanza = event.stanza;
1015
0fc9e1f086c1 mod_broadcast: Allow admins to broadcast
Matthew Wild <mwild1@gmail.com>
parents: 786
diff changeset
23 local from = stanza.attr.from;
0fc9e1f086c1 mod_broadcast: Allow admins to broadcast
Matthew Wild <mwild1@gmail.com>
parents: 786
diff changeset
24 if is_admin(from) or allowed_senders:contains(jid_bare(from)) then
1016
9f7c97e55593 mod_broadcast: Allow overriding from address on the broadcast stanza
Matthew Wild <mwild1@gmail.com>
parents: 1015
diff changeset
25 if from_address then
9f7c97e55593 mod_broadcast: Allow overriding from address on the broadcast stanza
Matthew Wild <mwild1@gmail.com>
parents: 1015
diff changeset
26 stanza = st.clone(stanza);
9f7c97e55593 mod_broadcast: Allow overriding from address on the broadcast stanza
Matthew Wild <mwild1@gmail.com>
parents: 1015
diff changeset
27 stanza.attr.from = from_address;
9f7c97e55593 mod_broadcast: Allow overriding from address on the broadcast stanza
Matthew Wild <mwild1@gmail.com>
parents: 1015
diff changeset
28 end
786
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
29 local c = send_to_online(stanza);
1015
0fc9e1f086c1 mod_broadcast: Allow admins to broadcast
Matthew Wild <mwild1@gmail.com>
parents: 786
diff changeset
30 module:log("debug", "Broadcast stanza from %s to %d online users", from, c);
786
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 return true;
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32 else
1015
0fc9e1f086c1 mod_broadcast: Allow admins to broadcast
Matthew Wild <mwild1@gmail.com>
parents: 786
diff changeset
33 module:log("warn", "Broadcasting is not allowed for %s", from);
786
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 end
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36
e318a341d332 mod_broadcast: New module to set up a component that forwards received messages to all online users (similar to Openfire's broadcast module) (thanks Yann Verry)
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 module:hook("message/bare", send_message);