Software /
code /
prosody
Comparison
plugins/mod_storage_internal.lua @ 11765:1cac469b18d0
mod_storage_internal: Stop storing XEP-0091 timestamp
Should no longer be used by anything since the conversion of mod_offline
to the archive API in 0.10.0, which was 4 years ago. The line clearing
the property is left for a bit longer in case someone has very old
offline messages or archived data.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 04 Sep 2021 14:39:31 +0200 |
parent | 11278:c3907f05bed4 |
child | 12977:74b9e05af71e |
comparison
equal
deleted
inserted
replaced
11764:e2650d59db2d | 11765:1cac469b18d0 |
---|---|
64 end | 64 end |
65 value = st.preserialize(st.clone(value)); | 65 value = st.preserialize(st.clone(value)); |
66 value.when = when; | 66 value.when = when; |
67 value.with = with; | 67 value.with = with; |
68 value.attr.stamp = datetime.datetime(when); | 68 value.attr.stamp = datetime.datetime(when); |
69 value.attr.stamp_legacy = datetime.legacy(when); | |
70 | 69 |
71 local cache_key = jid_join(username, host, self.store); | 70 local cache_key = jid_join(username, host, self.store); |
72 local item_count = archive_item_count_cache:get(cache_key); | 71 local item_count = archive_item_count_cache:get(cache_key); |
73 | 72 |
74 if key then | 73 if key then |
217 local key = item.key or tostring(i); | 216 local key = item.key or tostring(i); |
218 local when = item.when or datetime.parse(item.attr.stamp); | 217 local when = item.when or datetime.parse(item.attr.stamp); |
219 local with = item.with; | 218 local with = item.with; |
220 item.key, item.when, item.with = nil, nil, nil; | 219 item.key, item.when, item.with = nil, nil, nil; |
221 item.attr.stamp = nil; | 220 item.attr.stamp = nil; |
221 -- COMPAT Stored data may still contain legacy XEP-0091 timestamp | |
222 item.attr.stamp_legacy = nil; | 222 item.attr.stamp_legacy = nil; |
223 item = st.deserialize(item); | 223 item = st.deserialize(item); |
224 return key, item, when, with; | 224 return key, item, when, with; |
225 end, count; | 225 end, count; |
226 end | 226 end |
254 local when = new_when or old_item.when or datetime.parse(old_item.attr.stamp); | 254 local when = new_when or old_item.when or datetime.parse(old_item.attr.stamp); |
255 item.key = key; | 255 item.key = key; |
256 item.when = when; | 256 item.when = when; |
257 item.with = new_with or old_item.with; | 257 item.with = new_with or old_item.with; |
258 item.attr.stamp = datetime.datetime(when); | 258 item.attr.stamp = datetime.datetime(when); |
259 item.attr.stamp_legacy = datetime.legacy(when); | |
260 items[i] = item; | 259 items[i] = item; |
261 return datamanager.list_store(username, host, self.store, items); | 260 return datamanager.list_store(username, host, self.store, items); |
262 end | 261 end |
263 end | 262 end |
264 | 263 |