协议的webview修改,h5链接加密,上传默认头像链接更改

This commit is contained in:
linyudan
2023-11-24 15:17:43 -08:00
parent 5597016f94
commit 3fece8830f
12 changed files with 56 additions and 211 deletions

View File

@@ -156,4 +156,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: cc88fa05da662ee682fc0eeb502faab221faa032 PODFILE CHECKSUM: cc88fa05da662ee682fc0eeb502faab221faa032
COCOAPODS: 1.12.1 COCOAPODS: 1.14.2

View File

@@ -9,13 +9,14 @@
#define ApiHost_h #define ApiHost_h
#ifdef DEBUG #ifdef DEBUG
#define API_HOST_H5_URL @"http://beta.h5.nnbc123.cn" /// http://beta.h5.ymlive.fun
#define API_HOST_H5_URL @"GoK87pcrCtMGRUiI37dI/jjoKPw7cA0hRRBRFdEmwbY="
/// http://beta.api.ymlive.fun /// http://beta.api.ymlive.fun
#define API_HOST_URL @"699gQF4rRYIwztF2zlUunGDlDP2GdDcO5MWptrXUmgU=" #define API_HOST_URL @"699gQF4rRYIwztF2zlUunGDlDP2GdDcO5MWptrXUmgU="
#else #else
#define API_HOST_H5_URL @"https://h5.nnbc123.cn" /// http://h5.ymlive.fun
#define API_HOST_H5_URL @"FRuPSi1EatQns610kVGhvBTZFQy13wFqbpfw5SyhvAM="
/// https://api.ymlive.fun /// https://api.ymlive.fun
#define API_HOST_URL @"Lk4rBT4xOjIVF9nPfBvRvyW9xx/sjOb0YbkCThRndxU=" #define API_HOST_URL @"Lk4rBT4xOjIVF9nPfBvRvyW9xx/sjOb0YbkCThRndxU="

View File

