Software /
code /
prosody
Annotate
teal-src/plugins/muc/muc.lib.d.tl @ 12918:ed20555f163a
util.sasl.oauthbearer: Fix traceback on authz in unexpected format
E.g. if you were to just pass "username" without @hostname, the split
will return nil, "username" and the nil gets passed to saslprep() and it
does not like that.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 02 Mar 2023 14:37:46 +0100 |
parent | 12893:d7046ffc59f3 |
rev | line source |
---|---|
12891
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 local Stanza = require "util.stanza".stanza_t |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 local record Room |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 jid : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 enum Affiliation |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 "outcast" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 "none" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 "member" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 "admin" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 "owner" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 end |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
13 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
14 enum Role |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
15 "none" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
16 "visitor" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
17 "participant" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
18 "moderator" |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
19 end |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
20 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
21 record Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
22 bare_jid : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
23 nick : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
24 sessions : { string : Stanza } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
25 role : Role |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
26 jid : string |
12893
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
27 |
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
28 choose_new_primary : function (Occupant) : string |
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
29 set_session : function (Occupant, string, Stanza, boolean) |
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
30 remove_session : function (Occupant, string) |
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
31 each_session : function (Occupant) -- TODO Iterator |
d7046ffc59f3
MUC: Add Occupant API methods to Teal spec
Kim Alvefur <zash@zash.se>
parents:
12892
diff
changeset
|
32 |
12891
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
33 end |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
34 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
35 -- Private properties |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
36 _jid_nick : { string : string } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
37 _occupants : { string : Occupant } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
38 _data : { string : any } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
39 _affiliations : { string : Affiliation } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
40 _affiliation_data : { string : { string : any } } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
41 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
42 -- Occupant methods |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
43 get_occupant_jid : function (Room, real_jid : string) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
44 new_occupant : function (Room, bare_real_jid : string, nick : string) : Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
45 get_occupant_by_nick : function (Room, nick : string) : Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
46 type OccupantIterator = function ({string:Occupant}, occupant_jid : string) : string, Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
47 each_occupant : function (Room, read_only : boolean) : OccupantIterator, {string:Occupant}, nil |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
48 has_occupant : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
49 get_occupant_by_real_jid : function (Room, real_jid : string) : Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
50 save_occupant :function (Room, Occupant) : Occupant |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
51 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
52 -- Affiliation methods |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
53 type AffiliationIterator = function (any, jid : string) : string, Affiliation |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
54 get_affiliation : function (Room, jid : string) : Affiliation |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
55 each_affiliation : function (Room, Affiliation) : AffiliationIterator, nil, nil |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
56 set_affiliation : function (Room, jid : string, Affiliation, reason : string, data : { string : any }) : boolean, string, string, string -- ok + error tripplet |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
57 get_affiliation_data : function (Room, jid : string, key : string) : any |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
58 set_affiliation_data : function (Room, jid : string, key : string, value : any) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
59 get_registered_nick : function (Room, jid : string) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
60 get_registered_jid : function (Room, nick : string) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
61 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
62 -- Role methods |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
63 get_default_role : function (Room, Affiliation) : Role, integer |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
64 get_role : function (Room, nick : string) : Role |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
65 may_set_role : function (Room, actor : string, Occupant, Role) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
66 set_role : function (Room, actor : string, occupant_jid : string, Role, reason : string) : boolean, string, string, string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
67 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
68 -- Routing input, generally handled by mod_muc and hooked up to Prosody routing events |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
69 handle_first_presence : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
70 handle_normal_presence : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
71 handle_presence_to_room : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
72 handle_presence_to_occupant : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
73 handle_message_to_room : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
74 handle_message_to_occupant : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
75 handle_groupchat_to_room : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
76 handle_iq_to_occupant : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
77 handle_disco_info_get_query : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
78 handle_disco_items_get_query : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
79 handle_admin_query_set_command : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
80 handle_admin_query_get_command : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
81 handle_owner_query_get_to_room : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
82 handle_owner_query_set_to_room : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
83 handle_mediated_invite : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
84 handle_mediated_decline : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
85 handle_role_request : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
86 handle_register_iq : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
87 handle_kickable : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
88 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
89 -- Routing output |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
90 broadcast : function (Room, Stanza, function (nick : string, Occupant) : boolean) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
91 broadcast_message : function (Room, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
92 route_stanza : function (Room, Stanza) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
93 route_to_occupant : function (Room, Occupant, Stanza) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
94 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
95 -- Sending things to someone joining |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
96 publicise_occupant_status : function (Room, Occupant, x : Stanza, nick : string, actor : string, reason : string, prev_role : Role, force_unavailable : boolean, recipient : Occupant) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
97 send_occupant_list : function (Room, to : string, filter : function (occupant_jid : string, Occupant) : boolean) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
98 send_history : function (Room, Stanza) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
99 send_subject : function (Room, to : string, time : number) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
100 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
101 respond_to_probe : function (Room, table, Stanza, Occupant) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
102 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
103 -- Constructors for various answer stanzas |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
104 get_disco_info : function (Room, Stanza) : Stanza |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
105 get_disco_items : function (Room, Stanza) : Stanza |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
106 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
107 build_item_list : function (Room, Occupant, Stanza, is_anonymous : boolean, nick : string, actor_nick : string, actor_jid : string, reason : string) : Stanza |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
108 build_unavailable_presence : function (Room, from_muc_jid : string, to_jid : string) : Stanza |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
109 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
110 -- Form handling |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
111 send_form : function (Room, table, Stanza) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
112 get_form_layout : function (Room, actor : string) : table |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
113 process_form : function (Room, table, Stanza) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
114 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
115 -- Properties and configuration |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
116 get_name : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
117 set_name : function (Room, string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
118 get_description : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
119 set_description : function (Room, string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
120 get_language : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
121 set_language : function (Room, string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
122 get_hidden : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
123 set_hidden : function (Room, boolean) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
124 get_public : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
125 set_public : function (Room, boolean) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
126 get_password : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
127 set_password : function (Room, string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
128 get_members_only : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
129 set_members_only : function (Room, boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
130 get_allow_member_invites : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
131 set_allow_member_invites : function (Room, boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
132 get_moderated : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
133 set_moderated : function (Room, boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
134 get_persistent : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
135 set_persistent : function (Room, boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
136 get_changesubject : function (Room) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
137 set_changesubject : function (Room, boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
138 get_subject : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
139 set_subject : function (Room, string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
140 get_historylength : function (Room) : integer |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
141 set_historylength : function (Room, integer) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
142 get_presence_broadcast : function (Room) : { Role : boolean } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
143 set_presence_broadcast : function (Room, { Role : boolean }) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
144 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
145 is_anonymous_for : function (Room, jid : string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
146 get_salt : function (Room) : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
147 get_occupant_id : function (Room, Occupant) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
148 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
149 -- Room teardown |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
150 clear : function (Room, x : Stanza) |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
151 destroy : function (Room, newjid : string, reason : string, password : string) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
152 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
153 -- Room state persistence |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
154 record FrozenRoom |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
155 _jid : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
156 _data : { string : any } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
157 _affiliation_data : { string : { string : any } } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
158 -- { string : Affiliation } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
159 end |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
160 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
161 record StateEntry |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
162 bare_jid : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
163 role : Role |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
164 jid : string |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
165 end |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
166 |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
167 save : function (Room, forced : boolean, savestate : boolean) : boolean |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
168 freeze : function (Room, live : boolean) : FrozenRoom, { string : StateEntry } |
93ce4244d433
MUC: Start on a Teal description of MUC rooms
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
169 end |
12892
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
170 |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
171 local record lib |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
172 new_room : function (jid : string, config : { string : any }) : Room |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
173 restore_room : function (Room.FrozenRoom, { string : Room.StateEntry }) : Room |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
174 |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
175 room_mt : metatable |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
176 end |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
177 |
d788714fcf21
MUC: Add Teal description of muc.lib functions
Kim Alvefur <zash@zash.se>
parents:
12891
diff
changeset
|
178 return lib |