Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
url = https://github.com/sqlcipher/sqlcipher.git
[submodule "Signals"]
path = Signals
url = https://github.com/peter-iakovlev/Signals.git
url=https://github.com/xingjun/Signals.git
[submodule "MtProtoKit"]
path = MtProtoKit
url = https://github.com/peter-iakovlev/MtProtoKit.git
url=https://github.com/xingjun/MtProtoKit.git
6 changes: 3 additions & 3 deletions ASCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ void TGLogToFilev(NSString *format, va_list args)
{
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];

BOOL result = [[NSProcessInfo processInfo].environment[@"console_logging"] boolValue];
//BOOL result = [[NSProcessInfo processInfo].environment[@"console_logging"] boolValue];

if(result) {
// if(result) {
NSLog(@"%@", message);
}
// }

dispatch_async(TGLogQueue(), ^
{
Expand Down
2 changes: 1 addition & 1 deletion MtProtoKit
10 changes: 10 additions & 0 deletions POPAnimator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,18 @@ - (void)_renderTime:(CFTimeInterval)time items:(std::list<POPAnimatorItemRef>)it
- (void)_renderTime:(CFTimeInterval)time item:(POPAnimatorItemRef)item
{
id obj = item->object;

POPAnimation *anim = item->animation;
POPAnimationState *state = POPAnimationGetState(anim);


if([obj respondsToSelector:@selector(isHidden)] && [obj respondsToSelector:@selector(superview)] && [obj respondsToSelector:@selector(window)]) {
if([obj isHidden] || [obj superview] == nil || [obj window] == nil) {
[obj pop_removeAllAnimations];
return;
}
}


if (nil == obj) {
// object exists not; stop animating
Expand Down
2 changes: 1 addition & 1 deletion Signals
17 changes: 15 additions & 2 deletions TGAnimationBlockDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,21 @@ - (void)pop_animationDidStart:(POPAnimation *)anim {
}


- (void)pop_animationDidStop:(POPAnimation *)anim finished:(BOOL)finished {
[self animationDidStop:nil finished:finished];
- (void)pop_animationDidStop:(POPAnimation *)anim finished:(BOOL)flag {
CALayer *layer = _layer;

if (flag)
{
if (_opacityOnCompletion != nil)
layer.opacity = [_opacityOnCompletion floatValue];
}
if (_removeLayerOnCompletion)
[layer removeFromSuperlayer];

if (_completion)
_completion(flag);

_completion = nil;
}


Expand Down
2 changes: 1 addition & 1 deletion TGDatacenterWatchdogActor.m
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ - (void)processConfig:(TL_config *)config fromDatacenterId:(NSInteger)datacenter
MTContext *context = [[MTNetwork instance] context];

setMaxChatUsers(config.chat_size_max-1);
setMaxBroadcastUsers(config.broadcast_size_max);
setMegagroupSizeMax(config.megagroup_size_max);

#if TARGET_IPHONE_SIMULATOR
NSMutableArray *dcOptions = [[NSMutableArray alloc] init];
Expand Down
2 changes: 2 additions & 0 deletions TGModernAnimatedImagePlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@

@property (nonatomic,assign) BOOL isPlaying;

-(NSImage *)poster;

@end
4 changes: 4 additions & 0 deletions TGModernAnimatedImagePlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@ - (void)pause
_isPlaying = NO;
}

-(NSImage *)poster {
return _image.posterImage;
}

@end
23 changes: 19 additions & 4 deletions TGShare/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,42 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>ru.keepcoder.Telegram.$(PRODUCT_NAME:rfc1034identifier)</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>1.98</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>33001</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>TRUEPREDICATE</string>
<dict>
<key>NSExtensionActivationSupportsAttachmentsWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsAttachmentsWithMinCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsFileWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
<integer>10</integer>
<key>NSExtensionActivationSupportsText</key>
<true/>
<key>NSExtensionActivationSupportsWebPageWithMaxCount</key>
<integer>1</integer>
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
<integer>1</integer>
</dict>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.share-services</string>
Expand Down
19 changes: 17 additions & 2 deletions TGShare/ShareViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ @interface ShareViewController ()<TMTableViewDelegate,TMSearchTextFieldDelegate>

@property (nonatomic,assign) BOOL isSearchActive;


@end

@implementation ShareViewController
Expand Down Expand Up @@ -273,13 +274,25 @@ -(void)loadNext {

_isLocked = YES;

[TGS_RPCRequest sendRequest:[TLAPI_messages_getDialogs createWithOffset:(int)_items.count max_id:0 limit:100] successHandler:^(TGS_RPCRequest *request, TL_messages_dialogsSlice *response) {

NSArray *items = [_tableView.list copy];

__block TGS_ConversationRowItem *rowItem = [items lastObject];

int date = 0;

if([rowItem isKindOfClass:[TGS_ConversationRowItem class]]) {
date = rowItem.date;
}


[TGS_RPCRequest sendRequest:[TLAPI_messages_getDialogs createWithOffset_date:date offset_id:0 offset_peer:[TL_inputPeerEmpty create] limit:100] successHandler:^(TGS_RPCRequest *request, TL_messages_dialogsSlice *response) {

NSMutableArray *items = [[NSMutableArray alloc] init];

[[response dialogs] enumerateObjectsUsingBlock:^(TLDialog *obj, NSUInteger idx, BOOL *stop) {

TLMessage *message = [[response.messages filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self.n_id == %d",obj.top_message]] lastObject];

TGS_ConversationRowItem *item;

if([obj.peer isKindOfClass:[TL_peerChat class]]) {
Expand All @@ -300,6 +313,8 @@ -(void)loadNext {
item = [[TGS_ConversationRowItem alloc] initWithConversation:obj user:users[0]];
}
}

item.date = message.date;
if(item) {
[items addObject:item];
}
Expand Down
70 changes: 49 additions & 21 deletions TGShare/TGSEnterPasscodeView.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
#import "TGS_MTNetwork.h"
#import "TGImageView.h"
#import "TGSImageObject.h"
#import "ShareViewController.h"
@interface TGSEnterPasscodeView ()
@property (nonatomic,strong) NSSecureTextField *secureField;
@property (nonatomic,strong) BTRButton *enterButton;
@property (nonatomic,strong) TGImageView *avatar;
@property (nonatomic,strong) BTRButton *cancelButton;
@end

@implementation TGSEnterPasscodeView
Expand All @@ -34,24 +36,24 @@ -(instancetype)initWithFrame:(NSRect)frameRect {



_avatar = [[TGImageView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];


[_avatar setCenterByView:self];

[_avatar setFrameOrigin:NSMakePoint(NSMinX(_avatar.frame), NSMinY(_avatar.frame) + 50)];

[self addSubview:_avatar];

TLUser *user = [ClassStore deserialize:[[TGSAppManager standartUserDefaults] objectForKey:@"selfUser"]];

TGSImageObject *imageObject = [[TGSImageObject alloc] initWithLocation:user.photo.photo_small];

imageObject.imageSize = NSMakeSize(100, 100);

_avatar.object = imageObject;


// _avatar = [[TGImageView alloc] initWithFrame:NSMakeRect(0, 0, 100, 100)];
//
//
// [_avatar setCenterByView:self];
//
// [_avatar setFrameOrigin:NSMakePoint(NSMinX(_avatar.frame), NSMinY(_avatar.frame) + 50)];
//
// [self addSubview:_avatar];
//
// TLUser *user = [ClassStore deserialize:[[TGSAppManager standartUserDefaults] objectForKey:@"selfUser"]];
//
// TGSImageObject *imageObject = [[TGSImageObject alloc] initWithLocation:user.photo.photo_small];
//
// imageObject.imageSize = NSMakeSize(100, 100);
//
// _avatar.object = imageObject;
//
//

self.backgroundColor = [NSColor whiteColor];

Expand All @@ -62,7 +64,7 @@ -(instancetype)initWithFrame:(NSRect)frameRect {

[attrs appendString:NSLocalizedString(@"Passcode.EnterPlaceholder", nil) withColor:NSColorFromRGB(0xc8c8c8)];

[attrs setAttributes:@{NSFontAttributeName:[NSFont fontWithName:@"HelveticaNeue" size:12]} range:attrs.range];
[attrs setAttributes:@{NSFontAttributeName:TGSystemFont(12)} range:attrs.range];

[[self.secureField cell] setPlaceholderAttributedString:attrs];

Expand Down Expand Up @@ -93,12 +95,12 @@ -(instancetype)initWithFrame:(NSRect)frameRect {
[self.secureField setAction:@selector(checkPassword)];
[self.secureField setTarget:self];

[self.secureField setFont:[NSFont fontWithName:@"HelveticaNeue" size:14]];
[self.secureField setFont:TGSystemFont(14)];
[self.secureField setTextColor:DARK_BLACK];

[self.secureField setCenterByView:self];

[self.secureField setFrameOrigin:NSMakePoint(NSMinX(_secureField.frame), NSMinY(_secureField.frame) - 30)];
// [self.secureField setFrameOrigin:NSMakePoint(NSMinX(_secureField.frame), NSMinY(_secureField.frame) - 30)];


[self addSubview:self.secureField];
Expand All @@ -121,6 +123,32 @@ -(instancetype)initWithFrame:(NSRect)frameRect {
[self.enterButton setFrameOrigin:NSMakePoint(NSMaxX(self.secureField.frame) + 20, NSMinY(self.secureField.frame) + 3)];

[self addSubview:self.enterButton];



_cancelButton = [[BTRButton alloc] initWithFrame:NSMakeRect(NSWidth(_cancelButton.frame), 0, NSWidth(self.frame), 50)];

_cancelButton.layer.backgroundColor = [NSColor whiteColor].CGColor;

[_cancelButton setTitleColor:LINK_COLOR forControlState:BTRControlStateNormal];

[_cancelButton setTitle:NSLocalizedString(@"Cancel", nil) forControlState:BTRControlStateNormal];

[_cancelButton addBlock:^(BTRControlEvents events) {

[ShareViewController close];


} forControlEvents:BTRControlEventClick];

[self addSubview:_cancelButton];

TMView *topSeparator = [[TMView alloc] initWithFrame:NSMakeRect(0, 49, NSWidth(self.frame), DIALOG_BORDER_WIDTH)];

topSeparator.backgroundColor = DIALOG_BORDER_COLOR;

[self addSubview:topSeparator];

}

return self;
Expand Down
13 changes: 13 additions & 0 deletions TGShare/TGSKeychain.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// TGSKeychain.h
// Telegram
//
// Created by keepcoder on 03.09.15.
// Copyright (c) 2015 keepcoder. All rights reserved.
//

#import "TGKeychain.h"

@interface TGSKeychain : TGKeychain

@end
17 changes: 17 additions & 0 deletions TGShare/TGSKeychain.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//
// TGSKeychain.m
// Telegram
//
// Created by keepcoder on 03.09.15.
// Copyright (c) 2015 keepcoder. All rights reserved.
//

#import "TGSKeychain.h"

@implementation TGSKeychain

- (void)_storeKeychain:(NSString *)group {

}

@end
Loading