Browse Source

IOSAD-191 Refactor some code.

IOSAD-191
David Alarcon 1 year ago
parent
commit
8be1e71ce2
4 changed files with 53 additions and 53 deletions
  1. +11
    -11
      PEPObjCAdapterTypes/src/PEPAttachment+SecureCoding.m
  2. +17
    -17
      PEPObjCAdapterTypes/src/PEPIdentity+SecureCoding.m
  3. +6
    -6
      PEPObjCAdapterTypes/src/PEPLanguage+SecureCoding.m
  4. +19
    -19
      PEPObjCAdapterTypes/src/PEPMessage+SecureCoding.m

+ 11
- 11
PEPObjCAdapterTypes/src/PEPAttachment+SecureCoding.m View File

@ -12,26 +12,26 @@
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder {
if (self = [self init]) {
self.data = [decoder decodeObjectOfClass:[NSData class] forKey:@"data"];
self.size = [decoder decodeIntegerForKey:@"size"];
self.mimeType = [decoder decodeObjectOfClass:[NSString class] forKey:@"mimeType"];
self.filename = [decoder decodeObjectOfClass:[NSString class] forKey:@"filename"];
self.contentDisposition = [decoder decodeIntForKey:@"contentDisposition"];
self.data = [decoder decodeObjectOfClass:[NSData class] forKey:@"data"];
self.size = [decoder decodeIntegerForKey:@"size"];
self.mimeType = [decoder decodeObjectOfClass:[NSString class] forKey:@"mimeType"];
self.filename = [decoder decodeObjectOfClass:[NSString class] forKey:@"filename"];
self.contentDisposition = [decoder decodeIntForKey:@"contentDisposition"];
}
return self;
}
- (void)encodeWithCoder:(nonnull NSCoder *)coder {
[coder encodeObject:self.data forKey:@"data"];
[coder encodeInteger:self.size forKey:@"size"];
[coder encodeObject:self.mimeType forKey:@"mimeType"];
[coder encodeObject:self.filename forKey:@"filename"];
[coder encodeInt:self.contentDisposition forKey:@"contentDisposition"];
[coder encodeObject:self.data forKey:@"data"];
[coder encodeInteger:self.size forKey:@"size"];
[coder encodeObject:self.mimeType forKey:@"mimeType"];
[coder encodeObject:self.filename forKey:@"filename"];
[coder encodeInt:self.contentDisposition forKey:@"contentDisposition"];
}
+ (BOOL)supportsSecureCoding {
return YES;
return YES;
}
@end

+ 17
- 17
PEPObjCAdapterTypes/src/PEPIdentity+SecureCoding.m View File

@ -12,32 +12,32 @@
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder {
if (self = [self init]) {
self.address = [decoder decodeObjectOfClass:[NSString class] forKey:@"address"];
self.userID = [decoder decodeObjectOfClass:[NSString class] forKey:@"userID"];
self.userName = [decoder decodeObjectOfClass:[NSString class] forKey:@"userName"];
self.fingerPrint = [decoder decodeObjectOfClass:[NSString class] forKey:@"fingerPrint"];
self.language = [decoder decodeObjectOfClass:[NSString class] forKey:@"language"];
self.commType = [decoder decodeIntForKey:@"commType"];
self.isOwn = [decoder decodeBoolForKey:@"isOwn"];
self.flags = [decoder decodeIntForKey:@"flags"];
self.address = [decoder decodeObjectOfClass:[NSString class] forKey:@"address"];
self.userID = [decoder decodeObjectOfClass:[NSString class] forKey:@"userID"];
self.userName = [decoder decodeObjectOfClass:[NSString class] forKey:@"userName"];
self.fingerPrint = [decoder decodeObjectOfClass:[NSString class] forKey:@"fingerPrint"];
self.language = [decoder decodeObjectOfClass:[NSString class] forKey:@"language"];
self.commType = [decoder decodeIntForKey:@"commType"];
self.isOwn = [decoder decodeBoolForKey:@"isOwn"];
self.flags = [decoder decodeIntForKey:@"flags"];
}
return self;
}
- (void)encodeWithCoder:(nonnull NSCoder *)coder {
[coder encodeObject:self.address forKey:@"address"];
[coder encodeObject:self.userID forKey:@"userID"];
[coder encodeObject:self.userName forKey:@"userName"];
[coder encodeObject:self.fingerPrint forKey:@"fingerPrint"];
[coder encodeObject:self.language forKey:@"language"];
[coder encodeInt:self.commType forKey:@"commType"];
[coder encodeBool:self.isOwn forKey:@"isOwn"];
[coder encodeInt:self.flags forKey:@"flags"];
[coder encodeObject:self.address forKey:@"address"];
[coder encodeObject:self.userID forKey:@"userID"];
[coder encodeObject:self.userName forKey:@"userName"];
[coder encodeObject:self.fingerPrint forKey:@"fingerPrint"];
[coder encodeObject:self.language forKey:@"language"];
[coder encodeInt:self.commType forKey:@"commType"];
[coder encodeBool:self.isOwn forKey:@"isOwn"];
[coder encodeInt:self.flags forKey:@"flags"];
}
+ (BOOL)supportsSecureCoding {
return YES;
return YES;
}
@end

