File tree Expand file tree Collapse file tree 5 files changed +18
-3
lines changed
ChatSecure/Classes/Utilities Expand file tree Collapse file tree 5 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 1010
1111#import " OTRThreadOwner.h"
1212
13+ NS_ASSUME_NONNULL_BEGIN
1314@interface OTRColors : NSObject
1415
1516+(UIColor *)colorWithStatus : (OTRThreadStatus)status ;
2425+ (UIColor *)warnColor ;
2526
2627+ (UIColor *)defaultBlueColor ;
27-
2828@end
29+ NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 77//
88
99#import " OTRColors.h"
10+ @import OTRAssets;
1011
1112@implementation OTRColors
1213
1314+(UIColor *)colorWithStatus : (OTRThreadStatus)status
1415{
15- UIColor *color = nil ;
16+ if (!OTRBranding.showsColorForStatus ) {
17+ return [UIColor clearColor ];
18+ }
19+ UIColor *color = [UIColor clearColor ];
1620 switch (status)
1721 {
1822 case OTRThreadStatusUnknown:
1923 case OTRThreadStatusOffline:
2024 // color = [UIColor colorWithRed: 0.763 green: 0.763 blue: 0.763 alpha: 1];
21- return nil ;
25+ return [UIColor clearColor ] ;
2226 break ;
2327 case OTRThreadStatusAway:
2428 color = [UIColor colorWithRed: 0.901 green: 0.527 blue: 0.23 alpha: 1 ];
Original file line number Diff line number Diff line change @@ -83,5 +83,8 @@ FOUNDATION_EXPORT NSString *const kOTRSettingKeyLanguage;
8383/* * If enabled, the server selection cell will be shown when creating new accounts. Otherwise it will be hidden in the 'advanced' section. */
8484+ (BOOL ) shouldShowServerCell ;
8585
86+ /* * If enabled, will show colors for status indicators. */
87+ @property (class , readonly ) BOOL showsColorForStatus;
88+
8689@end
8790NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change @@ -144,6 +144,11 @@ + (BOOL) shouldShowServerCell {
144144 return result;
145145}
146146
147+ + (BOOL ) showsColorForStatus {
148+ BOOL result = [[[self defaultPlist ] objectForKey: @" ShowsColorForStatus" ] boolValue ];
149+ return result;
150+ }
151+
147152+ (NSDictionary *) defaultPlist {
148153 // Normally this won't be nil, but they WILL be nil during tests.
149154 NSBundle *bundle = [OTRAssets resourcesBundle ];
Original file line number Diff line number Diff line change 3636 <true />
3737 <key >ShouldShowServerCell </key >
3838 <true />
39+ <key >ShowsColorForStatus </key >
40+ <true />
3941</dict >
4042</plist >
You can’t perform that action at this time.
0 commit comments