Merge branch 'charlesmchen/buildWarnings'

This commit is contained in:
Matthew Chen 2018-06-01 12:46:04 -04:00
commit 5f66e1b0f7
35 changed files with 228 additions and 79 deletions

View file

@ -3747,8 +3747,9 @@ typedef enum : NSUInteger {
lastVisibleIndexPath = indexPath;
}
}
if (lastVisibleIndexPath && lastVisibleIndexPath.row >= self.viewItems.count) {
return (self.viewItems.count > 0 ? [NSIndexPath indexPathForRow:self.viewItems.count - 1 inSection:0] : nil);
if (lastVisibleIndexPath && lastVisibleIndexPath.row >= (NSInteger)self.viewItems.count) {
return (self.viewItems.count > 0 ? [NSIndexPath indexPathForRow:(NSInteger)self.viewItems.count - 1 inSection:0]
: nil);
}
return lastVisibleIndexPath;
}

View file

@ -786,6 +786,11 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
}
case OWSMessageCellType_Unknown: {
OWSFail(@"%@ No text to share", self.logTag);
break;
}
case OWSMessageCellType_ContactShare: {
OWSFail(@"%@ share contact not implemented.", self.logTag);
break;
}
}
}
@ -796,6 +801,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
case OWSMessageCellType_Unknown:
case OWSMessageCellType_TextMessage:
case OWSMessageCellType_OversizeTextMessage:
case OWSMessageCellType_ContactShare:
OWSFail(@"No media to share.");
break;
case OWSMessageCellType_StillImage:

View file

@ -116,7 +116,10 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations
_threadViewModelCache = [NSCache new];
// Ensure ExperienceUpgradeFinder has been initialized.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
[ExperienceUpgradeFinder sharedManager];
#pragma GCC diagnostic pop
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(blockedPhoneNumbersDidChange:)

View file

@ -758,13 +758,7 @@ NS_ASSUME_NONNULL_BEGIN
case MessageComposeResultCancelled:
break;
case MessageComposeResultFailed: {
UIAlertView *warningAlert =
[[UIAlertView alloc] initWithTitle:@""
message:NSLocalizedString(@"SEND_INVITE_FAILURE", @"")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"")
otherButtonTitles:nil];
[warningAlert show];
[OWSAlerts showErrorAlertWithMessage:NSLocalizedString(@"SEND_INVITE_FAILURE", @"")];
break;
}
case MessageComposeResultSent: {
@ -772,13 +766,8 @@ NS_ASSUME_NONNULL_BEGIN
completion:^{
DDLogDebug(@"view controller dismissed");
}];
UIAlertView *successAlert = [[UIAlertView alloc]
initWithTitle:@""
message:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded")
delegate:nil
cancelButtonTitle:NSLocalizedString(@"OK", @"")
otherButtonTitles:nil];
[successAlert show];
[OWSAlerts
showAlertWithTitle:NSLocalizedString(@"SEND_INVITE_SUCCESS", @"Alert body after invite succeeded")];
break;
}
default:

View file

@ -27,7 +27,7 @@ import SignalMessaging
/**
* |handle| is a user formatted phone number, e.g. from a system contacts entry
*/
@objc public func initiateCall(handle: String) -> Bool {
@discardableResult @objc public func initiateCall(handle: String) -> Bool {
Logger.info("\(TAG) in \(#function) with handle: \(handle)")
guard let recipientId = PhoneNumber(fromE164: handle)?.toE164() else {
@ -41,7 +41,7 @@ import SignalMessaging
/**
* |recipientId| is a e164 formatted phone number.
*/
@objc public func initiateCall(recipientId: String,
@discardableResult @objc public func initiateCall(recipientId: String,
isVideo: Bool) -> Bool {
// Rather than an init-assigned dependency property, we access `callUIAdapter` via Environment
// because it can change after app launch due to user settings

View file

@ -112,13 +112,19 @@ NSString *const Signal_Message_MarkAsRead_Identifier = @"Signal_Message_MarkAsRe
DDLogInfo(@"%@ received remote notification", self.logTag);
[AppReadiness runNowOrWhenAppIsReady:^{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
[self.messageFetcherJob run];
#pragma GCC diagnostic pop
}];
}
- (void)applicationDidBecomeActive {
[AppReadiness runNowOrWhenAppIsReady:^{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-result"
[self.messageFetcherJob run];
#pragma GCC diagnostic pop
}];
}

View file

@ -39,7 +39,7 @@ extension String {
}
extension SignalAttachmentError: LocalizedError {
public var errorDescription: String {
public var errorDescription: String? {
switch self {
case .missingData:
return NSLocalizedString("ATTACHMENT_ERROR_MISSING_DATA", comment: "Attachment error message for attachments without any data")
@ -222,13 +222,21 @@ public class SignalAttachment: NSObject {
owsFail("\(logTag) Missing error")
return nil
}
guard let errorDescription = error.errorDescription else {
owsFail("\(logTag) Missing error description")
return nil
}
return "\(error.errorDescription)"
return "\(errorDescription)"
}
@objc
public class var missingDataErrorMessage: String {
return SignalAttachmentError.missingData.errorDescription
guard let errorDescription = SignalAttachmentError.missingData.errorDescription else {
owsFail("\(logTag) Missing error description")
return ""
}
return errorDescription
}
@objc

View file

@ -19,7 +19,6 @@
#import <SignalServiceKit/PhoneNumber.h>
#import <SignalServiceKit/SignalAccount.h>
@import AddressBook;
@import Contacts;
NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
@ -570,9 +569,9 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
NSDictionary<NSString *, id> *normalFontAttributes =
@{ NSFontAttributeName : font, NSForegroundColorAttributeName : [UIColor ows_darkGrayColor] };
NSDictionary<NSString *, id> *firstNameAttributes
= (ABPersonGetSortOrdering() == kABPersonSortByFirstName ? boldFontAttributes : normalFontAttributes);
= (self.shouldSortByGivenName ? boldFontAttributes : normalFontAttributes);
NSDictionary<NSString *, id> *lastNameAttributes
= (ABPersonGetSortOrdering() == kABPersonSortByFirstName ? normalFontAttributes : boldFontAttributes);
= (self.shouldSortByGivenName ? normalFontAttributes : boldFontAttributes);
NSString *cachedFirstName = [self cachedFirstNameForRecipientId:recipientId];
NSString *cachedLastName = [self cachedLastNameForRecipientId:recipientId];
@ -585,8 +584,20 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
NSAttributedString *lastName =
[[NSAttributedString alloc] initWithString:cachedLastName attributes:lastNameAttributes];
CNContact *_Nullable cnContact = self.allContactsMap[recipientId].cnContact;
if (!cnContact) {
// If we don't have a CNContact for this recipient id, make one.
// Presumably [CNContactFormatter nameOrderForContact:] tries
// to localizes its result based on the languages/scripts used
// in the contact's fields.
CNMutableContact *formatContact = [CNMutableContact new];
formatContact.givenName = firstName.string;
formatContact.familyName = lastName.string;
cnContact = formatContact;
}
CNContactDisplayNameOrder nameOrder = [CNContactFormatter nameOrderForContact:cnContact];
NSAttributedString *_Nullable leftName, *_Nullable rightName;
if (ABPersonGetCompositeNameFormat() == kABPersonCompositeNameFormatFirstNameFirst) {
if (nameOrder == CNContactDisplayNameOrderGivenNameFirst) {
leftName = firstName;
rightName = lastName;
} else {
@ -812,11 +823,16 @@ NSString *const OWSContactsManagerSignalAccountsDidChangeNotification
};
}
- (BOOL)shouldSortByGivenName
{
return [[CNContactsUserDefaults sharedDefaults] sortOrder] == CNContactSortOrderGivenName;
}
- (NSString *)comparableNameForSignalAccount:(SignalAccount *)signalAccount
{
NSString *_Nullable name;
if (signalAccount.contact) {
if (ABPersonGetSortOrdering() == kABPersonSortByFirstName) {
if (self.shouldSortByGivenName) {
name = signalAccount.contact.comparableNameFirstLast;
} else {
name = signalAccount.contact.comparableNameLastFirst;

View file

@ -185,7 +185,7 @@ public class SystemContactsFetcher: NSObject {
* where we might need contact access, but will ensure we don't wastefully reload contacts
* if we have already fetched contacts.
*
* @param completion completion handler is called on main thread.
* @param completionParam completion handler is called on main thread.
*/
@objc
public func requestOnce(completion completionParam: ((Error?) -> Void)?) {

View file

@ -1,9 +1,10 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSGroupAvatarBuilder.h"
#import "TSGroupThread.h"
NS_ASSUME_NONNULL_BEGIN
@interface OWSGroupAvatarBuilder ()

View file

@ -27,6 +27,8 @@ NS_ASSUME_NONNULL_BEGIN
@end
#pragma mark -
@implementation TSThread
+ (NSString *)collection {

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -8,7 +8,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSBlockedPhoneNumbersMessage : OWSOutgoingSyncMessage
- (instancetype)initWithPhoneNumbers:(NSArray<NSString *> *)phoneNumbers;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithPhoneNumbers:(NSArray<NSString *> *)phoneNumbers NS_DESIGNATED_INITIALIZER;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -10,7 +10,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSReadReceiptsForLinkedDevicesMessage : OWSOutgoingSyncMessage
- (instancetype)initWithReadReceipts:(NSArray<OWSLinkedDeviceReadReceipt *> *)readReceipts;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithReadReceipts:(NSArray<OWSLinkedDeviceReadReceipt *> *)readReceipts NS_DESIGNATED_INITIALIZER;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -10,6 +10,17 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSReadReceiptsForSenderMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithThread:(nullable TSThread *)thread messageTimestamps:(NSArray<NSNumber *> *)messageTimestamps;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -9,9 +9,11 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSVerificationStateSyncMessage : OWSOutgoingSyncMessage
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithVerificationState:(OWSVerificationState)verificationState
identityKey:(NSData *)identityKey
verificationForRecipientId:(NSString *)recipientId;
verificationForRecipientId:(NSString *)recipientId NS_DESIGNATED_INITIALIZER;
// This is a clunky name, but we want to differentiate it from `recipientIdentifier` inherited from `TSOutgoingMessage`
@property (nonatomic, readonly) NSString *verificationForRecipientId;

View file

@ -1,4 +1,6 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -12,7 +14,9 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface OWSOutgoingSentMessageTranscript : OWSOutgoingSyncMessage
- (instancetype)initWithOutgoingMessage:(TSOutgoingMessage *)message;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithOutgoingMessage:(TSOutgoingMessage *)message NS_DESIGNATED_INITIALIZER;
@end

View file

@ -1,4 +1,6 @@
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSOutgoingMessage.h"
@ -11,6 +13,19 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface OWSOutgoingSyncMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END

View file

@ -12,6 +12,16 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSOutgoingSyncMessage
- (instancetype)initWithCoder:(NSCoder *)coder
{
self = [super initWithCoder:coder];
if (self) {
}
return self;
}
- (instancetype)init
{
self = [super initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp]

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -8,7 +8,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSSyncConfigurationMessage : OWSOutgoingSyncMessage
- (instancetype)initWithReadReceiptsEnabled:(BOOL)readReceiptsEnabled;
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithReadReceiptsEnabled:(BOOL)readReceiptsEnabled NS_DESIGNATED_INITIALIZER;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -7,14 +7,17 @@
NS_ASSUME_NONNULL_BEGIN
@protocol ProfileManagerProtocol;
@class SignalAccount;
@class OWSIdentityManager;
@class SignalAccount;
@interface OWSSyncContactsMessage : OWSOutgoingSyncMessage
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithSignalAccounts:(NSArray<SignalAccount *> *)signalAccounts
identityManager:(OWSIdentityManager *)identityManager
profileManager:(id<ProfileManagerProtocol>)profileManager;
profileManager:(id<ProfileManagerProtocol>)profileManager NS_DESIGNATED_INITIALIZER;
- (NSData *)buildPlainTextAttachmentData;

View file

@ -30,16 +30,7 @@ NS_ASSUME_NONNULL_BEGIN
identityManager:(OWSIdentityManager *)identityManager
profileManager:(id<ProfileManagerProtocol>)profileManager
{
self = [super initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp]
inThread:nil
messageBody:nil
attachmentIds:[NSMutableArray new]
expiresInSeconds:0
expireStartedAt:0
isVoiceMessage:NO
groupMetaMessage:TSGroupMessageUnspecified
quotedMessage:nil
contactShare:nil];
self = [super init];
if (!self) {
return self;
}

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -10,6 +10,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSSyncGroupsMessage : OWSOutgoingSyncMessage
- (instancetype)init NS_DESIGNATED_INITIALIZER;
- (NSData *)buildPlainTextAttachmentDataWithTransaction:(YapDatabaseReadTransaction *)transaction;
@end

View file

@ -17,16 +17,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init
{
return [super initOutgoingMessageWithTimestamp:[NSDate ows_millisecondTimeStamp]
inThread:nil
messageBody:nil
attachmentIds:[NSMutableArray new]
expiresInSeconds:0
expireStartedAt:0
isVoiceMessage:NO
groupMetaMessage:TSGroupMessageUnspecified
quotedMessage:nil
contactShare:nil];
return [super init];
}
- (OWSSignalServiceProtosSyncMessageBuilder *)syncMessageBuilder

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "OWSOutgoingSyncMessage.h"
@ -8,7 +8,16 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSSyncGroupsRequestMessage : TSOutgoingMessage
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithThread:(nullable TSThread *)thread groupId:(NSData *)groupId;

View file

@ -495,7 +495,7 @@ NSString *NSStringForContactAddressType(OWSContactAddressType value)
NSData *imageData = UIImageJPEGRepresentation(image, (CGFloat)0.9);
TSAttachmentStream *attachmentStream = [[TSAttachmentStream alloc] initWithContentType:OWSMimeTypeImageJpeg
byteCount:imageData.length
byteCount:(UInt32)imageData.length
sourceFilename:nil];
NSError *error;

View file

@ -1,5 +1,6 @@
// Created by Michael Kirk on 9/25/16.
// Copyright © 2016 Open Whisper Systems. All rights reserved.
//
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSOutgoingMessage.h"
@ -9,6 +10,17 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSDisappearingMessagesConfigurationMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithConfiguration:(OWSDisappearingMessagesConfiguration *)configuration thread:(TSThread *)thread;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSOutgoingMessage.h"
@ -13,6 +13,17 @@ typedef NSData *_Nonnull (^DynamicOutgoingMessageBlock)(SignalRecipient *);
@interface OWSDynamicOutgoingMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithPlainTextDataBlock:(DynamicOutgoingMessageBlock)block thread:(nullable TSThread *)thread;
- (instancetype)initWithPlainTextDataBlock:(DynamicOutgoingMessageBlock)block
timestamp:(uint64_t)timestamp

View file

@ -9,6 +9,17 @@ NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(EndSessionMessage)
@interface OWSEndSessionMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread NS_DESIGNATED_INITIALIZER;
@end

View file

@ -9,6 +9,11 @@ NS_ASSUME_NONNULL_BEGIN
@implementation OWSEndSessionMessage
- (instancetype)initWithCoder:(NSCoder *)coder
{
return [super initWithCoder:coder];
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread
{
return [super initOutgoingMessageWithTimestamp:timestamp

View file

@ -705,7 +705,7 @@ NS_ASSUME_NONNULL_BEGIN
} else if (syncMessage.hasBlocked) {
NSArray<NSString *> *blockedPhoneNumbers = [syncMessage.blocked.numbers copy];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
[_blockingManager setBlockedPhoneNumbers:blockedPhoneNumbers sendSyncMessage:NO];
[self.blockingManager setBlockedPhoneNumbers:blockedPhoneNumbers sendSyncMessage:NO];
});
} else if (syncMessage.read.count > 0) {
DDLogInfo(@"%@ Received %ld read receipt(s)", self.logTag, (u_long)syncMessage.read.count);

View file

@ -1,17 +1,16 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSOutgoingMessage.h"
NS_ASSUME_NONNULL_BEGIN
@class OWSCallOfferMessage;
@class OWSCallAnswerMessage;
@class OWSCallIceUpdateMessage;
@class OWSCallHangupMessage;
@class OWSCallBusyMessage;
@class OWSCallHangupMessage;
@class OWSCallIceUpdateMessage;
@class OWSCallOfferMessage;
@class TSThread;
/**
@ -19,6 +18,17 @@ NS_ASSUME_NONNULL_BEGIN
*/
@interface OWSOutgoingCallMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithThread:(TSThread *)thread offerMessage:(OWSCallOfferMessage *)offerMessage;
- (instancetype)initWithThread:(TSThread *)thread answerMessage:(OWSCallAnswerMessage *)answerMessage;
- (instancetype)initWithThread:(TSThread *)thread iceUpdateMessage:(OWSCallIceUpdateMessage *)iceUpdateMessage;

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "TSOutgoingMessage.h"
@ -11,6 +11,17 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSOutgoingNullMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithContactThread:(TSContactThread *)contactThread
verificationStateSyncMessage:(OWSVerificationStateSyncMessage *)verificationStateSyncMessage;

View file

@ -8,6 +8,17 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSProfileKeyMessage : TSOutgoingMessage
- (instancetype)initOutgoingMessageWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSMutableArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt
isVoiceMessage:(BOOL)isVoiceMessage
groupMetaMessage:(TSGroupMetaMessage)groupMetaMessage
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
contactShare:(nullable OWSContact *)contactShare NS_UNAVAILABLE;
- (instancetype)initWithTimestamp:(uint64_t)timestamp inThread:(nullable TSThread *)thread NS_DESIGNATED_INITIALIZER;
@end

View file

@ -1,5 +1,5 @@
//
// Copyright (c) 2017 Open Whisper Systems. All rights reserved.
// Copyright (c) 2018 Open Whisper Systems. All rights reserved.
//
#import "SecurityUtils.h"
@ -9,7 +9,7 @@
+ (NSData *)generateRandomBytes:(NSUInteger)length
{
return [Randomness generateRandomBytes:length];
return [Randomness generateRandomBytes:(int)length];
}
@end

View file

@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface OWSMediaGalleryFinder : NSObject
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithThread:(TSThread *)thread NS_DESIGNATED_INITIALIZER;
// How many media items a thread has