diff --git a/__tests__/lib/strings/url-helpers.test.ts b/__tests__/lib/strings/url-helpers.test.ts index 0b1b75028..9fab02412 100644 --- a/__tests__/lib/strings/url-helpers.test.ts +++ b/__tests__/lib/strings/url-helpers.test.ts @@ -159,11 +159,17 @@ describe('isTrustedUrl', () => { ['https://www.bsky.app', true], ['https://www.bsky.app/', true], ['https://docs.bsky.app', true], + ['https://witchsky.app', true], + ['https://witchsky.app/', true], + ['https://witchsky.app/profile/bob.test', true], + ['https://www.witchsky.app', true], + ['https://docs.witchsky.app', true], ['https://bsky.social', true], ['https://bsky.social/blog', true], ['https://blueskyweb.xyz', true], ['https://blueskyweb.zendesk.com', true], ['http://bsky.app', true], + ['http://bsky.app/', true], ['http://bsky.social', true], ['http://blueskyweb.xyz', true], ['http://blueskyweb.zendesk.com', true], diff --git a/app.config.js b/app.config.js index 4d495a673..c8172e6af 100644 --- a/app.config.js +++ b/app.config.js @@ -19,6 +19,7 @@ module.exports = function (_config) { const ASSOCIATED_DOMAINS = [ 'applinks:witchsky.app', + 'applinks:bsky.app', // When testing local services, enter an ngrok (et al) domain here. It must use a standard HTTP/HTTPS port. ...(IS_DEV || IS_TESTFLIGHT ? [] : []), ] diff --git a/src/Navigation.tsx b/src/Navigation.tsx index a15af4908..1eba8af32 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -843,8 +843,8 @@ const FlatNavigator = ({ const LINKING = { // TODO figure out what we are going to use - // note: `bluesky://` is what is used in app.config.js - prefixes: ['bsky://', 'bluesky://', 'https://bsky.app'], + // note: `bluesky://` and `witchsky://` is what is used in app.config.js + prefixes: ['bsky://', 'bluesky://', 'witchsky://', 'https://bsky.app', 'https://witchsky.app'], getPathFromState(state: State) { // find the current node in the navigation tree @@ -1144,7 +1144,7 @@ function logModuleInitTime() { if (IS_WEB) { const referrerInfo = Referrer.getReferrerInfo() - if (referrerInfo && referrerInfo.hostname !== 'bsky.app') { + if (referrerInfo && referrerInfo.hostname !== 'bsky.app' && referrerInfo.hostname !== 'witchsky.app') { logEvent('deepLink:referrerReceived', { to: window.location.href, referrer: referrerInfo?.referrer, diff --git a/src/lib/strings/url-helpers.ts b/src/lib/strings/url-helpers.ts index f1691868e..0aaf38ead 100644 --- a/src/lib/strings/url-helpers.ts +++ b/src/lib/strings/url-helpers.ts @@ -10,7 +10,7 @@ import {logger} from '#/logger' export const BSKY_APP_HOST = 'https://witchsky.app' const BSKY_TRUSTED_HOSTS = [ 'witchsky\\.app', - 'witchsky\\.app', + 'witchsky\\.social', 'bsky\\.app', 'bsky\\.social', 'blueskyweb\\.xyz', @@ -105,11 +105,11 @@ export function toBskyAppUrl(url: string): string { export function isBskyAppUrl(url: string): boolean { return ( + (url.startsWith('https://witchsky.app/') && + !url.startsWith('https://witchsky.app/about')) || url.startsWith('https://bsky.app/') || (url.startsWith('https://deer.social/') && - !url.startsWith('https://deer.social/about')) || - (url.startsWith('https://witchsky.app/') && - !url.startsWith('https://witchsky.app/about')) + !url.startsWith('https://deer.social/about')) ) } @@ -119,7 +119,7 @@ export function isRelativeUrl(url: string): boolean { export function isBskyRSSUrl(url: string): boolean { return ( - (url.startsWith('https://bsky.app/') || isRelativeUrl(url)) && + (isBskyAppUrl(url) || isRelativeUrl(url)) && /\/rss\/?$/.test(url) ) }