Mercurial > prosody-modules
annotate mod_muc_auto_hats/README.md @ 6500:36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Wed, 25 Mar 2026 18:47:51 +0000 |
| parents | |
| children |
| rev | line source |
|---|---|
|
6500
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
1 --- |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
2 labels: |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
3 - 'Stage-Alpha' |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
4 summary: 'Dynamically set hats based on configurable policies' |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
5 ... |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
6 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
7 Introduction |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
8 ============ |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
9 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
10 This module lets you dynamically assign hats to MUC occupants based on |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
11 configuration rules. |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
12 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
13 Currently the only supported rule type is based on the host that the user is |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
14 joining from. More rule types may be added in the future. |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
15 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
16 Configuration |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
17 ============= |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
18 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
19 Add the module to the MUC host (not the global modules\_enabled): |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
20 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
21 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
22 ``` {.lua} |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
23 Component "conference.example.com" "muc" |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
24 modules_enabled = { "muc_auto_hats" } |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
25 ``` |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
26 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
27 Then add configuration rules. |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
28 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
29 Hats are identified by URIs, which must be unique (they are not displayed to |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
30 the user). If you don't specify one, Prosody will generate a unique one for |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
31 you. Each hat also has a human-readable 'title'. Again, Prosody will generate |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
32 a default if you don't specify one. |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
33 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
34 ## By user host |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
35 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
36 ``` {.lua} |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
37 muc_auto_hats_by_host = { |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
38 ["anon.example.com"] = { |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
39 title = "Web chat"; |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
40 }; |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
41 ["staff.example.com"] = { |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
42 title = "Staff"; |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
43 uri = "https://example.com/roles/staff"; |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
44 }; |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
45 } |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
46 ``` |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
47 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
48 Compatibility |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
49 ============= |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
50 |
|
36b9d79e04b7
mod_muc_auto_hats: New module to dynamically assign hats based on config
Matthew Wild <mwild1@gmail.com>
parents:
diff
changeset
|
51 Requires Prosody 13.0+ |
