···170170171171export function linkRequiresWarning(uri: string, label: string) {
172172 const labelDomain = labelToDomain(label)
173173- if (!labelDomain) {
173173+ let urip
174174+ try {
175175+ urip = new URL(uri)
176176+ } catch {
174177 return true
175178 }
176176- try {
177177- const urip = new URL(uri)
179179+180180+ if (urip.hostname === 'bsky.app') {
181181+ // if this is a link to internal content,
182182+ // warn if it represents itself as a URL to another app
183183+ if (
184184+ labelDomain &&
185185+ labelDomain !== 'bsky.app' &&
186186+ isPossiblyAUrl(labelDomain)
187187+ ) {
188188+ return true
189189+ }
190190+ return false
191191+ } else {
192192+ // if this is a link to external content,
193193+ // warn if the label doesnt match the target
194194+ if (!labelDomain) {
195195+ return true
196196+ }
178197 return labelDomain !== urip.hostname
179179- } catch {
180180- return true
181198 }
182199}
183200