Mercurial > prosody-modules
comparison mod_easy_invite/mod_easy_invite.lua @ 4082:6cdbca89b8be
mod_easy_invite: Minor refactoring to begin merging additional changes from Snikket
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Mon, 07 Sep 2020 12:50:36 +0100 |
parents | 7e2db4d61f6c |
children | e7eb46d976ae |
comparison
equal
deleted
inserted
replaced
4081:3c18d8deeb38 | 4082:6cdbca89b8be |
---|---|
172 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite); | 172 local validated_invite = event.validated_invite or (event.session and event.session.validated_invite); |
173 if not validated_invite then | 173 if not validated_invite then |
174 return; | 174 return; |
175 end | 175 end |
176 local inviter_username = validated_invite.inviter; | 176 local inviter_username = validated_invite.inviter; |
177 local contact_username = event.username; | |
177 validated_invite:use(); | 178 validated_invite:use(); |
178 | 179 |
179 if not inviter_username then return; end | 180 if inviter_username then |
180 | 181 module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username); |
181 local contact_username = event.username; | 182 subscribe_both(module.host, inviter_username, contact_username); |
182 | 183 end |
183 module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username); | 184 |
184 subscribe_both(module.host, inviter_username, contact_username); | 185 |
185 end); | 186 end); |
186 | 187 |
187 do | 188 do |
188 -- Telnet command | 189 -- Telnet command |
189 -- Since the telnet console is global this overwrites the command for | 190 -- Since the telnet console is global this overwrites the command for |