Skip to content

Commit

Permalink
Patch moderateProfile to accept known profile views, to discuss
Browse files Browse the repository at this point in the history
  • Loading branch information
estrattonbailey committed Jan 7, 2025
1 parent b9a21f2 commit d7a550f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions patches/@atproto+api+0.14.0-next.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/node_modules/@atproto/api/dist/moderation/types.d.ts b/node_modules/@atproto/api/dist/moderation/types.d.ts
index 4b1ebdd..33f6fb5 100644
--- a/node_modules/@atproto/api/dist/moderation/types.d.ts
+++ b/node_modules/@atproto/api/dist/moderation/types.d.ts
@@ -1,4 +1,4 @@
-import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyNotificationListNotifications, AppBskyGraphDefs, ComAtprotoLabelDefs } from '../client/index';
+import { AppBskyActorDefs, AppBskyFeedDefs, AppBskyNotificationListNotifications, AppBskyGraphDefs, ComAtprotoLabelDefs, ChatBskyActorDefs } from '../client/index';
import { KnownLabelValue } from './const/labels';
export declare const CUSTOM_LABEL_VALUE_RE: RegExp;
export interface ModerationBehavior {
@@ -32,7 +32,7 @@ export interface InterpretedLabelValueDefinition extends ComAtprotoLabelDefs.Lab
};
}
export type LabelDefinitionMap = Record<KnownLabelValue, InterpretedLabelValueDefinition>;
-export type ModerationSubjectProfile = AppBskyActorDefs.ProfileViewBasic | AppBskyActorDefs.ProfileView | AppBskyActorDefs.ProfileViewDetailed;
+export type ModerationSubjectProfile = AppBskyActorDefs.ProfileViewBasic | AppBskyActorDefs.ProfileView | AppBskyActorDefs.ProfileViewDetailed | ChatBskyActorDefs.ProfileViewBasic;
export type ModerationSubjectPost = AppBskyFeedDefs.PostView;
export type ModerationSubjectNotification = AppBskyNotificationListNotifications.Notification;
export type ModerationSubjectFeedGenerator = AppBskyFeedDefs.GeneratorView;
diff --git a/node_modules/@atproto/api/src/moderation/types.ts b/node_modules/@atproto/api/src/moderation/types.ts
index bbf8d84..16293e2 100644
--- a/node_modules/@atproto/api/src/moderation/types.ts
+++ b/node_modules/@atproto/api/src/moderation/types.ts
@@ -4,6 +4,7 @@ import {
AppBskyNotificationListNotifications,
AppBskyGraphDefs,
ComAtprotoLabelDefs,
+ ChatBskyActorDefs,
} from '../client/index'
import { KnownLabelValue } from './const/labels'

@@ -87,6 +88,7 @@ export type ModerationSubjectProfile =
| AppBskyActorDefs.ProfileViewBasic
| AppBskyActorDefs.ProfileView
| AppBskyActorDefs.ProfileViewDetailed
+ | ChatBskyActorDefs.ProfileViewBasic

export type ModerationSubjectPost = AppBskyFeedDefs.PostView

4 changes: 2 additions & 2 deletions src/screens/Messages/components/ChatListItem.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, {useCallback, useMemo, useState} from 'react'
import {GestureResponderEvent, View} from 'react-native'
import {
AppBskyActorDefs,
AppBskyEmbedRecord,
ChatBskyConvoDefs,
moderateProfile,
Expand Down Expand Up @@ -39,6 +38,7 @@ import {Link} from '#/components/Link'
import {useMenuControl} from '#/components/Menu'
import {PostAlerts} from '#/components/moderation/PostAlerts'
import {Text} from '#/components/Typography'
import * as atp from '#/types/atproto'

export let ChatListItem = ({
convo,
Expand Down Expand Up @@ -73,7 +73,7 @@ function ChatListItemReady({
moderationOpts,
}: {
convo: ChatBskyConvoDefs.ConvoView
profile: AppBskyActorDefs.ProfileViewBasic
profile: atp.profile.AnyProfileView
moderationOpts: ModerationOpts
}) {
const t = useTheme()
Expand Down

0 comments on commit d7a550f

Please sign in to comment.