Fix stored messages always getting deleted if config path has underscores

This commit is contained in:
bus 2025-11-02 08:12:33 +00:00
parent 8e3ffb0d2a
commit e1905b85d7
No known key found for this signature in database
GPG key ID: D8C5E4DF76D4DD78

View file

@ -1090,9 +1090,10 @@ class LXMRouter:
for transient_id in self.propagation_entries.copy(): for transient_id in self.propagation_entries.copy():
entry = self.propagation_entries[transient_id] entry = self.propagation_entries[transient_id]
filepath = entry[1] filepath = entry[1]
components = filepath.split("_") filename = os.path.split(filepath)[-1]
components = filename.split("_")
if len(components) == 2 and float(components[1]) > 0 and len(os.path.split(components[0])[1]) == (RNS.Identity.HASHLENGTH//8)*2: if len(components) == 2 and float(components[1]) > 0 and len(components[0]) == (RNS.Identity.HASHLENGTH//8)*2:
timestamp = float(components[1]) timestamp = float(components[1])
if now > timestamp+LXMRouter.MESSAGE_EXPIRY: if now > timestamp+LXMRouter.MESSAGE_EXPIRY:
RNS.log("Purging message "+RNS.prettyhexrep(transient_id)+" due to expiry", RNS.LOG_EXTREME) RNS.log("Purging message "+RNS.prettyhexrep(transient_id)+" due to expiry", RNS.LOG_EXTREME)