Fix old Gitter links
It's annoying to read through code and then come across a Gitter link that does not work. While I can probably sometimes guess the message contents + search for it, this doesn't seem very fun or a good use of time. And generally I'm looking at the message for information I don't already know!!
I think we should set up some sort of archive of the Gitter channel for permanent links + update code links. Unfortunately, Matrix will probably never provide this service -- when they have in the past they faced immense community pushback -- so I think we'll need to step up and do it ourselves. See https://github.com/matrix-org/matrix-viewer/issues/288#issuecomment-3156830483 (and https://github.com/matrix-org/matrix-viewer more widely) for an existing solution, though I'm not sure it's easy to set up.
(Generally it's concerning that Gitter now requires login to view and if I were choosing a messaging platform nowadays I'd probably have gone with Zulip... But it's not worth the switching cost, I think?)
OK this is incredibly annoying for other reasons too. I was looking at an old PR and I have the feeling I'm missing half of the context.
I should investigate if there's some good mapping of old gitter message IDs to matrix message IDs.
https://gitlab.com/gitterHQ/gitter.im/-/issues/9 !!! it's not closed?!
But also this is promising:
Since a Gitter message ID is just a Mongo ObjectId, it has the timestamp built-in. We could have something extract the timestamp out and use some deep link into Element to jump to date which would probably get you very close.
Switching to Zulip or something else should be tracked by https://github.com/python-trio/trio/issues/167, I'll keep this issue only for a) decoding Gitter message IDs to a timestamp, b) setting up some sort of redirect on my website as a best-effort hack, c) updating all links in Trio's code to be links into Matrix-Gitter.
Given a Gitter message ID as message_id (e.g. 63bb8d0740557a3d5c688d67), int.from_bytes(bytes.fromhex(message_id[:8])) will turn it into a Unix timestamp. For (b) I'll download a history for a way to translate it to Matrix message IDs, but for now datetime.datetime.fromtimestamp(result) will tell you what day/time that is. As a sanity check, 63bb8d0740557a3d5c688d67 becomes https://matrix.to/#/!OqDVTrmPstKzivLwZW:gitter.im/$tjX4KEcJT3tgPNvf1wTbRKNqqwqurW5uXeyG6Q7tnq0?via=gitter.im&via=matrix.org&via=ancap.tech however the timestamp is ~4 seconds early. I guess that's because Gitter -> Matrix migration was happening then?