diff --git a/app/soapbox/features/chats/components/chat-composer.tsx b/app/soapbox/features/chats/components/chat-composer.tsx index 3e32267b39..3eed74fb6f 100644 --- a/app/soapbox/features/chats/components/chat-composer.tsx +++ b/app/soapbox/features/chats/components/chat-composer.tsx @@ -7,7 +7,7 @@ import { Button, Combobox, ComboboxInput, ComboboxList, ComboboxOption, Combobox import { useChatContext } from 'soapbox/contexts/chat-context'; import UploadButton from 'soapbox/features/compose/components/upload-button'; import { search as emojiSearch } from 'soapbox/features/emoji/emoji-mart-search-light'; -import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; +import { useAppDispatch, useAppSelector, useFeatures } from 'soapbox/hooks'; import { textAtCursorMatchesToken } from 'soapbox/utils/suggestions'; const messages = defineMessages({ @@ -55,8 +55,9 @@ const ChatComposer = React.forwardRef onPaste, hasAttachment, }, ref) => { - const dispatch = useAppDispatch(); const intl = useIntl(); + const dispatch = useAppDispatch(); + const features = useFeatures(); const { chat } = useChatContext(); @@ -151,14 +152,16 @@ const ChatComposer = React.forwardRef return (
- - - + {features.chatsMedia && ( + + + + )} { */ chatsExpiration: v.software === TRUTHSOCIAL, + /** + * Whether chat messages can accept a `media_id` attachment. + * @see POST /api/v1/pleroma/chats/:id/messages + */ + chatsMedia: v.software !== TRUTHSOCIAL, + /** * Ability to search among chats. * @see GET /api/v1/pleroma/chats