+ 6
- 6
PEPObjCAdapterTypes/src/PEPLanguage+SecureCoding.m View File

@ -12,8 +12,8 @@
- (nullable instancetype)initWithCoder:(nonnull NSCoder *)decoder {
if (self = [self init]) {
self.code = [decoder decodeObjectOfClass:[NSString class] forKey:@"code"];
self.name = [decoder decodeObjectOfClass:[NSString class] forKey:@"name"];
self.code = [decoder decodeObjectOfClass:[NSString class] forKey:@"code"];
self.name = [decoder decodeObjectOfClass:[NSString class] forKey:@"name"];
self.sentence = [decoder decodeObjectOfClass:[NSString class] forKey:@"sentence"];
}
@ -21,13 +21,13 @@
}
- (void)encodeWithCoder:(nonnull NSCoder *)coder {
[coder encodeObject:self.code forKey:@"code"];
[coder encodeObject:self.name forKey:@"name"];
[coder encodeObject:self.sentence forKey:@"sentence"];
[coder encodeObject:self.code forKey:@"code"];
[coder encodeObject:self.name forKey:@"name"];
[coder encodeObject:self.sentence forKey:@"sentence"];
}
+ (BOOL)supportsSecureCoding {
return YES;
return YES;
}
@end

+ 19
- 19
PEPObjCAdapterTypes/src/PEPMessage+SecureCoding.m View File

@ -51,34 +51,34 @@
}
- (void)encodeWithCoder:(nonnull NSCoder *)coder {
[coder encodeObject:self.messageID forKey:@"messageID"];
[coder encodeObject:self.messageID forKey:@"messageID"];
[coder encodeObject:self.from forKey:@"from"];
[coder encodeObject:self.to forKey:@"to"];
[coder encodeObject:self.cc forKey:@"cc"];
[coder encodeObject:self.bcc forKey:@"bcc"];
[coder encodeObject:self.from forKey:@"from"];
[coder encodeObject:self.to forKey:@"to"];
[coder encodeObject:self.cc forKey:@"cc"];
[coder encodeObject:self.bcc forKey:@"bcc"];
[coder encodeObject:self.shortMessage forKey:@"shortMessage"];
[coder encodeObject:self.longMessage forKey:@"longMessage"];
[coder encodeObject:self.longMessageFormatted forKey:@"longMessageFormatted"];
[coder encodeObject:self.shortMessage forKey:@"shortMessage"];
[coder encodeObject:self.longMessage forKey:@"longMessage"];
[coder encodeObject:self.longMessageFormatted forKey:@"longMessageFormatted"];
[coder encodeObject:self.replyTo forKey:@"replyTo"];
[coder encodeObject:self.inReplyTo forKey:@"inReplyTo"];
[coder encodeObject:self.references forKey:@"references"];
[coder encodeObject:self.replyTo forKey:@"replyTo"];
[coder encodeObject:self.inReplyTo forKey:@"inReplyTo"];
[coder encodeObject:self.references forKey:@"references"];
[coder encodeObject:self.sentDate forKey:@"sentDate"];
[coder encodeObject:self.receivedDate forKey:@"receivedDate"];
[coder encodeObject:self.sentDate forKey:@"sentDate"];
[coder encodeObject:self.receivedDate forKey:@"receivedDate"];
[coder encodeObject:self.attachments forKey:@"attachments"];
[coder encodeObject:self.attachments forKey:@"attachments"];
[coder encodeObject:self.optionalFields forKey:@"optionalFields"];
[coder encodeObject:self.keywords forKey:@"keywords"];
[coder encodeObject:self.receivedBy forKey:@"receivedBy"];
[coder encodeInt:self.direction forKey:@"direction"];
[coder encodeObject:self.optionalFields forKey:@"optionalFields"];
[coder encodeObject:self.keywords forKey:@"keywords"];
[coder encodeObject:self.receivedBy forKey:@"receivedBy"];
[coder encodeInt:self.direction forKey:@"direction"];
}
+ (BOOL)supportsSecureCoding {
return YES;
return YES;
}
@end

Loading…
Cancel
Save