[iOS] Fixes ge0 message sending with text and preview sharing

This commit is contained in:
Kirill Zhdanovich 2013-07-30 23:21:41 +03:00 committed by Alex Zolotarev
parent a9113ff284
commit be860e044a
2 changed files with 5 additions and 3 deletions

View file

@ -207,7 +207,7 @@ typedef enum {APIPOINT, POI, MYPOSITION} Type;
- (void)actionSheet:(UIActionSheet *)actionSheet willDismissWithButtonIndex:(NSInteger)buttonIndex
{
string name = "";
if (m_previewType == APIPOINT)
if (m_previewType == POI)
name = m_poiInfo.GetPinName();
else if (m_previewType == APIPOINT)
name = m_apiPoint.m_name;

View file

@ -13,6 +13,8 @@
#include "../../search/result.hpp"
#define GE0LENGTH 16
@implementation ShareActionSheet
+(void)showShareActionSheetInView:(id)view withObject:(id)del
{
@ -36,7 +38,7 @@
if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"email", nil)])
[self sendEmailWith:text andUrl:shortUrl view:view delegate:del gX:gX gY:gY myPosition:myPos];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"message", nil)])
[self sendMessageWith:text andUrl:shortUrl view:view delegate:del myPosition:myPos];
[self sendMessageWithUrl:[shortUrl substringWithRange:NSMakeRange(0, GE0LENGTH)] view:view delegate:del myPosition:myPos];
else if ([[as buttonTitleAtIndex:buttonIndex] isEqualToString:NSLocalizedString(@"copy_link", nil)])
[UIPasteboard generalPasteboard].string = [self generateShortUrlWithName:text scale:scale gX:gX gY:gY];
}
@ -69,7 +71,7 @@
[view presentModalViewController:mailVC animated:YES];
}
+(void)sendMessageWith:(NSString *)textFieldText andUrl:(NSString *)shortUrl view:(id)view delegate:(id)del myPosition:(BOOL)myPos
+(void)sendMessageWithUrl:(NSString *)shortUrl view:(id)view delegate:(id)del myPosition:(BOOL)myPos
{
NSString * httpGe0Url = [shortUrl stringByReplacingCharactersInRange:NSMakeRange(0, 6) withString:@"http://ge0.me/"];
MFMessageComposeViewController * messageVC = [[[MFMessageComposeViewController alloc] init] autorelease];