session-ios/Signal/src/textsecure/Messages/TSIncomingMessage.h
Frederic Jacobs 7aad5c5971 Fixing UX issue with unsynchronized clocks.
TextSecure messages don’t get assigned a timestamp by the server. All
of it is done end-to-end between both clients. A client could have a
misconfigured clock or might want to forge a timestamp. Therefore, we
address this issue by introducing a new receivedAt timestamp for
incoming messages that will be used to sort the messages.
2015-02-28 15:27:56 +01:00

52 lines
1.6 KiB
Objective-C

//
// TSIncomingMessage.h
// TextSecureKit
//
// Created by Frederic Jacobs on 15/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import "TSMessage.h"
@interface TSIncomingMessage : TSMessage
/**
* Initiates an incoming message
*
* @param timestamp timestamp of the message in milliseconds since epoch
* @param thread thread to which the message belongs
* @param body body of the message
* @param attachments attachments of the message
*
* @return initiated incoming message
*/
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSContactThread*)thread
messageBody:(NSString*)body
attachments:(NSArray*)attachments;
/**
* Initiates an incoming group message
*
* @param timestamp timestamp of the message in milliseconds since epoch
* @param thread thread to which the message belongs
* @param authorId author identifier of the user in the group that sent the message
* @param body body of the message
* @param attachments attachments of the message
*
* @return initiated incoming group message
*/
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSGroupThread*)thread
authorId:(NSString*)authorId
messageBody:(NSString*)body
attachments:(NSArray*)attachments;
@property (nonatomic, readonly) NSString *authorId;
@property (nonatomic, getter = wasRead) BOOL read;
@property (nonatomic, readonly) NSDate *receivedAt;
@end