Add some nullability annotations (#62)

* fix compiler warnings about info message initializers

// FREEBIE
pull/1/head
Michael Kirk 9 years ago committed by GitHub
parent b0343ee1d1
commit 725153307e

@ -8,7 +8,7 @@
Pod::Spec.new do |s|
s.name = "SignalServiceKit"
s.version = "0.5.2"
s.version = "0.5.3"
s.summary = "An Objective-C library for communicating with the Signal messaging service."
s.description = <<-DESC

@ -1,13 +1,10 @@
//
// TSInfoMessage.h
// TextSecureKit
//
// Created by Frederic Jacobs on 15/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import "TSMessage.h"
NS_ASSUME_NONNULL_BEGIN
@interface TSInfoMessage : TSMessage
typedef NS_ENUM(NSInteger, TSInfoMessageType) {
@ -25,6 +22,8 @@ typedef NS_ENUM(NSInteger, TSInfoMessageType) {
@property TSInfoMessageType messageType;
@property NSString *customMessage;
- (instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)contact
messageType:(TSInfoMessageType)infoMessage NS_DESIGNATED_INITIALIZER;
@ -32,6 +31,15 @@ typedef NS_ENUM(NSInteger, TSInfoMessageType) {
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
messageType:(TSInfoMessageType)infoMessage
customMessage:(NSString *)customMessage NS_DESIGNATED_INITIALIZER;
customMessage:(NSString *)customMessage;
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(nullable TSThread *)thread
messageBody:(nullable NSString *)body
attachmentIds:(NSArray<NSString *> *)attachmentIds
expiresInSeconds:(uint32_t)expiresInSeconds
expireStartedAt:(uint64_t)expireStartedAt NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

@ -1,21 +1,28 @@
//
// TSInfoMessage.m
// TextSecureKit
//
// Created by Frederic Jacobs on 15/11/14.
// Copyright (c) 2014 Open Whisper Systems. All rights reserved.
//
#import "NSDate+millisecondTimeStamp.h"
#import "TSInfoMessage.h"
NS_ASSUME_NONNULL_BEGIN
@implementation TSInfoMessage
- (instancetype)initWithCoder:(NSCoder *)coder
{
return [super initWithCoder:coder];
}
- (instancetype)initWithTimestamp:(uint64_t)timestamp
inThread:(TSThread *)thread
messageType:(TSInfoMessageType)infoMessage
{
self = [super initWithTimestamp:timestamp inThread:thread];
self = [super initWithTimestamp:timestamp
inThread:thread
messageBody:nil
attachmentIds:@[]
expiresInSeconds:0
expireStartedAt:0];
if (!self) {
return self;
@ -64,3 +71,5 @@
}
@end
NS_ASSUME_NONNULL_END

@ -31,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
- (OWSFingerprint *)fingerprintWithTheirSignalId:(NSString *)theirSignalId
{
NSData *theirIdentityKey = [self.storageManager identityKeyForRecipientId:theirSignalId];
NSData *_Nullable theirIdentityKey = [self.storageManager identityKeyForRecipientId:theirSignalId];
return [self fingerprintWithTheirSignalId:theirSignalId theirIdentityKey:theirIdentityKey];
}

Loading…
Cancel
Save