feat(CallFeature): implement call functionality and integrate WebSocket signaling
- Updated app.json to include microphone permissions and background audio support. - Added call-related dependencies in package.json and package-lock.json. - Enhanced ChatScreen to initiate calls and handle call actions. - Introduced call components in the layout for incoming call handling. - Expanded WebSocket service to manage call signaling messages and events. - Refactored authStore to initialize call state on user authentication.
This commit is contained in:
@@ -35,7 +35,7 @@ import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
|
||||
import { Text, ImageGallery, ImageGridItem } from '../../components/common';
|
||||
import { useAppColors } from '../../theme';
|
||||
import * as hrefs from '../../navigation/hrefs';
|
||||
import { messageManager } from '../../stores';
|
||||
import { messageManager, callStore } from '../../stores';
|
||||
import { useBreakpointGTE } from '../../hooks/useResponsive';
|
||||
import {
|
||||
useChatScreen,
|
||||
@@ -423,6 +423,15 @@ export const ChatScreen: React.FC = () => {
|
||||
onMorePress={navigateToChatSettings}
|
||||
onGroupInfoPress={handleGroupInfoPress}
|
||||
isWideScreen={isWideScreen}
|
||||
onCallPress={!isGroupChat ? () => {
|
||||
const otherUserId = otherUser?.id;
|
||||
if (otherUserId && conversationId) {
|
||||
callStore.getState().startCall(conversationId, otherUserId, {
|
||||
nickname: otherUser?.nickname,
|
||||
avatar: otherUser?.avatar,
|
||||
});
|
||||
}
|
||||
} : undefined}
|
||||
/>
|
||||
|
||||
{/* 消息列表 */}
|
||||
|
||||
Reference in New Issue
Block a user