Changeset

6098:1d7e5d091980

plugins/muc/muc.lib: Add some missing return values
author daurnimator <quae@daurnimator.com>
date Fri, 21 Feb 2014 17:40:16 -0500
parents 6097:538cdc3d8225
children 6099:c8a749298d51
files plugins/muc/muc.lib.lua
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/muc/muc.lib.lua	Fri Feb 21 17:17:01 2014 -0500
+++ b/plugins/muc/muc.lib.lua	Fri Feb 21 17:40:16 2014 -0500
@@ -994,8 +994,10 @@
 	local occupant = self._occupants[current_nick];
 	if not occupant then -- not in room
 		origin.send(st.error_reply(stanza, "cancel", "not-acceptable"));
+		return true;
 	elseif occupant.role == "visitor" then
 		origin.send(st.error_reply(stanza, "auth", "forbidden"));
+		return true;
 	else
 		local from = stanza.attr.from;
 		stanza.attr.from = current_nick;
@@ -1012,6 +1014,7 @@
 			self:broadcast_message(stanza, self:get_historylength() > 0 and stanza:get_child("body"));
 		end
 		stanza.attr.from = from;
+		return true;
 	end
 end
 
@@ -1019,6 +1022,7 @@
 	local current_nick = self._jid_nick[stanza.attr.from];
 	log("debug", "%s kicked from %s for sending an error message", current_nick, self.jid);
 	self:handle_to_occupant(origin, build_unavailable_presence_from_error(stanza)); -- send unavailable
+	return true;
 end
 
 -- hack - some buggy clients send presence updates to the room rather than their nick
@@ -1030,8 +1034,10 @@
 		stanza.attr.to = current_nick;
 		self:handle_to_occupant(origin, stanza);
 		stanza.attr.to = to;
+		return true;
 	elseif type ~= "error" and type ~= "result" then
 		origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
+		return true;
 	end
 end
 
@@ -1060,8 +1066,10 @@
 			self:set_affiliation(_from, _invitee, "member", nil, "Invited by " .. self._jid_nick[_from])
 		end
 		self:_route_stanza(invite);
+		return true;
 	else
 		origin.send(st.error_reply(stanza, "cancel", "jid-malformed"));
+		return true;
 	end
 end
 
@@ -1079,10 +1087,12 @@
 			return self:handle_invite_to_room(origin, stanza, payload)
 		else
 			origin.send(st.error_reply(stanza, "cancel", "bad-request"));
+			return true;
 		end
 	else
 		if type == "error" or type == "result" then return; end
 		origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
+		return true;
 	end
 end