优化私聊页面跟随进游戏房失败
This commit is contained in:
@@ -23,6 +23,11 @@
|
||||
#import "XPMineUserInfoViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
#import "RoomHostDelegate.h"
|
||||
///Model
|
||||
#import "RoomInfoModel.h"
|
||||
#import "UserInfoModel.h"
|
||||
///Tool
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
|
||||
@interface SessionViewController ()<MessageProtocol, UITableViewDelegate, UITableViewDataSource, NIMChatManagerDelegate, NIMConversationManagerDelegate, NIMMediaManagerDelegate, SendMessageViewDelegate, XPSessionMessageHeadViewDelegate>
|
||||
|
||||
@@ -33,6 +38,7 @@
|
||||
@property (nonatomic, strong) SendMessageView * sendMessageView;
|
||||
///跟随进房卡片
|
||||
@property (nonatomic, strong) XPSessionMessageHeadView *followInRoomView;
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
|
||||
@end
|
||||
|
||||
@@ -138,6 +144,7 @@
|
||||
|
||||
///获取用户信息成功
|
||||
- (void)onGetSessionUserInfoSuccess:(UserInfoModel *)userInfo {
|
||||
_userInfo = userInfo;
|
||||
if (userInfo.roomUid) {
|
||||
self.followInRoomView.hidden = NO;
|
||||
self.followInRoomView.userInfo = userInfo;
|
||||
@@ -224,16 +231,30 @@
|
||||
}
|
||||
|
||||
- (void)onFollowInRoom:(NSString *)roomUid {
|
||||
//退出原来的房间 如果有的话 TODO 总感觉这种处理不太优雅 进房入口多了 怎么办 进房需要整合
|
||||
__block BOOL isSameRoom = NO;
|
||||
__block RoomInfoModel *roomModel;
|
||||
[self.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||
if ([obj isKindOfClass:[XPRoomViewController class]]) {
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
XPRoomViewController<RoomHostDelegate> * rooomVC = obj;
|
||||
[rooomVC exitRoom];
|
||||
[self.navigationController popToRootViewControllerAnimated:NO];
|
||||
roomModel = rooomVC.getRoomInfo;
|
||||
if(rooomVC.getRoomInfo.uid == [roomUid integerValue]) {
|
||||
isSameRoom = YES;
|
||||
} else {
|
||||
[rooomVC exitRoom];
|
||||
}
|
||||
*stop = YES;
|
||||
}
|
||||
}];
|
||||
[XPRoomViewController openRoom:roomUid viewController:self];
|
||||
if (!isSameRoom) {
|
||||
if (roomModel.type == RoomType_MiniGame) {
|
||||
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
|
||||
[XPRoomViewController openRoom:roomUid fromNick:self.userInfo.nick fromType:UserEnterRoomFromType_Follow_User fromUid:[NSString stringWithFormat:@"%ld", self.userInfo.uid] viewController:[[XCCurrentVCStackManager shareManager] getCurrentVC]];
|
||||
});
|
||||
} else {
|
||||
[XPRoomViewController openRoom:roomUid fromNick:self.userInfo.nick fromType:UserEnterRoomFromType_Follow_User fromUid:[NSString stringWithFormat:@"%ld", self.userInfo.uid] viewController:self];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - SendMessageViewDelegate
|
||||
|
Reference in New Issue
Block a user