@@ -6,15 +6,16 @@
// //
#import "MewHtmlUrl.h" #import "MewHtmlUrl.h"
#import "NewEncryptTool.h"
@implementation MewHtmlUrl @implementation MewHtmlUrl
NSString * const URLWithType(URLType type) { NSString * const URLWithType(URLType type) {
NSString * prefix = @"mew"; NSString * prefix = @"mew";
NSDictionary * dic = @{ NSDictionary * dic = @{
@(kPrivacyURL) : @"modules/rule/privacy-wap.html",// @(kPrivacyURL) : [NewEncryptTool MEW_aesDecrypt:@"RW2RUxUBFSQXiYS0xFpDv+HMdWG2/xfjkYMyeSFR/BY="],//modules/rule/privacy-wap.html
@(kCancelAccout) : @"modules/rule/logout-agreement.html",// @(kCancelAccout) : [NewEncryptTool MEW_aesDecrypt:@"OdODqmY17B0vG9Gs7FGtEuzMJQXILqziECH6PQoOSLo="],//modules/logout/index.html
@(kUserProtocalURL) : @"modules/rule/protocol.html",/// @(kUserProtocalURL) : [NewEncryptTool MEW_aesDecrypt:@"oSYlxZYQP2Vu+3KRnQorypsYWQGEz2tKII7AwcFks7s="],///modules/rule/protocol.html
}; };
NSString * url = [dic objectForKey:@(type)]; NSString * url = [dic objectForKey:@(type)];
return [NSString stringWithFormat:@"%@/%@",prefix, url]; return [NSString stringWithFormat:@"%@/%@",prefix, url];

View File

@@ -76,7 +76,7 @@
- (NetImageView *)avaterImageView { - (NetImageView *)avaterImageView {
if (!_avaterImageView) { if (!_avaterImageView) {
_avaterImageView = [[NetImageView alloc] init]; _avaterImageView = [[NetImageView alloc] init];
_avaterImageView.backgroundColor = UIColor.yellowColor; // _avaterImageView.backgroundColor = UIColor.yellowColor;
_avaterImageView.layer.cornerRadius = 24; _avaterImageView.layer.cornerRadius = 24;
_avaterImageView.layer.masksToBounds = YES; _avaterImageView.layer.masksToBounds = YES;
} }

View File

@@ -168,7 +168,7 @@
_avaterImageView = [[NetImageView alloc] init]; _avaterImageView = [[NetImageView alloc] init];
_avaterImageView.layer.cornerRadius = 58/2.0; _avaterImageView.layer.cornerRadius = 58/2.0;
_avaterImageView.layer.masksToBounds = YES; _avaterImageView.layer.masksToBounds = YES;
_avaterImageView.backgroundColor = UIColor.redColor; // _avaterImageView.backgroundColor = UIColor.redColor;
} }
return _avaterImageView; return _avaterImageView;

View File

@@ -20,6 +20,7 @@
#import "UIView+NIM.h" #import "UIView+NIM.h"
#import "UIView+FilletCorner.h" #import "UIView+FilletCorner.h"
#import "YMMacro.h" #import "YMMacro.h"
#import "NewEncryptTool.h"
@interface MewSessionListTableViewCell() @interface MewSessionListTableViewCell()
/// ///
@@ -44,7 +45,7 @@
- (void)renderWithSession:(NIMRecentSession *)recent { - (void)renderWithSession:(NIMRecentSession *)recent {
_session = recent; _session = recent;
NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:recent.session.sessionId]; NIMUser *user = [[NIMSDK sharedSDK].userManager userInfo:recent.session.sessionId];
self.avatarImageView.imageUrl = user.userInfo.avatarUrl; self.avatarImageView.imageUrl = (user.userInfo.avatarUrl == nil || user.userInfo.avatarUrl.length == 0) ? [NewEncryptTool MEW_aesDecrypt:@"xdPnNelVD/RTlTKFqgSrESDPcNF6Diqb8sLg+HEvxpvjDdTLom1euQUOAOppjx15"] : user.userInfo.avatarUrl;
self.nameLabel.text = user.userInfo.nickName; self.nameLabel.text = user.userInfo.nickName;
[self.nameLabel sizeToFit]; [self.nameLabel sizeToFit];

View File

@@ -14,6 +14,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)didSelectMewRechargeChargeProdId:(NSString *)chargeProdId; - (void)didSelectMewRechargeChargeProdId:(NSString *)chargeProdId;
- (void)didSelectMewRechargeProtocol;
@end @end
@interface MewRechargeSubView : UIView @interface MewRechargeSubView : UIView

View File

@@ -264,10 +264,10 @@
@kWeakify(self); @kWeakify(self);
[rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { [rechargeAttString yy_setTextHighlightRange:NSMakeRange(0, rechargeAttString.length) color:nil backgroundColor:nil userInfo:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
@kStrongify(self); @kStrongify(self);
// [self dismissViewControllerAnimated:NO completion:nil]; if (self.delegate) {
// XPWebViewController * webVC = [[XPWebViewController alloc] init]; [self.delegate didSelectMewRechargeProtocol];
// webVC.url = @"yinmeng/modules/rule/rechargeAgreement.html"; }
// [self.currentNav pushViewController:webVC animated:YES];
} longPressAction:nil]; } longPressAction:nil];

View File

@@ -8,6 +8,7 @@
#import "MewRechargeViewController.h" #import "MewRechargeViewController.h"
/// View /// View
#import "MewRechargeSubView.h" #import "MewRechargeSubView.h"
#import "YMWebViewController.h"
/// Third /// Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#import "YMMacro.h" #import "YMMacro.h"
@@ -19,6 +20,8 @@
#import "YMHUDTool.h" #import "YMHUDTool.h"
#import "yinmeng_ios-Swift.h" #import "yinmeng_ios-Swift.h"
#import "RechargeStorage.h" #import "RechargeStorage.h"
#import "NewEncryptTool.h"
@interface MewRechargeViewController ()<MineRechargeProtocol, MewRechargeSubViewDelegate, YMIAPHelperDelegate> @interface MewRechargeViewController ()<MineRechargeProtocol, MewRechargeSubViewDelegate, YMIAPHelperDelegate>
@property (nonatomic, strong) UIImageView *rechargeBgImageView; @property (nonatomic, strong) UIImageView *rechargeBgImageView;
@property (nonatomic, strong) UIButton *backButton; @property (nonatomic, strong) UIButton *backButton;
@@ -205,6 +208,16 @@
[YMHUDTool showLoadingInView:kWindow]; [YMHUDTool showLoadingInView:kWindow];
[self.presenter requestIAPRechargeOrderWithChargeProdId:chargeProdId]; [self.presenter requestIAPRechargeOrderWithChargeProdId:chargeProdId];
} }
///
- (void)didSelectMewRechargeProtocol {
[self dismissViewControllerAnimated:NO completion:nil];
YMWebViewController * webVC = [[YMWebViewController alloc] init];
/// mew/modules/rule/rechargeAgreement.html
NSString *rechageProtocol = [NewEncryptTool MEW_aesDecrypt:@"3fYQzValG55yGNx2mWnN7NvVzsWc9cmKVWuOUkwu8a9ALvqUxXRhaWrnne5rd9oR"];
webVC.url = rechageProtocol;
[self.navigationController pushViewController:webVC animated:YES];
}
#pragma mark - YMIAPHelperDelegate #pragma mark - YMIAPHelperDelegate

