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.
		
		
		
		
		
			
		
			
	
	
		
			58 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Matlab
		
	
		
		
			
		
	
	
			58 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Matlab
		
	
| 
											9 years ago
										 | // | ||
|  | //  Copyright (c) 2017 Open Whisper Systems. All rights reserved. | ||
|  | // | ||
|  | 
 | ||
| 
											8 years ago
										 | #import "OWSContactOffersInteraction.h" | ||
| 
											9 years ago
										 | 
 | ||
|  | NS_ASSUME_NONNULL_BEGIN | ||
|  | 
 | ||
| 
											8 years ago
										 | @implementation OWSContactOffersInteraction | ||
| 
											9 years ago
										 | 
 | ||
|  | - (instancetype)initWithCoder:(NSCoder *)coder | ||
|  | { | ||
|  |     return [super initWithCoder:coder]; | ||
|  | } | ||
|  | 
 | ||
| 
											8 years ago
										 | - (instancetype)initWithTimestamp:(uint64_t)timestamp | ||
|  |                            thread:(TSThread *)thread | ||
|  |                     hasBlockOffer:(BOOL)hasBlockOffer | ||
|  |             hasAddToContactsOffer:(BOOL)hasAddToContactsOffer | ||
|  |     hasAddToProfileWhitelistOffer:(BOOL)hasAddToProfileWhitelistOffer | ||
| 
											8 years ago
										 |                       recipientId:(NSString *)recipientId | ||
| 
											9 years ago
										 | { | ||
| 
											9 years ago
										 |     self = [super initWithTimestamp:timestamp inThread:thread]; | ||
| 
											9 years ago
										 | 
 | ||
|  |     if (!self) { | ||
|  |         return self; | ||
|  |     } | ||
|  | 
 | ||
| 
											8 years ago
										 |     _hasBlockOffer = hasBlockOffer; | ||
|  |     _hasAddToContactsOffer = hasAddToContactsOffer; | ||
|  |     _hasAddToProfileWhitelistOffer = hasAddToProfileWhitelistOffer; | ||
| 
											8 years ago
										 |     OWSAssert(recipientId.length > 0); | ||
|  |     _recipientId = recipientId; | ||
| 
											9 years ago
										 | 
 | ||
| 
											9 years ago
										 |     return self; | ||
|  | } | ||
|  | 
 | ||
| 
											9 years ago
										 | - (BOOL)shouldUseReceiptDateForSorting | ||
| 
											9 years ago
										 | { | ||
| 
											9 years ago
										 |     // Use the timestamp, not the "received at" timestamp to sort, | ||
|  |     // since we're creating these interactions after the fact and back-dating them. | ||
|  |     return NO; | ||
| 
											9 years ago
										 | } | ||
|  | 
 | ||
| 
											9 years ago
										 | - (BOOL)isDynamicInteraction | ||
|  | { | ||
|  |     return YES; | ||
|  | } | ||
|  | 
 | ||
| 
											8 years ago
										 | - (OWSInteractionType)interactionType | ||
|  | { | ||
|  |     return OWSInteractionType_Offer; | ||
|  | } | ||
|  | 
 | ||
| 
											9 years ago
										 | @end | ||
|  | 
 | ||
|  | NS_ASSUME_NONNULL_END |