Changeset

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 4081:3c18d8deeb38
children 4083:e7eb46d976ae
files mod_easy_invite/mod_easy_invite.lua
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_easy_invite/mod_easy_invite.lua	Mon Sep 07 13:04:01 2020 +0100
+++ b/mod_easy_invite/mod_easy_invite.lua	Mon Sep 07 12:50:36 2020 +0100
@@ -174,14 +174,15 @@
 		return;
 	end
 	local inviter_username = validated_invite.inviter;
+	local contact_username = event.username;
 	validated_invite:use();
 
-	if not inviter_username then return; end
+	if inviter_username then
+		module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username);
+		subscribe_both(module.host, inviter_username, contact_username);
+	end
 
-	local contact_username = event.username;
 
-	module:log("debug", "Creating mutual subscription between %s and %s", inviter_username, contact_username);
-	subscribe_both(module.host, inviter_username, contact_username);
 end);
 
 do