IOSAD-91 handle attachment disposition
authorDirk Zimmermann <dirk@pep-project.org>
Mon, 16 Apr 2018 11:01:17 +0200
changeset 57535e94ed832d0
parent 574 03a019b2533b
child 576 8f6da9a85634
IOSAD-91 handle attachment disposition
pEpObjCAdapter/PEPMessageUtil.h
pEpObjCAdapter/PEPMessageUtil.m
     1.1 --- a/pEpObjCAdapter/PEPMessageUtil.h	Sat Apr 14 14:19:04 2018 +0200
     1.2 +++ b/pEpObjCAdapter/PEPMessageUtil.h	Mon Apr 16 11:01:17 2018 +0200
     1.3 @@ -107,6 +107,9 @@
     1.4  /** The mime type of an attachment */
     1.5  extern NSString *const _Nonnull kPepMimeType;
     1.6  
     1.7 +/** The content disposition of an attachment */
     1.8 +extern NSString *const _Nonnull kPepContentDisposition;
     1.9 +
    1.10  /** The pEp internal communication type */
    1.11  extern NSString *const _Nonnull kPepCommType;
    1.12  
     2.1 --- a/pEpObjCAdapter/PEPMessageUtil.m	Sat Apr 14 14:19:04 2018 +0200
     2.2 +++ b/pEpObjCAdapter/PEPMessageUtil.m	Mon Apr 16 11:01:17 2018 +0200
     2.3 @@ -62,6 +62,8 @@
     2.4  
     2.5  NSString *const kPepMimeType = @"mimeType";
     2.6  
     2.7 +NSString *const kPepContentDisposition = @"contentDisposition";
     2.8 +
     2.9  NSString *const kPepCommType = @"comm_type";
    2.10  
    2.11  NSString *const kPepRawMessage = @"raw_message";
    2.12 @@ -148,6 +150,8 @@
    2.13          if(_bl->mime_type && _bl->mime_type[0])
    2.14              [blob setObject: [NSString stringWithUTF8String:_bl->mime_type]
    2.15                   forKey:@"mimeType"];
    2.16 +
    2.17 +        [blob setObject:[NSNumber numberWithInt:_bl->disposition] forKey:kPepContentDisposition];
    2.18          
    2.19          [array addObject:blob];
    2.20      }
    2.21 @@ -177,6 +181,11 @@
    2.22          bl = bloblist_add(bl, buf, size,
    2.23                            [blob[@"mimeType"] UTF8String],
    2.24                            [[blob[@"filename"] precomposedStringWithCanonicalMapping] UTF8String]);
    2.25 +
    2.26 +        NSNumber *contentDispositionNum = [blob objectForKey:kPepContentDisposition];
    2.27 +        if (contentDispositionNum) {
    2.28 +            bl->disposition = contentDispositionNum.intValue;
    2.29 +        }
    2.30      }
    2.31      return _bl;
    2.32  }