sigtop
sigtop copied to clipboard
Handle Filename Collisions for Recipients with Identical Names
what's the issue?
when you're exporting messages, attachments, or avatars from the signal desktop app, if two people have the same name, things can go wrong. you either get failed exports or it creates a bunch of unnecessary files.
the fix
so, i added a usedFilenames
map to keep track of filenames during a single run. this way, it makes sure each filename is unique by adding a number to the end if needed (like "John Doe (2).txt").
what changed
-
message export (
cmdExportMessages
)- now uses a map to track filenames.
- ensures each filename is unique within the same run.
-
attachment export (
cmdExportAttachments
)- also uses the map for filenames.
- handles unique filenames for the whole export session.
-
avatar export (
cmdExportAvatars
)- added the filename tracking here too.
- guarantees unique filenames during the export.
why's this good?
- no more export fails because of duplicate filenames.
- won’t create unnecessary files when running multiple exports.
example
before:
sigtop: open John Doe.txt: file exists
after:
- first "John Doe":
John Doe.txt
- second "John Doe":
John Doe (2).txt
let me know if you need any tweaks or changes. thanks!