about summary refs log tree commit diff
path: root/users/tazjin/tgsa/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-05-14 r/4076 refactor(tazjin/tgsa): move error handling one layer upVincent Ambo1-19/+20
this lays the groundwork for adding another handler and returning handler results as `anyhow::Result<rouille::Response>`. needed for the image redirect stuff. Change-Id: I909bd9c2f46f42ea759d50662d7bc36c1f408ed3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5609 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-05-14 r/4075 refactor(tazjin/tgsa): factor out cache access helperVincent Ambo1-13/+21
factor out a function to access telegram posts from the cache, fetching them anew if required. a small behavioural change means that the program now takes a write lock when fetching a post, to avoid simultaneously fetching the same post many times (quite likely once it serves image redirects). Change-Id: If9c1429f86fb118dab90834f349cb222709c3a31 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5608 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-05-14 r/4074 feat(tazjin/tgsa): Expire cached telegram entries after one hourVincent Ambo1-5/+22
Telegram expires certain links in messages after some (unknown) amount of time; this commit is the first step to working around that by providing an image URL proxy. In order to do that, we tick two important boxes here: 1. Store an extensible data structure in the cache. 2. Expire them periodically. Change-Id: Iba192d8b71db4493c942d1baf5680bd086f8f60b Reviewed-on: https://cl.tvl.fyi/c/depot/+/5607 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-20 r/3977 fix(tazjin/tgsa): Preserve newlines in messagesVincent Ambo1-4/+24
Change-Id: I9e2d7038357a5510898d153740ae0c0e1f7a8a3a Reviewed-on: https://cl.tvl.fyi/c/depot/+/5483 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-20 r/3976 style(tazjin/tgsa): Move attribution outside of quote bodyVincent Ambo1-3/+3
When quoting a post containing a tgsa quote, the entire quote was previously erased. Doing it this way will leave the Telegram link in it. Change-Id: I53bfadd0615734f7e219b20509858d9b73c908a4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5482 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-19 r/3975 chore(tgsa): Remove shortening of image linksVincent Ambo1-25/+7
The link shortening was in place because posts with image URLs that were too long would not get recognised as valid image links. astral has fixed this after my report: https://forums.somethingawful.com/showthread.php?threadid=3999866 I verified this with the example post that has a bunch of images and such in it. Thanks astral! Change-Id: I60e90fd52020ee5464c931a4dde91382c8a149ab Reviewed-on: https://cl.tvl.fyi/c/depot/+/5481 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-17 r/3974 feat(tazjin/tgsa): Handle messages with audio attachedVincent Ambo1-0/+15
Audio can not be embedded on these stupid dead comedy forums, but people can click through to listen. Change-Id: I6e28636e69e424bb8cbc6b92963d1b28b3c04bf6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5478 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-17 r/3973 chore(tazjin/tgsa): Update quote footer textVincent Ambo1-1/+6
Change-Id: I39ea4a40d9265d06193e3bddede157b10066da06 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5477 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-16 r/3967 feat(tazjin/tgsa): cache generated bbcode in-memory per messageVincent Ambo1-8/+27
Change-Id: Id36266ef20585bfbdffb197ab08aba2978cb86cb Reviewed-on: https://cl.tvl.fyi/c/depot/+/5471 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-04-16 r/3965 feat(tazjin/tgsa): add "web interface" for thisVincent Ambo1-9/+65
Change-Id: I1619f0ceec2f83f4728d7de006a08b2ce6148e59 Reviewed-on: https://cl.tvl.fyi/c/depot/+/5468 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-04-16 r/3964 feat(tazjin/tgsa): Support linked video thumbnailsVincent Ambo1-29/+44
I couldn't figure out how to get the ID for the `single=1` mode for linking to a video directly, but linking to the post in embed mode should also work. Change-Id: Iebbd62724c36cee227a7c24968617ab418e8bd0c Reviewed-on: https://cl.tvl.fyi/c/depot/+/5467 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-04-16 r/3963 feat(tazjin/tgsa): Implement initial tg embed -> BBcode featuresVincent Ambo1-0/+140
Supports only posts with plain photos, and loses all message formatting, but it's getting there. Change-Id: I9e4afcf3072d1e0724521ccbdc1338fe4f8d5ebe Reviewed-on: https://cl.tvl.fyi/c/depot/+/5466 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>