View File

@@ -11,15 +11,17 @@
#import "YYUtility.h" #import "YYUtility.h"
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "ThemeColor.h" #import "ThemeColor.h"
#import "YMMacro.h"
#import "NewEncryptTool.h"
/// Third /// Third
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
#ifdef DEBUG //#ifdef DEBUG
static const NSString *CompanyFirstDomainByWeChatRegister = @"api.uat.lecheng163.com"; //static const NSString *CompanyFirstDomainByWeChatRegister = @"api.uat.lecheng163.com";
#else //#else
static const NSString *CompanyFirstDomainByWeChatRegister = @"api.lecheng163.com"; //static const NSString *CompanyFirstDomainByWeChatRegister = @"api.lecheng163.com";
#endif //#endif
@interface WeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler> @interface WeakWebViewScriptMessageDelegate : NSObject<WKScriptMessageHandler>
@@ -55,8 +57,6 @@ static const NSString *CompanyFirstDomainByWeChatRegister = @"api.lecheng163.com
NSString * const kJSGetUid = @"getUid"; NSString * const kJSGetUid = @"getUid";
@interface YMWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler> @interface YMWebViewController ()<WKNavigationDelegate, WKScriptMessageHandler>
@property (strong, nonatomic) WKWebView *webview; @property (strong, nonatomic) WKWebView *webview;
@property (strong, nonatomic) UIProgressView *progressView;
@property (nonatomic, strong) WKUserContentController *mew_userContentController;
@end @end
@@ -66,6 +66,8 @@ NSString * const kJSGetUid = @"getUid";
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
[self initView]; [self initView];
NSString *urlString = [NSString stringWithFormat:@"%@/%@", [NewEncryptTool MEW_aesDecrypt: API_HOST_H5_URL], self.url];
[self.webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
} }
@@ -84,73 +86,6 @@ NSString * const kJSGetUid = @"getUid";
} }
} }
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
[self.webview evaluateJavaScript:@"document.location.href" completionHandler:^(id _Nullable response, NSError * _Nullable error) {
NSString *currentUrl = [NSString stringWithFormat:@"%@", response];
if (currentUrl != nil) {
if ([message.name isEqualToString:kJSGetUid]) {
NSString *uid = [[AccountInfoStorage instance] getUid];
NSString *js = [NSString stringWithFormat:@"getMessage(\"uid\",%@)", uid];
[self.webview evaluateJavaScript:js completionHandler:^(id _Nullable other, NSError * _Nullable error) {
NSLog(@"%@",error);
}];
}
}
}];
}
- (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler{
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
dispatch_async(dispatch_get_main_queue(), ^{
NSURLCredential *card = [[NSURLCredential alloc]initWithTrust:challenge.protectionSpace.serverTrust];
completionHandler(NSURLSessionAuthChallengeUseCredential,card);
});
}
}
//
- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
//progressView
self.progressView.hidden = YES;
}
//
- (void)webView:(WKWebView *)webView didFailProvisionalNavigation:(WKNavigation *)navigation withError:(NSError *)error {
//progressView
self.progressView.hidden = YES;
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSString *,id> *)change context:(void *)context {
if ([keyPath isEqualToString:@"estimatedProgress"]) {
self.progressView.progress = self.webview.estimatedProgress;
if (self.progressView.progress == 1) {
__weak typeof (self)weakSelf = self;
[UIView animateWithDuration:0.25f delay:0.3f options:UIViewAnimationOptionCurveEaseOut animations:^{
weakSelf.progressView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
} completion:^(BOOL finished) {
weakSelf.progressView.hidden = YES;
}];
}
} else if ([keyPath isEqualToString:@"title"]) {
if (object == self.webview) {
self.navigationItem.title = self.webview.title;
// if (self.urlLoadCompleted) {//webview
// self.urlLoadCompleted(YES, nil);
// }
}else{
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
} else {
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
}
}
- (void)dealloc {
[self.webview removeObserver:self forKeyPath:@"estimatedProgress"];
[self.webview removeObserver:self forKeyPath:@"title"];
}
#pragma mark - InitView #pragma mark - InitView
- (void)initView { - (void)initView {
@@ -164,7 +99,6 @@ NSString * const kJSGetUid = @"getUid";
make.left.right.top.bottom.mas_equalTo(self.view); make.left.right.top.bottom.mas_equalTo(self.view);
}]; }];
[self.view addSubview:self.progressView];
} }
@@ -174,36 +108,10 @@ NSString * const kJSGetUid = @"getUid";
if (_url == nil) { if (_url == nil) {
return; return;
} }
if (![_url hasPrefix:@"http"] && ![_url hasPrefix:@"https"]){
_url = [NSString stringWithFormat:@"%@/%@", API_HOST_H5_URL, _url];
}
if (![_url containsString:@"?"]) {
_url = [NSString stringWithFormat:@"%@?platform=%@", _url, [YYUtility appName]];
} else {
_url = [NSString stringWithFormat:@"%@&platform=%@", _url, [YYUtility appName]];
}
// urlString
NSString *noSpaceTextUrl = [_url stringByReplacingOccurrencesOfString:@" " withString:@""];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:noSpaceTextUrl]];
[self.webview loadRequest:request];
} }
#pragma mark - Get #pragma mark - Get
- (UIProgressView *)progressView{
if (!_progressView) {
_progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width, 1)];
_progressView.progressTintColor = UIColor.blackColor;
_progressView.trackTintColor = [UIColor clearColor];
_progressView.transform = CGAffineTransformMakeScale(1.0f, 1.0f);
}
return _progressView;
}
- (WKWebView *)webview { - (WKWebView *)webview {
if (_webview == nil) { if (_webview == nil) {
@@ -214,107 +122,18 @@ NSString * const kJSGetUid = @"getUid";
} else { } else {
// Fallback on earlier versions // Fallback on earlier versions
} }
configuration.allowsInlineMediaPlayback = YES;
NSString *uid = [[AccountInfoStorage instance] getUid]; _webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
NSString *realCookie = [NSString stringWithFormat:@"%@=%@",@"uid",uid];
WKUserScript *cookieScript = [[WKUserScript alloc] initWithSource: [NSString stringWithFormat:@"document.cookie = '%@';", realCookie] injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:NO];
[self.mew_userContentController addUserScript:cookieScript];
///
NSString *scaleJs = @"$('meta[name=description]').remove(); $('head').append( '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1,user-scalable=no\">' );";
WKUserScript *scaleScript = [[WKUserScript alloc] initWithSource:scaleJs injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
[self.mew_userContentController addUserScript:scaleScript];
//WKUserScriptWKWebViewConfiguration
configuration.preferences.javaScriptEnabled = YES;
configuration.preferences.javaScriptCanOpenWindowsAutomatically = YES;
configuration.preferences.minimumFontSize = 10;
configuration.selectionGranularity = WKSelectionGranularityCharacter;
configuration.userContentController = self.mew_userContentController;
CGSize size = [UIScreen mainScreen].bounds.size;
_webview = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, size.width,size.height) configuration:configuration];
_webview.navigationDelegate = self;
//KVOWKWebViewestimatedProgress
[_webview addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionNew context:nil];
//KVOtitle
[_webview addObserver:self forKeyPath:@"title" options:NSKeyValueObservingOptionNew context:NULL];
UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(backButtonClick)]; UISwipeGestureRecognizer *swipeGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(backButtonClick)];
[_webview addGestureRecognizer:swipeGesture]; [_webview addGestureRecognizer:swipeGesture];
[_webview.scrollView setShowsVerticalScrollIndicator:NO]; [_webview.scrollView setShowsVerticalScrollIndicator:NO];
[_webview.scrollView setShowsHorizontalScrollIndicator:NO]; [_webview.scrollView setShowsHorizontalScrollIndicator:NO];
//set useragent
__weak typeof(self) weakSelf = self;
[_webview evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
NSString *userAgent = result;
if (![userAgent containsString:@"tutuAppIos erbanAppIos"]){
NSString *newUserAgent = [userAgent stringByAppendingString:@" tutuAppIos erbanAppIos"];
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:newUserAgent, @"UserAgent", nil];
[[NSUserDefaults standardUserDefaults] registerDefaults:dictionary];
[[NSUserDefaults standardUserDefaults] synchronize];
[weakSelf.webview setCustomUserAgent:newUserAgent];
}
}];
_webview.scrollView.bounces = NO; _webview.scrollView.bounces = NO;
} }
return _webview; return _webview;
} }
- (WKUserContentController *)mew_userContentController{
if (!_mew_userContentController) {
//WKScriptMessageHandler
WeakWebViewScriptMessageDelegate *weakScriptMessageDelegate = [[WeakWebViewScriptMessageDelegate alloc] initWithDelegate:self];
_mew_userContentController = [[WKUserContentController alloc] init];
// uid
[_mew_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid];
//
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenSharePage];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenPurse];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenChargePage];
// // uid
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetUid];
// // id
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceId];
// // Ticket
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetTicket];
// // info
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetDeviceInfo];
// // :
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenFaceLiveness];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSInitNav];
// // uid
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSGetRoomUid];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenPersonPage];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kInitShowNav];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCloseWebView];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJumpAppointPage];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoom];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kJSOpenRoomForGiftId];
// ///
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kProhibitRightSlip];
/////
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kSaveBase64Image];
// //
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenDialogWebview];
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kCheckResultFinish];
// [_userContentController addScriptMessageHandler:weakScriptMessageDelegate name:kOpenNativeTarotPay];
}
return _mew_userContentController;
}
@end @end

