Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 1 | //! Shared invite links: before registration opened, one link staff handed |
| 2 | //! to a group (a conference's judges, a post, a community), made in sudo. | |
| Merge shared invite links: label, uses, expiry, domains; joined through recorded (identity 0038) | 3 | //! |
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 4 | //! None are made or used any more: anyone may register, and a shared |
| 5 | //! link's code is now an unknown code that sign-up ignores. The tables | |
| 6 | //! (`shared_invites`, `shared_invite_uses`) keep what they recorded, so | |
| 7 | //! sudo still shows "Joined through <label>" for an account made with one. | |
| Merge shared invite links: label, uses, expiry, domains; joined through recorded (identity 0038) | 8 | |
| Merge main into rm-agents: mirroring removal, open signups, free-tier limits, the g1t CLI and runner fixes, with the agent removal kept. The CLI's table of operations is regenerated from the API without the agent, customize and AI credit operations; no CLI command used them. | 9 | use g1t_contracts::identity::SharedInviteSource; |
| Merge shared invite links: label, uses, expiry, domains; joined through recorded (identity 0038) | 10 | use serde::Deserialize; |
| 11 | use worker::Result; | |
| 12 | ||
| 13 | use crate::Identity; | |
| 14 | ||
| 15 | impl Identity { | |
| 16 | /// The shared link an account was made with, if it was. | |
| 17 | pub(crate) async fn shared_source(&self, user_id: &str) -> Result<Option<SharedInviteSource>> { | |
| 18 | #[derive(Deserialize)] | |
| 19 | struct Row { | |
| 20 | id: String, | |
| 21 | label: String, | |
| 22 | } | |
| 23 | Ok(self | |
| 24 | .db | |
| 25 | .prepare( | |
| 26 | "SELECT s.id, s.label FROM shared_invite_uses u JOIN shared_invites s ON s.id = u.shared_invite_id | |
| 27 | WHERE u.user_id = ?", | |
| 28 | ) | |
| 29 | .bind(&[user_id.into()])? | |
| 30 | .first::<Row>(None) | |
| 31 | .await? | |
| 32 | .map(|row| SharedInviteSource { id: row.id, label: row.label })) | |
| 33 | } | |
| 34 | } |
This file's history is long; its oldest lines are credited to the oldest commit read.