# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1557033363 -7200
# Node ID b56654f89cd57543d447ffa28efb77a9cb15d8bc
# Parent  4715c5d1eb695096e416dbf3e072c240fceec46d
mod_muc_mam: Propagate item-not-found to client (fixes #1325)

diff -r 4715c5d1eb69 -r b56654f89cd5 plugins/mod_muc_mam.lua
--- a/plugins/mod_muc_mam.lua	Sun May 05 07:16:05 2019 +0200
+++ b/plugins/mod_muc_mam.lua	Sun May 05 07:16:03 2019 +0200
@@ -189,7 +189,11 @@
 	});
 
 	if not data then
-		origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
+		if err == "item-not-found" then
+			origin.send(st.error_reply(stanza, "modify", "item-not-found"));
+		else
+			origin.send(st.error_reply(stanza, "cancel", "internal-server-error"));
+		end
 		return true;
 	end
 	local total = tonumber(err);