Skip to content

Commit 676b57b

Browse files
committed
修复私聊视频文案上移(兼容热更新)
1 parent 46dfa11 commit 676b57b

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

AwemeHeaders.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ typedef NS_ENUM(NSUInteger, DYEdgeMode) {
153153
@end
154154

155155
@interface AWEABTestManager : NSObject
156+
+ (id)sharedManager;
156157
@property(retain, nonatomic) NSMutableDictionary *consistentABTestDic;
157158
@property(copy, nonatomic) NSDictionary *abTestData;
158159
@property(copy, nonatomic) NSDictionary *performanceReversalDic;

DYYY.xm

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6282,18 +6282,30 @@ static void *DYYYTabBarHeightContext = &DYYYTabBarHeightContext;
62826282
static NSNumber *shouldRestoreChat = nil;
62836283
static dispatch_once_t onceToken;
62846284
dispatch_once(&onceToken, ^{
6285-
BOOL includeChat = NO;
6286-
Class managerClass = %c(AWEVersionUpdateManager);
6287-
if (managerClass && [managerClass respondsToSelector:@selector(sharedInstance)]) {
6288-
AWEVersionUpdateManager *manager = [managerClass sharedInstance];
6289-
if ([manager respondsToSelector:@selector(currentVersion)]) {
6290-
NSString *currentVersion = manager.currentVersion;
6291-
if (currentVersion.length > 0) {
6292-
includeChat = ([DYYYUtils compareVersion:currentVersion toVersion:@"35.5.0"] == NSOrderedAscending);
6293-
}
6294-
}
6295-
}
6296-
shouldRestoreChat = @(includeChat);
6285+
BOOL includeChat = NO;
6286+
AWEVersionUpdateManager *manager = [%c(AWEVersionUpdateManager) sharedInstance];
6287+
NSString *currentVersion = manager.currentVersion;
6288+
if (currentVersion.length > 0) {
6289+
NSComparisonResult cmp1 = [DYYYUtils compareVersion:currentVersion toVersion:@"35.5.0"];
6290+
NSComparisonResult cmp2 = [DYYYUtils compareVersion:currentVersion toVersion:@"37.2.0"];
6291+
BOOL enableForIMMediaDetail = YES;
6292+
// 检查 ABTest 配置(大于 37.2.0 时需看 ABTest 状态)
6293+
if (cmp2 != NSOrderedAscending) {
6294+
id abTestMgr = [%c(AWEABTestManager) sharedManager];
6295+
NSDictionary *abDic = [abTestMgr consistentABTestDic];
6296+
NSDictionary *imOpt = [abDic objectForKey:@"im_media_detail_page_opt"];
6297+
if ([imOpt isKindOfClass:[NSDictionary class]]) {
6298+
id enableValue = [imOpt objectForKey:@"enable"];
6299+
if ([enableValue respondsToSelector:@selector(boolValue)]) {
6300+
enableForIMMediaDetail = [enableValue boolValue];
6301+
}
6302+
}
6303+
}
6304+
if (cmp1 == NSOrderedAscending || (cmp2 != NSOrderedAscending && enableForIMMediaDetail)) {
6305+
includeChat = YES;
6306+
}
6307+
}
6308+
shouldRestoreChat = @(includeChat);
62976309
});
62986310

62996311
if (shouldRestoreChat.boolValue) {

0 commit comments

Comments
 (0)