Diff

mod_minimix/mod_minimix.lua @ 3123:f4e86d2662ec

mod_minimix: Handle having received no presence (should not happen)
author Kim Alvefur <zash@zash.se>
date Tue, 19 Jun 2018 22:00:17 +0200
parent 3122:c69f32c9c576
child 3124:cabe58ae17c9
line wrap: on
line diff
--- a/mod_minimix/mod_minimix.lua	Tue Jun 19 21:59:34 2018 +0200
+++ b/mod_minimix/mod_minimix.lua	Tue Jun 19 22:00:17 2018 +0200
@@ -32,8 +32,11 @@
 		if data:get(username, room_jid, "subject") then
 			module:log("debug", "Already joined to %s as %s", room_jid, nickname);
 			local presences = data:get(username, room_jid, "presence");
-			for _, pres in pairs(presences) do
-				origin.send(st.clone(pres));
+			if presences then
+				-- Joined but no presence? Weird
+				for _, pres in pairs(presences) do
+					origin.send(st.clone(pres));
+				end
 			end
 			-- FIXME should send ones own presence last
 			local subject = data:get(username, room_jid, "subject");