feat: sync host-based public app links

This commit is contained in:
A 2026-07-22 21:43:56 +08:00
parent 10de462191
commit 8cfb6f74c1
19 changed files with 375 additions and 26 deletions

View file

@ -649,3 +649,19 @@ func (h *stickersBotHookRecorder) PushStickerSetsChanged(_ context.Context, user
h.userID = userID
h.kind = kind
}
func TestNormalizeStickersBotShortNameAcceptsHostBasedAppLinks(t *testing.T) {
for _, tc := range []struct {
raw string
want string
}{
{raw: "telesrv://addstickers?set=Legacy_Pack", want: "legacy_pack"},
{raw: "owpg://tenant.example.test/addstickers?set=Hosted_Pack", want: "hosted_pack"},
{raw: "owpg://tenant.example.test/addemoji?set=Emoji_Pack", want: "emoji_pack"},
{raw: "https://telesrv.net/addstickers/Web_Pack", want: "web_pack"},
} {
if got := normalizeStickersBotShortName(tc.raw); got != tc.want {
t.Fatalf("normalizeStickersBotShortName(%q) = %q, want %q", tc.raw, got, tc.want)
}
}
}