Gate group chat invites on allowGroupInvites (#10546)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-05-19 21:47:54 +03:00
committed by GitHub
parent 12ab1dd2fd
commit 09253457f9
4 changed files with 31 additions and 11 deletions
+14
View File
@@ -24,6 +24,20 @@ export function canBeMessaged(profile: bsky.profile.AnyProfileView) {
}
}
export function canBeAddedToGroup(profile: bsky.profile.AnyProfileView) {
switch (profile.associated?.chat?.allowGroupInvites) {
case 'none':
return false
case 'all':
return true
case 'following':
case undefined:
return Boolean(profile.viewer?.followedBy)
default:
return false
}
}
export function localDateString(date: Date) {
// can't use toISOString because it should be in local time
const mm = date.getMonth()