session-ios/src/Messages/OWSMessageServiceParams.m
Michael Kirk fe7171dd93 Sync messages with your other devices
After provisioning a desktop client, you'll see messages sent from your
phone appear on your desktop client, and messages sent from the desktop
client appear on your phone.

* In the process extracted some of the Attachment processing logic out
  of the giant MessagesManager.
* Some nullability annotations on affected files.

// FREEBIE
2016-09-02 12:28:58 -04:00

37 lines
890 B
Objective-C

// Created by Frederic Jacobs on 18/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
#import "OWSMessageServiceParams.h"
#import "NSData+Base64.h"
#import "TSConstants.h"
@implementation OWSMessageServiceParams
+ (NSDictionary *)JSONKeyPathsByPropertyKey
{
return [NSDictionary mtl_identityPropertyMapWithModel:[self class]];
}
- (instancetype)initWithType:(TSWhisperMessageType)type
recipientId:(NSString *)destination
device:(int)deviceId
content:(NSData *)content
registrationId:(int)registrationId
{
self = [super init];
if (!self) {
return self;
}
_type = type;
_destination = destination;
_destinationDeviceId = deviceId;
_destinationRegistrationId = registrationId;
_content = [content base64EncodedString];
return self;
}
@end