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.
session-ios/src/Messages/Interactions/TSIncomingMessage.m

67 lines
2.0 KiB
Matlab

10 years ago
// Created by Frederic Jacobs on 15/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
#import "TSIncomingMessage.h"
#import "TSContactThread.h"
#import "TSGroupThread.h"
10 years ago
NS_ASSUME_NONNULL_BEGIN
10 years ago
@implementation TSIncomingMessage
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSContactThread *)thread
messageBody:(nullable NSString *)body
{
return [super initWithTimestamp:timestamp inThread:thread messageBody:body attachmentIds:@[]];
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSContactThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
{
self = [super initWithTimestamp:timestamp inThread:thread messageBody:body attachmentIds:attachmentIds];
10 years ago
if (!self) {
return self;
10 years ago
}
_authorId = nil;
_read = NO;
_receivedAt = [NSDate date];
10 years ago
return self;
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSGroupThread *)thread
authorId:(nullable NSString *)authorId
messageBody:(nullable NSString *)body
{
return [self initWithTimestamp:timestamp inThread:thread authorId:authorId messageBody:body attachmentIds:@[]];
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSGroupThread *)thread
authorId:(nullable NSString *)authorId
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
{
self = [super initWithTimestamp:timestamp inThread:thread messageBody:body attachmentIds:attachmentIds];
10 years ago
if (!self) {
return self;
10 years ago
}
_authorId = authorId;
_read = NO;
_receivedAt = [NSDate date];
10 years ago
return self;
}
@end
NS_ASSUME_NONNULL_END