View File

@@ -15,6 +15,7 @@
#import "AccountInfoStorage.h" #import "AccountInfoStorage.h"
#import "UIImage+Utils.h" #import "UIImage+Utils.h"
#import "YMHUDTool.h" #import "YMHUDTool.h"
#import "NewEncryptTool.h"
///Model ///Model
#import "ThirdUserInfo.h" #import "ThirdUserInfo.h"
/// presenter /// presenter
@@ -119,7 +120,7 @@
if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) { if ([self.presenter getThirdUserInfo] && [self.presenter getThirdUserInfo].avatarUrl.length > 0) {
avatar = [self.presenter getThirdUserInfo].avatarUrl; avatar = [self.presenter getThirdUserInfo].avatarUrl;
} else { } else {
avatar = @"https://image.nnbc123.cn/default_avatar.png"; avatar = [NewEncryptTool MEW_aesDecrypt:@"xdPnNelVD/RTlTKFqgSrESDPcNF6Diqb8sLg+HEvxpvjDdTLom1euQUOAOppjx15"];
} }
return avatar; return avatar;
} }

View File

@@ -239,9 +239,9 @@
// } roomUid:roomUid micUid:uid position:position uid:uid]; // } roomUid:roomUid micUid:uid position:position uid:uid];
// } // }
// //
// if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue ) { if (sequence && sequence.userInfo.uid == [AccountInfoStorage instance].getUid.integerValue ) {
[RtcManager instance].localMuted = NO; [RtcManager instance].localMuted = NO;
// } }
} }
microQueueChanged = YES; microQueueChanged = YES;
@@ -402,6 +402,13 @@
[view configRoomInfo:roomInfo]; [view configRoomInfo:roomInfo];
[view configMicQueue:self.micQueue]; [view configMicQueue:self.micQueue];
[view configMicroView:model]; [view configMicroView:model];
if (self.hostDelegate.getUserInfo.uid && model.userInfo.uid == self.hostDelegate.getUserInfo.uid) {
selfNeedBroadcast = model.microState.micState == MicroMicStateType_Open;
}
if (model.microState.micState == MicroMicStateType_Close) {
[RtcManager instance].localMuted = YES;
}
// [view showLeaveMode:(i == 0 && leaveMode)]; // [view showLeaveMode:(i == 0 && leaveMode)];
} }
@@ -409,7 +416,7 @@
if (!isHandleRTC) { if (!isHandleRTC) {
return; return;
} }
[[RtcManager instance] broadcast:YES]; [[RtcManager instance] broadcast:selfNeedBroadcast];
} }