comparison mod_server_info/README.md @ 5794:174c77da03f5

mod_server_info: New module to add custom service extension forms to disco
author Matthew Wild <mwild1@gmail.com>
date Tue, 12 Dec 2023 19:08:28 +0000
parents
children
comparison
equal deleted inserted replaced
5793:e304e19536f2 5794:174c77da03f5
1 ---
2 labels:
3 - 'Stage-Alpha'
4 summary: Manually configure extended service discovery info
5 ...
6
7 XEP-0128 defines a way for servers to provide custom information via service
8 discovery. Various XEPs and plugins make use of this functionality, so that
9 e.g. clients can look up necessary information.
10
11 This module allows the admin to manually configure service discovery
12 extensions in the config file. It may be useful as a way to advertise certain
13 information.
14
15 Everything configured here is publicly visible to other XMPP entities.
16
17 ## Configuration
18
19 The `server_info` option accepts a list of dataforms. A dataform is an array
20 of fields. A field has three required properties:
21
22 - `type` - usually `text-single` or `list-multi`
23 - `var` - the field name
24 - `value` the field value
25
26 Example configuration:
27
28 ``` lua
29 server_info = {
30
31 -- Our custom form
32 {
33 -- Conventionally XMPP dataforms have a 'FORM_TYPE' field to
34 -- indicate what type of form it is
35 { type = "hidden", var = "FORM_TYPE", value = "urn:example:foo" };
36
37 -- Advertise that our maximum speed is 88 mph
38 { type = "text-single", var = "speed", value = "88" };
39
40 -- Advertise that the time is 1:20 AM and zero seconds
41 { type = "text-single", var = "time", value = "01:21:00" };
42 };
43
44 }
45 ```
46
47 ## Compatibility
48
49 This module should be compatible with Prosody 0.12, and possibly earlier
50 versions.