From ba11d641910a93c898832ed36c3dc783c33ac06f Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 15 Mar 2022 21:59:51 +0100 Subject: mod_invites_register: Push invitee contact entry to inviter Invitee would not show up in the roster of the invite creator unless they fetch their roster afterwards. Fixes #1715 Thanks gerald --- plugins/mod_invites_register.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_invites_register.lua b/plugins/mod_invites_register.lua index 9a5570ab..d1d801ad 100644 --- a/plugins/mod_invites_register.lua +++ b/plugins/mod_invites_register.lua @@ -141,6 +141,7 @@ module:hook("user-registered", function (event) 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); + rostermanager.roster_push(inviter_username, module.host, contact_username.."@"..module.host); end if validated_invite.additional_data then -- cgit v1.2.3 From 8e5fec3220ced0c1c912bf63a84fc60f777c6607 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 15 Mar 2022 10:48:46 +0100 Subject: mod_admin_socket: Compat for luasocket prior to unix datagram support The "socket.unix" module exported only a function before https://github.com/lunarmodules/luasocket/commit/aa1b8cc9bc35e56de15eeb153c899e4c51de82a8 when datagram support was added. Fixes #1717 Thanks rsc and lucas for reporting and testing --- plugins/mod_admin_socket.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index b197adae..5eaef2e7 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -2,6 +2,9 @@ module:set_global(); local have_unix, unix = pcall(require, "socket.unix"); +if have_unix and type(unix) == "function" then + unix = { stream = unix }; +end if not have_unix or type(unix) ~= "table" then module:log_status("error", "LuaSocket unix socket support not available or incompatible, ensure it is up to date"); return; -- cgit v1.2.3 From 7badf61246f39df241a0d47eb433dc93eb05b6a5 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 16 Mar 2022 19:32:17 +0100 Subject: mod_admin_socket: Comment on LuaSocket UNIX compat code Ref #1717 --- plugins/mod_admin_socket.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua index 5eaef2e7..ffea9c61 100644 --- a/plugins/mod_admin_socket.lua +++ b/plugins/mod_admin_socket.lua @@ -3,6 +3,12 @@ module:set_global(); local have_unix, unix = pcall(require, "socket.unix"); if have_unix and type(unix) == "function" then + -- COMPAT #1717 + -- Before the introduction of datagram support, only the stream socket + -- constructor was exported instead of a module table. Due to the lack of a + -- proper release of LuaSocket, distros have settled on shipping either the + -- last RC tag or some commit since then. + -- Here we accomodate both variants. unix = { stream = unix }; end if not have_unix or type(unix) ~= "table" then -- cgit v1.2.3