comparison mod_easy_invite/mod_easy_invite.lua @ 4084:9d11c18d4d7e

mod_easy_invite: Allow setting account roles from associated invite (from Snikket)
author Matthew Wild <mwild1@gmail.com>
date Mon, 07 Sep 2020 12:52:16 +0100
parents e7eb46d976ae
children fe75cc43dfbf
comparison
equal deleted inserted replaced
4083:e7eb46d976ae 4084:9d11c18d4d7e
180 if inviter_username then 180 if inviter_username then
181 module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username); 181 module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username);
182 subscribe_both(module.host, inviter_username, contact_username); 182 subscribe_both(module.host, inviter_username, contact_username);
183 end 183 end
184 184
185 if validated_invite.additional_data then
186 module:log("debug", "Importing roles from invite");
187 local roles = validated_invite.additional_data.roles;
188 if roles then
189 module:open_store("roles"):set(contact_username, roles);
190 end
191 end
192 end);
185 193
186 end); 194 end);
187 195
188 do 196 do
189 -- Telnet command 197 -- Telnet command