Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
pidan
/
FuSiLive
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
415434b1
authored
Jul 08, 2025
by
ludi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复一个第一次与陌生人拨打私房的时候,会断线的bug
parent
2631fab5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
104 additions
and
5 deletions
FuSiLive.xcodeproj/project.pbxproj
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/InstantMessaging/Other/FUSChatCallHelper.swift
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/ZhaiXin/Main/Other/FUSZhaiXinDBOperate.h
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/ZhaiXin/Main/Other/FUSZhaiXinDBOperate.m
FuSiLive.xcodeproj/project.pbxproj
View file @
415434b1
...
@@ -672,7 +672,7 @@
...
@@ -672,7 +672,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
20250626001
8
;
CURRENT_PROJECT_VERSION
=
20250626001
9
;
DEFINES_MODULE
=
YES
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
@@ -940,7 +940,7 @@
...
@@ -940,7 +940,7 @@
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
=
AccentColor
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_ENTITLEMENTS
=
FuSiLive/FuSiLive.entitlements
;
CODE_SIGN_STYLE
=
Automatic
;
CODE_SIGN_STYLE
=
Automatic
;
CURRENT_PROJECT_VERSION
=
20250626001
8
;
CURRENT_PROJECT_VERSION
=
20250626001
9
;
DEFINES_MODULE
=
YES
;
DEFINES_MODULE
=
YES
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
DEVELOPMENT_TEAM
=
6GG26BHUMC
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
ENABLE_ON_DEMAND_RESOURCES
=
NO
;
...
...
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/InstantMessaging/Other/FUSChatCallHelper.swift
View file @
415434b1
...
@@ -103,11 +103,15 @@ import SJAttributesStringMaker
...
@@ -103,11 +103,15 @@ import SJAttributesStringMaker
socketListener
.
onNext
((
cmd
,
dataDict
))
socketListener
.
onNext
((
cmd
,
dataDict
))
}
}
/// 当前已经准备好的对方信息
private
let
otherFriendInfoIsReady
:
BehaviorRelay
<
FUSChatUserInfoModel
?
>
=
.
init
(
value
:
nil
)
private
var
reuseDisposeBag
=
DisposeBag
()
private
var
reuseDisposeBag
=
DisposeBag
()
private
var
isClickedMakeCall
=
false
private
var
isClickedMakeCall
=
false
private
var
otherFriendInfoDisposeBag
=
DisposeBag
()
//MARK: 开始拨打
//MARK: 开始拨打
@objc
public
func
fus_makeCall
(
type
:
FUSAgoraSessionType
,
from
:
FUSConversationStartType
,
fid
:
String
,
success
:
(()
->
Void
),
failure
:
((
_
msg
:
String
,
_
code
:
Int
)
->
Void
)){
@objc
public
func
fus_makeCall
(
type
:
FUSAgoraSessionType
,
from
:
FUSConversationStartType
,
fid
:
String
,
success
:
@escaping
(()
->
Void
),
failure
:
@escaping
((
_
msg
:
String
,
_
code
:
Int
)
->
Void
)){
// 防止手抖
// 防止手抖
guard
isClickedMakeCall
==
false
else
{
return
}
guard
isClickedMakeCall
==
false
else
{
return
}
...
@@ -117,6 +121,41 @@ import SJAttributesStringMaker
...
@@ -117,6 +121,41 @@ import SJAttributesStringMaker
}
}
let
friendInfo
=
FUSZhaiXinDBOperate
.
fus_selectZhaiXinChatUserInfo
(
withUid
:
fid
)
let
friendInfo
=
FUSZhaiXinDBOperate
.
fus_selectZhaiXinChatUserInfo
(
withUid
:
fid
)
if
friendInfo
!=
nil
{
self
.
otherFriendInfoIsReady
.
accept
(
friendInfo
)
}
else
{
// 还没有用户信息,得重新拉
FUSZhaiXinDBOperate
.
fus_updateZhaiXinChatUserInfo
(
withUid
:
fid
)
{[
weak
self
]
model
in
self
?
.
otherFriendInfoIsReady
.
accept
(
model
)
}
failure
:
{[
weak
self
]
in
self
?
.
otherFriendInfoIsReady
.
accept
(
nil
)
}
}
// 监听获取到对方的信息
FUSLoadingView
.
fus_showProgressView
(
withMessage
:
""
)
self
.
otherFriendInfoDisposeBag
=
.
init
()
self
.
otherFriendInfoIsReady
.
distinctUntilChanged
()
.
timeout
(
.
seconds
(
10
),
scheduler
:
MainScheduler
.
instance
)
.
subscribe
(
onNext
:
{[
weak
self
]
model
in
guard
let
model
=
model
else
{
return
}
if
model
.
uid
==
fid
{
FUSLoadingView
.
fus_dismissProgressView
()
self
?
.
otherFriendInfoDisposeBag
=
.
init
()
self
?
.
fus_handleMakeCall
(
type
:
type
,
from
:
from
,
fid
:
fid
,
friendInfo
:
model
,
success
:
success
,
failure
:
failure
)
}
},
onError
:
{[
weak
self
]
error
in
FUSLoadingView
.
fus_dismissProgressView
()
self
?
.
otherFriendInfoDisposeBag
=
.
init
()
FUSDialogView
.
fus_showDialog
(
.
fus_localString
(
"网络异常,连接失败"
))
})
.
disposed
(
by
:
otherFriendInfoDisposeBag
)
}
func
fus_handleMakeCall
(
type
:
FUSAgoraSessionType
,
from
:
FUSConversationStartType
,
fid
:
String
,
friendInfo
:
FUSChatUserInfoModel
,
success
:(()
->
Void
),
failure
:((
_
msg
:
String
,
_
code
:
Int
)
->
Void
)){
// 拉黑检测逻辑
// 拉黑检测逻辑
if
FUSRouter
.
userRouter
()
.
fus_selectIsInBlackList
(
withUid
:
fid
)
{
if
FUSRouter
.
userRouter
()
.
fus_selectIsInBlackList
(
withUid
:
fid
)
{
if
FUSIMChatService
.
shareInstance
()
.
isChatDetailVcVisible
{
if
FUSIMChatService
.
shareInstance
()
.
isChatDetailVcVisible
{
...
@@ -127,7 +166,7 @@ import SJAttributesStringMaker
...
@@ -127,7 +166,7 @@ import SJAttributesStringMaker
}
}
return
return
}
}
else
if
friendInfo
?
.
friendIsBlack
==
true
{
else
if
friendInfo
.
friendIsBlack
==
true
{
if
FUSIMChatService
.
shareInstance
()
.
isChatDetailVcVisible
{
if
FUSIMChatService
.
shareInstance
()
.
isChatDetailVcVisible
{
FUSIMChatService
.
shareInstance
()
.
fus_createSystemNoticeMessageToDB
(
withSysType
:
.
noticeYouHasBeenBlack
,
noticeWords
:
nil
,
talkID
:
fid
)
FUSIMChatService
.
shareInstance
()
.
fus_createSystemNoticeMessageToDB
(
withSysType
:
.
noticeYouHasBeenBlack
,
noticeWords
:
nil
,
talkID
:
fid
)
...
@@ -155,7 +194,7 @@ import SJAttributesStringMaker
...
@@ -155,7 +194,7 @@ import SJAttributesStringMaker
}
}
// 对方通话功能检测
// 对方通话功能检测
if
let
videoSwitch
=
friendInfo
?
.
chatWith
[
"videoSwitch"
]
as?
Bool
{
if
let
videoSwitch
=
friendInfo
.
chatWith
[
"videoSwitch"
]
as?
Bool
{
if
videoSwitch
==
false
{
if
videoSwitch
==
false
{
FUSAlertView
.
showAlert
(
withTitle
:
.
fus_localString
(
"对方当前关闭了通话功能,可提醒对方在设置中打开此功能"
),
message
:
nil
,
cancelButtonTitle
:
nil
,
otherButtonTitles
:
[
String
.
fus_localString
(
"好的"
)])
FUSAlertView
.
showAlert
(
withTitle
:
.
fus_localString
(
"对方当前关闭了通话功能,可提醒对方在设置中打开此功能"
),
message
:
nil
,
cancelButtonTitle
:
nil
,
otherButtonTitles
:
[
String
.
fus_localString
(
"好的"
)])
return
return
...
@@ -222,6 +261,8 @@ import SJAttributesStringMaker
...
@@ -222,6 +261,8 @@ import SJAttributesStringMaker
self
.
showVoiceCallView
(
isCaller
:
true
)
self
.
showVoiceCallView
(
isCaller
:
true
)
case
.
video
:
case
.
video
:
self
.
showVideoCallView
(
isCaller
:
true
)
self
.
showVideoCallView
(
isCaller
:
true
)
default
:
break
}
}
self
.
state
.
accept
(
.
dialing
)
self
.
state
.
accept
(
.
dialing
)
...
...
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/ZhaiXin/Main/Other/FUSZhaiXinDBOperate.h
View file @
415434b1
...
@@ -72,6 +72,18 @@
...
@@ -72,6 +72,18 @@
*/
*/
+
(
FUSChatUserInfoModel
*
)
fus_selectZhaiXinChatUserInfoWithUid
:(
NSString
*
)
uid
;
+
(
FUSChatUserInfoModel
*
)
fus_selectZhaiXinChatUserInfoWithUid
:(
NSString
*
)
uid
;
/// 查询寨信用户信息
/// @param uid 主键
/// @param success 1
/// @param failure 0
+
(
void
)
fus_selectZhaiXinChatUserInfoWithUid
:(
NSString
*
)
uid
success
:(
void
(
^
)(
FUSChatUserInfoModel
*
model
))
success
failure
:(
void
(
^
)(
void
))
failure
;
/// 更新某个用户,如果没有则创建
/// @param uid 主键
/// @param success 1
/// @param failure 0
+
(
void
)
fus_updateZhaiXinChatUserInfoWithUid
:(
NSString
*
)
uid
success
:(
void
(
^
)(
FUSChatUserInfoModel
*
))
success
failure
:(
void
(
^
)(
void
))
failure
;
/**
/**
* 删除寨信信息
* 删除寨信信息
*
*
...
...
Modules/FUSChatCenterModule/FUSChatCenterModule/Features/ZhaiXin/Main/Other/FUSZhaiXinDBOperate.m
View file @
415434b1
...
@@ -361,6 +361,52 @@
...
@@ -361,6 +361,52 @@
return
[
FUSChatUserInfoModel
fus_modelWithDict
:
zhaiXinUserDict
];
return
[
FUSChatUserInfoModel
fus_modelWithDict
:
zhaiXinUserDict
];
}
}
/// 查询寨信用户信息
/// @param uid 主键
/// @param success 1
/// @param failure 0
+
(
void
)
fus_selectZhaiXinChatUserInfoWithUid
:
(
NSString
*
)
uid
success
:
(
void
(
^
)(
FUSChatUserInfoModel
*
))
success
failure
:
(
void
(
^
)(
void
))
failure
{
// 空值判断
if
([
NSString
isNull
:
uid
])
{
FUSLogInfo
(
@"--->查询寨信用户信息失败, uid为空"
);
failure
();
return
;
}
[
FUSDBHelper
fus_selectDataWithName
:
ALL_CHAT_USER_INFO_LIST_TABLE
whereDict
:@{
@"uid"
:
uid
}
success
:^
(
NSArray
*
resultArray
)
{
NSDictionary
*
zhaiXinUserDict
=
[
resultArray
firstObject
];
success
([
FUSChatUserInfoModel
fus_modelWithDict
:
zhaiXinUserDict
]);
}
failure
:^
{
failure
();
}];
}
/// 更新某个用户,如果没有则创建
/// @param uid 主键
/// @param success 1
/// @param failure 0
+
(
void
)
fus_updateZhaiXinChatUserInfoWithUid
:
(
NSString
*
)
uid
success
:
(
void
(
^
)(
FUSChatUserInfoModel
*
))
success
failure
:
(
void
(
^
)(
void
))
failure
{
// 空值判断
if
([
NSString
isNull
:
uid
])
{
FUSLogInfo
(
@"--->查询寨信用户信息失败, uid为空"
);
failure
();
return
;
}
[
FUSHttpHelper
postRequestBinaryWithUrl
:
FUSChatCenterURLs
.
fus_URL_ROOM_USER_INFO
params
:@{
@"fid"
:
uid
,
@"roomid"
:
uid
}
success
:^
(
NSDictionary
*
_Nullable
dataDict
,
int
code
)
{
FUSChatUserInfoModel
*
userModel
=
[
FUSZhaiXinDBOperate
fus_selectZhaiXinChatUserInfoWithUid
:
uid
];
if
(
userModel
==
nil
)
{
userModel
=
[[
FUSChatUserInfoModel
alloc
]
init
];
}
userModel
.
uid
=
uid
;
userModel
.
nickname
=
dataDict
[
@"user"
][
@"nickname"
];
userModel
.
faceUrl
=
dataDict
[
@"user"
][
@"face"
];
userModel
.
isFollow
=
[
dataDict
[
@"like"
]
boolValue
];
[
FUSZhaiXinDBOperate
fus_writeChatUserInfoIntoTableWithModel
:
userModel
];
success
(
userModel
);
}
failure
:^
(
NSDictionary
*
_Nullable
dataDict
,
int
code
)
{
failure
();
}];
}
/**
/**
查找某聊天最后一条消息
查找某聊天最后一条消息
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment