session-ios/SignalMessaging/Models/OWSContactOffersInteraction.m
Michael Kirk a58f1f385c Share a photo from photos app
Shows the conversation picker, and sends the attachment to that
conversation.

There's still a lot TODO

-[ ] resolve JSQ dependency
-[ ] properly wait for app to load
-[ ] dismiss share extension after send is complete
-[ ] support non jpeg file types
-[ ] Fix device sleep manager

// FREEBIE
2017-12-07 10:13:06 -05:00

57 lines
1.3 KiB
Objective-C

//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
//
#import "OWSContactOffersInteraction.h"
NS_ASSUME_NONNULL_BEGIN
@implementation OWSContactOffersInteraction
- (instancetype)initWithCoder:(NSCoder *)coder
{
return [super initWithCoder:coder];
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
thread:(TSThread *)thread
hasBlockOffer:(BOOL)hasBlockOffer
hasAddToContactsOffer:(BOOL)hasAddToContactsOffer
hasAddToProfileWhitelistOffer:(BOOL)hasAddToProfileWhitelistOffer
recipientId:(NSString *)recipientId
{
self = [super initWithTimestamp:timestamp inThread:thread];
if (!self) {
return self;
}
_hasBlockOffer = hasBlockOffer;
_hasAddToContactsOffer = hasAddToContactsOffer;
_hasAddToProfileWhitelistOffer = hasAddToProfileWhitelistOffer;
OWSAssert(recipientId.length > 0);
_recipientId = recipientId;
return self;
}
- (BOOL)shouldUseReceiptDateForSorting
{
// 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;
}
- (BOOL)isDynamicInteraction
{
return YES;
}
- (OWSInteractionType)interactionType
{
return OWSInteractionType_Offer;
}
@end
NS_ASSUME_NONNULL_END