1
0
mirror of https://github.com/danog/Telegram.git synced 2024-12-02 09:27:55 +01:00
Telegram/Telegraph/TGSaveGeocodingResultActor.m
2014-07-10 18:11:09 +04:00

34 lines
814 B
Objective-C

#import "TGSaveGeocodingResultActor.h"
#import "ActionStage.h"
#import "TGTelegraph.h"
@implementation TGSaveGeocodingResultActor
+ (NSString *)genericPath
{
return @"/tg/location/savegeocode/@";
}
- (void)execute:(NSDictionary *)options
{
NSDictionary *components = [options objectForKey:@"components"];
double latitude = [[options objectForKey:@"latitude"] doubleValue];
double longitude = [[options objectForKey:@"longitude"] doubleValue];
self.cancelToken = [TGTelegraphInstance doSaveGeocodingResult:latitude longitude:longitude components:components actor:self];
}
- (void)saveGeocodingResultSuccess
{
[ActionStageInstance() actionCompleted:self.path result:nil];
}
- (void)saveGeocodingResultFailed
{
[ActionStageInstance() actionFailed:self.path reason:-1];
}
@end