prosody: Add new module mod_invites_default_group to add the default group to in-app invites

This commit is contained in:
Matthew Wild 2021-01-28 21:28:40 +00:00
parent cfe9f747c5
commit dfb6cab374
3 changed files with 13 additions and 0 deletions

View File

@ -95,6 +95,7 @@ modules_enabled = {
"invites_register";
"invites_register_api";
"invites_tracking";
"invites_default_group";
"invites_api";
"watchregistrations";

View File

@ -118,6 +118,7 @@
loop:
- mod_update_check
- mod_update_notify
- mod_invites_default_group
- name: "Install lua-ossl for encrypted push notifications"
apt:

View File

@ -0,0 +1,11 @@
-- This module adds groupless invites created via the app to
-- the default group
module:hook("invite-created", function (invite)
if invite.type == "roster"
and not (invite.additional_data and invite.additional_data.groups) then
if not invite.addititional_data then
invite.additional_data = {};
end
invite.additional_data.groups = { "default" };
end
end);