|
@@ -12,7 +12,8 @@ import {
|
|
|
ActivityIndicator,
|
|
|
AppState,
|
|
|
AppStateStatus,
|
|
|
- TextInput
|
|
|
+ TextInput,
|
|
|
+ Platform
|
|
|
} from 'react-native';
|
|
|
import {
|
|
|
GiftedChat,
|
|
@@ -57,7 +58,7 @@ import {
|
|
|
usePostGetGroupMembersQuery
|
|
|
} from '@api/chat';
|
|
|
import { CustomMessage, GroupMessage, Reaction } from '../types';
|
|
|
-import { API_HOST, WEBSOCKET_URL } from 'src/constants';
|
|
|
+import { API_HOST, APP_VERSION, WEBSOCKET_URL } from 'src/constants';
|
|
|
import ReactionBar from '../Components/ReactionBar';
|
|
|
import OptionsMenu from '../Components/OptionsMenu';
|
|
|
import EmojiSelectorModal from '../Components/EmojiSelectorModal';
|
|
@@ -488,7 +489,7 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
}
|
|
|
|
|
|
const { uri: localUri } = await FileSystem.downloadAsync(uri, fileUri, {
|
|
|
- headers: { Nmtoken: token }
|
|
|
+ headers: { Nmtoken: token, 'App-Version': APP_VERSION, Platform: Platform.OS }
|
|
|
});
|
|
|
|
|
|
await FileViewer.open(localUri, {
|
|
@@ -520,7 +521,9 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const downloadOptions = currentMessage.video ? { headers: { Nmtoken: token } } : undefined;
|
|
|
+ const downloadOptions = currentMessage.video
|
|
|
+ ? { headers: { Nmtoken: token, 'App-Version': APP_VERSION, Platform: Platform.OS } }
|
|
|
+ : undefined;
|
|
|
const { uri } = await FileSystem.downloadAsync(fileUrl, fileUri, downloadOptions);
|
|
|
|
|
|
await MediaLibrary.createAssetAsync(uri);
|
|
@@ -1661,7 +1664,7 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
setSelectedMedia(uri);
|
|
|
|
|
|
const { uri: localUri } = await FileSystem.downloadAsync(uri, fileUri, {
|
|
|
- headers: { Nmtoken: token }
|
|
|
+ headers: { Nmtoken: token, 'App-Version': APP_VERSION, Platform: Platform.OS }
|
|
|
});
|
|
|
};
|
|
|
|
|
@@ -1685,7 +1688,14 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
style={styles.imageContainer}
|
|
|
disabled={currentMessage.isSending}
|
|
|
>
|
|
|
- <Image source={{ uri: currentMessage.image }} style={styles.chatImage} resizeMode="cover" />
|
|
|
+ <Image
|
|
|
+ source={{
|
|
|
+ uri: currentMessage.image,
|
|
|
+ headers: { Nmtoken: token, 'App-Version': APP_VERSION, Platform: Platform.OS }
|
|
|
+ }}
|
|
|
+ style={styles.chatImage}
|
|
|
+ resizeMode="cover"
|
|
|
+ />
|
|
|
{currentMessage.isSending && (
|
|
|
<View
|
|
|
style={{
|
|
@@ -2204,7 +2214,13 @@ const GroupChatScreen = ({ route }: { route: any }) => {
|
|
|
)}
|
|
|
|
|
|
<ImageView
|
|
|
- images={[{ uri: selectedMedia, cache: 'force-cache' }]}
|
|
|
+ images={[
|
|
|
+ {
|
|
|
+ uri: selectedMedia,
|
|
|
+ cache: 'force-cache',
|
|
|
+ headers: { Nmtoken: token, 'App-Version': APP_VERSION, Platform: Platform.OS }
|
|
|
+ }
|
|
|
+ ]}
|
|
|
imageIndex={0}
|
|
|
visible={!!selectedMedia}
|
|
|
onRequestClose={() => setSelectedMedia(null)}
|