# HG changeset patch # User Matthew Wild # Date 1611817451 0 # Node ID 44f6537f6427d636bab985d4136514439b1a470f # Parent 2c47b8110c482ffcf7085a70458aff53dc19ef07 mod_invites_adhoc: Fail contact invite if user is not on current host Only the username was being used, and the host of the requester ignored. Luckily this only affects admins of the host. If they want to create an account they can use the other command. If they want to create a contact they should request from their account on this host. diff -r 2c47b8110c48 -r 44f6537f6427 mod_invites_adhoc/mod_invites_adhoc.lua --- a/mod_invites_adhoc/mod_invites_adhoc.lua Wed Jan 27 16:10:08 2021 +0000 +++ b/mod_invites_adhoc/mod_invites_adhoc.lua Thu Jan 28 07:04:11 2021 +0000 @@ -44,7 +44,15 @@ -- subscription. module:provides("adhoc", new_adhoc("Create new contact invite", "urn:xmpp:invite#invite", function (_, data) - local username = split_jid(data.from); + local username, host = split_jid(data.from); + if host ~= module.host then + return { + status = "completed"; + error = { + message = "This command is only available to users of "..module.host; + }; + }; + end local invite = invites.create_contact(username, allow_user_invites, { source = data.from });