aboutsummaryrefslogtreecommitdiffhomepage
path: root/example
diff options
context:
space:
mode:
authorGravatar Jonathan Willing <jwilling@me.com>2013-05-14 00:06:48 -0500
committerGravatar Jonathan Willing <jwilling@me.com>2013-05-14 00:06:48 -0500
commita155ec4572cd1af580ea8da7a2c8748fa7002f6a (patch)
treef90843bfbb3d4edcadb3e4ebf2158b495756411b /example
parent3cfd82ac63a6c7c162223404c51eeb7a1c751888 (diff)
don't fetch the message twice
Diffstat (limited to 'example')
-rwxr-xr-xexample/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm10
1 files changed, 8 insertions, 2 deletions
diff --git a/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm b/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm
index aeca9384..b60e91c7 100755
--- a/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm
+++ b/example/ios/iOS UI Test/iOS UI Test/MCTMsgViewController.mm
@@ -188,8 +188,14 @@ typedef void (^DownloadCallback)(NSError * error);
- (NSData *) MCOMessageView:(MCOMessageView *)view dataForPartWithUniqueID:(NSString *)partUniqueID
{
- NSData * data = [_storage objectForKey:partUniqueID];
- return data;
+ if ([[NSUserDefaults standardUserDefaults] boolForKey:@"FetchFullMessageEnabled"]) {
+ MCOAttachment * attachment = (MCOAttachment *) [[_messageView message] partForUniqueID:partUniqueID];
+ return [attachment data];
+ }
+ else {
+ NSData * data = [_storage objectForKey:partUniqueID];
+ return data;
+ }
}
- (void) MCOMessageView:(MCOMessageView *)view fetchDataForPartWithUniqueID:(NSString *)partUniqueID