Changeset

2244:e0663dcd934d

mod_storage_ejabberd_readonly: Fix the key for the private store, it’s node:namespace but just namespace in Ejabberd
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 24 Jul 2016 17:14:13 +0100
parents 2243:f388747c53c7
children 2245:a0727d23ee65
files mod_storage_ejabberdsql_readonly/mod_storage_ejabberdsql_readonly.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mod_storage_ejabberdsql_readonly/mod_storage_ejabberdsql_readonly.lua	Tue Jul 19 00:01:58 2016 +0200
+++ b/mod_storage_ejabberdsql_readonly/mod_storage_ejabberdsql_readonly.lua	Sun Jul 24 17:14:13 2016 +0100
@@ -100,7 +100,9 @@
 			local namespace = row[1];
 			local data, err = xml_parse(row[2]);
 			if data then
-				private[namespace] = stanza_preserialize(data);
+				assert(namespace == data.attr.xmlns, "Wrong namespace in private data!");
+				local key = data.name..":"..data.attr.xmlns;
+				private[key] = stanza_preserialize(data);
 			end
 		end
 		return private;