Commit a0f386bf by pidan

Merge branch 'feature/私享房需求' of http://git.yabolive.net:88/pidan/FuSiLive into feature/私享房需求

* 'feature/私享房需求' of http://git.yabolive.net:88/pidan/FuSiLive:
  修复一些bug
  修复一个第一次与陌生人拨打私房的时候,会断线的bug
parents c4cb46f2 cdcac92b
...@@ -77,12 +77,12 @@ static const NSString *FUSCidUDKey = @"FUSCidUDKey"; ...@@ -77,12 +77,12 @@ static const NSString *FUSCidUDKey = @"FUSCidUDKey";
/// App Version /// App Version
- (NSString *)appVersion { - (NSString *)appVersion {
return @"7730"; return @"7720";
} }
/// App Dot Version /// App Dot Version
- (NSString *)appDotVersion { - (NSString *)appDotVersion {
return @"7.7.3.0"; return @"7.7.2.0";
} }
/// App Id /// App Id
......
...@@ -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 = 202506260018; CURRENT_PROJECT_VERSION = 202506260022;
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 = 202506260018; CURRENT_PROJECT_VERSION = 202506260022;
DEFINES_MODULE = YES; DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 6GG26BHUMC; DEVELOPMENT_TEAM = 6GG26BHUMC;
ENABLE_ON_DEMAND_RESOURCES = NO; ENABLE_ON_DEMAND_RESOURCES = NO;
......
...@@ -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)
......
...@@ -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;
/** /**
* 删除寨信信息 * 删除寨信信息
* *
......
...@@ -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();
}];
}
/** /**
查找某聊天最后一条消息 查找某聊天最后一条消息
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
self.descLabel.font = [UIFont systemFontOfSize:17]; self.descLabel.font = [UIFont systemFontOfSize:17];
self.descLabel.textColor = [UIColor blackColor]; self.descLabel.textColor = [UIColor blackColor];
self.descLabel.textAlignment = NSTextAlignmentRight; self.descLabel.textAlignment = NSTextAlignmentRight;
self.descLabel.text = @"FusiClub.com"; self.descLabel.text = @"ifusiya.com";
[self addSubview:self.descLabel]; [self addSubview:self.descLabel];
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) { [self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.inset(24); make.left.right.inset(24);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment