mirror of https://github.com/oxen-io/session-ios
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
Matlab
50 lines
1.1 KiB
Matlab
5 years ago
|
//
|
||
|
// Copyright (c) 2019 Open Whisper Systems. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "OWSMessageServiceParams.h"
|
||
|
#import "TSConstants.h"
|
||
|
#import <SessionProtocolKit/NSData+OWS.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
@implementation OWSMessageServiceParams
|
||
|
|
||
|
+ (NSDictionary *)JSONKeyPathsByPropertyKey
|
||
|
{
|
||
|
return [NSDictionary mtl_identityPropertyMapWithModel:[self class]];
|
||
|
}
|
||
|
|
||
|
- (instancetype)initWithType:(TSWhisperMessageType)type
|
||
|
recipientId:(NSString *)destination
|
||
|
device:(int)deviceId
|
||
|
content:(NSData *)content
|
||
|
isSilent:(BOOL)isSilent
|
||
|
isOnline:(BOOL)isOnline
|
||
|
registrationId:(int)registrationId
|
||
|
ttl:(uint)ttl
|
||
|
isPing:(BOOL)isPing
|
||
|
{
|
||
|
self = [super init];
|
||
|
|
||
|
if (!self) {
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
_type = type;
|
||
|
_destination = destination;
|
||
|
_destinationDeviceId = deviceId;
|
||
|
_destinationRegistrationId = registrationId;
|
||
|
_content = [content base64EncodedString];
|
||
|
_silent = isSilent;
|
||
|
_online = isOnline;
|
||
|
_ttl = ttl;
|
||
|
_isPing = isPing;
|
||
|
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|