diff mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 5729:79ba1a1a75cc

mod_storage_xmlarchive: Fix "user" iteration API Fixes use in prosody-migrator. Otherwise this particular API is not used much, or this would have been noticed before. Usually it is a different store like 'accounts' that is responsible for providing the authoritative list of users. Thanks Ge0rG for testing
author Kim Alvefur <zash@zash.se>
date Thu, 23 Nov 2023 16:16:34 +0100
parents 98bf0f597df4
children 100110d539d3
line wrap: on
line diff
--- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Wed Nov 22 12:56:50 2023 +0100
+++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua	Thu Nov 23 16:16:34 2023 +0100
@@ -13,6 +13,7 @@
 local new_stream = require "util.xmppstream".new;
 local xml = require "util.xml";
 local async = require "util.async";
+local it = require "util.iterators";
 local empty = {};
 
 if not dm.append_raw then
@@ -438,8 +439,13 @@
 	return dates;
 end
 
+-- filter out the 'user@yyyy-mm-dd' stores
+local function skip_at_date(item)
+	return not item:find("@");
+end
+
 function archive:users()
-	return dm.users(module.host, self.store, "list");
+	return it.filter(skip_at_date, dm.users(module.host, self.store, "list"));
 end
 
 local provider = {};