# I am the Watcher. I am your guide through this vast new twtiverse.
# 
# Usage:
#     https://watcher.sour.is/api/plain/users              View list of users and latest twt date.
#     https://watcher.sour.is/api/plain/twt                View all twts.
#     https://watcher.sour.is/api/plain/mentions?uri=:uri  View all mentions for uri.
#     https://watcher.sour.is/api/plain/conv/:hash         View all twts for a conversation subject.
# 
# Options:
#     uri     Filter to show a specific users twts.
#     offset  Start index for quey.
#     limit   Count of items to return (going back in time).
# 
# twt range = 1 10
# self = https://watcher.sour.is/conv/xwvocwa
I wrote some code to try out non-hash reply subjects formatted as (replyto ), while keeping the ability to use the existing hash style.

I don't think we need to decide all at once. If clients add support for a new method then people can use it if they like. The downside of course is that this costs developer time, so I decided to invest a few hours of my own time into a proof of concept.

With apologies to @movq for corrupting jenny's beautiful code. I don't write this expecting you to incorporate the patch, because it does complicate things and might not be a direction you want to go in. But if you like any part of this approach feel free to use bits of it; I release the patch under jenny's current LICENCE.

Supporting both kinds of reply in jenny was complicated because each email can only have one Message-Id, and because it's possible the target twt will not be seen until after the twt referencing it. The following patch uses an sqlite database to keep track of known (url, timestamp) pairs, as well as a separate table of (url, timestamp) pairs that haven't been seen yet but are wanted. When one of those "wanted" twts is finally seen, the mail file gets rewritten to include the appropriate In-Reply-To header.

Patch based on jenny commit 73a5ea81.

https://www.falsifian.org/a/oDtr/patch0.txt

Not implemented:
- Composing twts using the (replyto ...) format.
- Probably other important things I'm forgetting.
BTW this code doesn't incorporate existing twts into jenny's database. It's best used starting from scratch. I've been testing it using a custom XDG_CACHE_HOME and XDG_CONFIG_HOME to avoid messing with my "real" jenny data.
@falsifian this one hits hard, as jenny was just updated today. :'-(
@falsifian this one hits hard, as jenny was just updated today. :'-(
I forgot to git add a new test file. Added to the patch now at https://www.falsifian.org/a/oDtr/patch0.txt
@david Well, I wouldn't recommend using my code for your main jenny use anyway. If you want to try it out, set XDG_CONFIG_HOME and XDG_CACHE_HOME to some sandbox directories and only run my code there. If @movq is interested in any of this getting upstreamed, I'd be happy to try rebasing the changes, but otherwise it's a proof of concept and fun exercise.
@falsifian Oof, yeah, I haven’t even started thinking about supporting two schemes at the same time. 😅 I’d be hoping for *not* having to use something like an sqlite database, if it can’t be avoided.

By the way: Since we have so few modern twtxt/Yarn clients, forking jenny might not be the worst idea. *If* you wanted to take it into a very different direction, then by all means, go for it. 👍
@falsifian Oof, yeah, I haven’t even started thinking about supporting two schemes at the same time. 😅 I’d be hoping for *not* having to use something like an sqlite database, if it can’t be avoided.

By the way: Since we have so few modern twtxt/Yarn clients, forking jenny might not be the worst idea. *If* you wanted to take it into a very different direction, then by all means, go for it. 👍
@falsifian Oof, yeah, I haven’t even started thinking about supporting two schemes at the same time. 😅 I’d be hoping for *not* having to use something like an sqlite database, if it can’t be avoided.

By the way: Since we have so few modern twtxt/Yarn clients, forking jenny might not be the worst idea. *If* you wanted to take it into a very different direction, then by all means, go for it. 👍
@falsifian Oof, yeah, I haven’t even started thinking about supporting two schemes at the same time. 😅 I’d be hoping for *not* having to use something like an sqlite database, if it can’t be avoided.

By the way: Since we have so few modern twtxt/Yarn clients, forking jenny might not be the worst idea. *If* you wanted to take it into a very different direction, then by all means, go for it. 👍