Files
GLEGram-iOS/Telegram/Watch/Extension/TGUserHandleRowController.m
Leeksov 4647310322 GLEGram 12.5 — Initial public release
Based on Swiftgram 12.5 (Telegram iOS 12.5).
All GLEGram features ported and organized in GLEGram/ folder.

Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass,
Font Replacement, Fake Profile, Chat Export, Plugin System, and more.

See CHANGELOG_12.5.md for full details.
2026-04-06 09:48:12 +03:00

48 lines
1.4 KiB
Objective-C

#import "TGUserHandleRowController.h"
#import "TGUserHandle.h"
NSString *const TGUserHandleRowIdentifier = @"TGUserHandleRow";
@implementation TGUserHandleRowController
- (void)updateWithUserHandle:(TGUserHandle *)userHandle
{
bool useRegularFont = (userHandle.handleType == TGUserHandleTypeDescription);
NSMutableDictionary *attributes = [[NSMutableDictionary alloc] init];
attributes[NSFontAttributeName] = useRegularFont ? [UIFont systemFontOfSize:16.0f weight:UIFontWeightRegular] : [UIFont systemFontOfSize:16.0f weight:UIFontWeightMedium];
attributes[NSForegroundColorAttributeName] = [UIColor whiteColor];
if (useRegularFont)
{
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.hyphenationFactor = 1.0f;
attributes[NSParagraphStyleAttributeName] = paragraphStyle;
}
NSString *handle = userHandle.handle;
if (handle == nil)
handle = @"";
self.handleLabel.attributedText = [[NSAttributedString alloc] initWithString:handle attributes:attributes];
self.typeLabel.text = userHandle.type;
}
+ (NSString *)identifier
{
return TGUserHandleRowIdentifier;
}
@end
NSString *const TGUserHandleActiveRowIdentifier = @"TGUserHandleActiveRow";
@implementation TGUserHandleActiveRowController
+ (NSString *)identifier
{
return TGUserHandleActiveRowIdentifier;
}
@end