transfem-org / Sharkey

🌎 A Sharkish microblogging platform 🚀
https://joinsharkey.org/
74 stars 19 forks source link

import more *Key notes #177

Closed dakkar closed 7 months ago

dakkar commented 7 months ago

recreateChain converts a list of notes into a forest of notes, using notes that are not replies as roots, and replies as child nodes, recursively.

Previously, notes that are replies to notes not included in the export, and their children, were never put in the forest, and therefore wheren't imported.

This can be fine when importing from Twitter, since we can't really link a note to a tweet.

It's less fine when importing from *key, because in those cases we can link to the remote note that the user was replying to.

This commit makes recreateChain optionally return "orphaned" note trees, and uses that feature when importing from *key.

NOTE: I have not tested this with an import, but I have tested the function in isolation.

Checklist

Mar0xy commented 7 months ago

I think this needs a bit of testing first before merging :octocat:

dakkar commented 7 months ago

oh, I agree, but I needed to get this out of my head 😜 I'll have some time to test on Thursday, if nobody beats me to it

dakkar commented 7 months ago

I'll send another pr for this, with more code and based off latest develop