Changeset

1146:9fa89dc7a86f

mod_mam_muc: Search the rooms archive correctly (copypaste error from mod_mam)
author Kim Alvefur <zash@zash.se>
date Sat, 10 Aug 2013 21:37:35 +0200
parents 1145:5a00f9bec6e7
children 1147:27b41ee61601
files mod_mam_muc/mod_mam_muc.lua
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_mam_muc/mod_mam_muc.lua	Sat Aug 10 21:32:21 2013 +0200
+++ b/mod_mam_muc/mod_mam_muc.lua	Sat Aug 10 21:37:35 2013 +0200
@@ -61,6 +61,7 @@
 module:hook("iq-get/bare/"..xmlns_mam..":query", function(event)
 	local origin, stanza = event.origin, event.stanza;
 	local room = stanza.attr.to;
+	local room_node = jid_split(room);
 	local query = stanza.tags[1];
 
 	local room_obj = rooms[room];
@@ -101,7 +102,7 @@
 	if type(before) ~= "string" then before = nil; end
 
 	-- Load all the data!
-	local data, err = archive:find(origin.username, {
+	local data, err = archive:find(room_node, {
 		start = qstart; ["end"] = qend; -- Time range
 		limit = qmax;
 		before = before; after = after;