Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce SDK warnings from 11724 to 24 #1527

Merged
merged 3 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions MatrixSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@
325AF3E324897D9400EF937D /* MXSecretRecoveryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 325AF3E024897D9400EF937D /* MXSecretRecoveryResult.m */; };
325AF3E424897D9400EF937D /* MXSecretRecoveryResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 325AF3E024897D9400EF937D /* MXSecretRecoveryResult.m */; };
325D1C261DFECE0D0070B8BF /* MXCrypto_Private.h in Headers */ = {isa = PBXBuildFile; fileRef = 325D1C251DFECE0D0070B8BF /* MXCrypto_Private.h */; };
326056851C76FDF2009D44AD /* MXRoomEventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 326056831C76FDF1009D44AD /* MXRoomEventTimeline.h */; settings = {ATTRIBUTES = (Public, ); }; };
326056851C76FDF2009D44AD /* MXRoomEventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 326056831C76FDF1009D44AD /* MXRoomEventTimeline.h */; };
326056861C76FDF2009D44AD /* MXRoomEventTimeline.m in Sources */ = {isa = PBXBuildFile; fileRef = 326056841C76FDF1009D44AD /* MXRoomEventTimeline.m */; };
32618E7120ED2DF500E1D2EA /* MXFilterJSONModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 32618E6F20ED2DF500E1D2EA /* MXFilterJSONModel.h */; settings = {ATTRIBUTES = (Public, ); }; };
32618E7220ED2DF500E1D2EA /* MXFilterJSONModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 32618E7020ED2DF500E1D2EA /* MXFilterJSONModel.m */; };
Expand Down Expand Up @@ -1200,7 +1200,7 @@
B14EF3402397E90400758AF0 /* MXKeyBackupVersionTrust.h in Headers */ = {isa = PBXBuildFile; fileRef = 328BCB3121947BE200A976D3 /* MXKeyBackupVersionTrust.h */; settings = {ATTRIBUTES = (Public, ); }; };
B14EF3412397E90400758AF0 /* MXOutgoingRoomKeyRequestManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32FA10BF1FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h */; };
B14EF3422397E90400758AF0 /* MXPeekingRoomSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 3293C6FE214BBA4F009B3DDB /* MXPeekingRoomSummary.h */; };
B14EF3432397E90400758AF0 /* MXRoomEventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 326056831C76FDF1009D44AD /* MXRoomEventTimeline.h */; settings = {ATTRIBUTES = (Public, ); }; };
B14EF3432397E90400758AF0 /* MXRoomEventTimeline.h in Headers */ = {isa = PBXBuildFile; fileRef = 326056831C76FDF1009D44AD /* MXRoomEventTimeline.h */; };
B14EF3442397E90400758AF0 /* NSArray+MatrixSDK.h in Headers */ = {isa = PBXBuildFile; fileRef = 321CFDEC225264C4004D31DF /* NSArray+MatrixSDK.h */; };
B14EF3452397E90400758AF0 /* MXReplyEventParser.h in Headers */ = {isa = PBXBuildFile; fileRef = B11BD44622CB56790064D8B0 /* MXReplyEventParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
B14EF3462397E90400758AF0 /* MXIncomingSASTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 321CFDE822525DED004D31DF /* MXIncomingSASTransaction.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1542,8 +1542,8 @@
EC383BC02542F1E4002FBBE6 /* MXBackgroundSyncServiceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC383BBD2542F141002FBBE6 /* MXBackgroundSyncServiceTests.swift */; };
EC51019D26C41981007D6D88 /* MXSyncResponseUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC51019C26C41981007D6D88 /* MXSyncResponseUnitTests.swift */; };
EC51019E26C41981007D6D88 /* MXSyncResponseUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EC51019C26C41981007D6D88 /* MXSyncResponseUnitTests.swift */; };
EC5C560A2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = EC5C56082798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; };
EC5C560B2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = EC5C56082798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h */; settings = {ATTRIBUTES = (Public, ); }; };
EC5C560A2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = EC5C56082798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h */; };
EC5C560B2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = EC5C56082798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.h */; };
EC5C560C2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = EC5C56092798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.m */; };
EC5C560D2798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = EC5C56092798CEA00014CBE9 /* NSDictionary+MutableDeepCopy.m */; };
EC5C562827A36EDB0014CBE9 /* MXInReplyTo.h in Headers */ = {isa = PBXBuildFile; fileRef = EC5C562627A36EDB0014CBE9 /* MXInReplyTo.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -1779,6 +1779,8 @@
ECF29BDF264195320053E6D6 /* MXAssertedIdentityModel.h in Headers */ = {isa = PBXBuildFile; fileRef = ECF29BDD264195320053E6D6 /* MXAssertedIdentityModel.h */; settings = {ATTRIBUTES = (Public, ); }; };
ECF29BE52641953C0053E6D6 /* MXAssertedIdentityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = ECF29BE42641953C0053E6D6 /* MXAssertedIdentityModel.m */; };
ECF29BE62641953C0053E6D6 /* MXAssertedIdentityModel.m in Sources */ = {isa = PBXBuildFile; fileRef = ECF29BE42641953C0053E6D6 /* MXAssertedIdentityModel.m */; };
ED1AE92A2881AC7500D3432A /* MXWarnings.h in Headers */ = {isa = PBXBuildFile; fileRef = ED1AE9292881AC7100D3432A /* MXWarnings.h */; settings = {ATTRIBUTES = (Public, ); }; };
ED1AE92B2881AC7500D3432A /* MXWarnings.h in Headers */ = {isa = PBXBuildFile; fileRef = ED1AE9292881AC7100D3432A /* MXWarnings.h */; settings = {ATTRIBUTES = (Public, ); }; };
ED21F68528104DA2002FF83D /* MXMegolmEncryptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED21F68428104DA2002FF83D /* MXMegolmEncryptionTests.swift */; };
ED21F68628104DA2002FF83D /* MXMegolmEncryptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED21F68428104DA2002FF83D /* MXMegolmEncryptionTests.swift */; };
ED2DD114286C450600F06731 /* MXCryptoMachine.swift in Sources */ = {isa = PBXBuildFile; fileRef = ED2DD111286C450600F06731 /* MXCryptoMachine.swift */; };
Expand Down Expand Up @@ -2816,6 +2818,7 @@
ECF29BD2264194BB0053E6D6 /* MXCallAssertedIdentityEventContent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXCallAssertedIdentityEventContent.m; sourceTree = "<group>"; };
ECF29BDD264195320053E6D6 /* MXAssertedIdentityModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXAssertedIdentityModel.h; sourceTree = "<group>"; };
ECF29BE42641953C0053E6D6 /* MXAssertedIdentityModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXAssertedIdentityModel.m; sourceTree = "<group>"; };
ED1AE9292881AC7100D3432A /* MXWarnings.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXWarnings.h; sourceTree = "<group>"; };
ED21F68428104DA2002FF83D /* MXMegolmEncryptionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXMegolmEncryptionTests.swift; sourceTree = "<group>"; };
ED2DD111286C450600F06731 /* MXCryptoMachine.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXCryptoMachine.swift; sourceTree = "<group>"; };
ED2DD112286C450600F06731 /* MXEventDecryptionResult+DecryptedEvent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "MXEventDecryptionResult+DecryptedEvent.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3108,6 +3111,7 @@
B17B2BDA2369FC81009D6650 /* MXUIKitBackgroundTask.h */,
B17B2BDB2369FC81009D6650 /* MXUIKitBackgroundTask.m */,
EDF1B68F2876CD2C00BBBCEE /* MXTaskQueue.swift */,
ED1AE9292881AC7100D3432A /* MXWarnings.h */,
);
path = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -5156,6 +5160,7 @@
91F0685D2767CA420079F8FA /* MXTaskProfileName.h in Headers */,
B1798D0624091A0100308A8F /* MXBase64Tools.h in Headers */,
32133015228AF4EF0070BA9B /* MXRealmAggregationsStore.h in Headers */,
ED1AE92A2881AC7500D3432A /* MXWarnings.h in Headers */,
32CE6FB81A409B1F00317F1E /* MXFileStoreMetaData.h in Headers */,
B19A30C82404268600FB6F35 /* MXQRCodeDataBuilder.h in Headers */,
32A31BC820D401FC005916C7 /* MXRoomFilter.h in Headers */,
Expand Down Expand Up @@ -5503,6 +5508,7 @@
323F8774255460B5009E9E67 /* MXProfiler.h in Headers */,
EC8A53B425B1BC77004E0802 /* MXUserModel.h in Headers */,
32CEEF4423AD2A6C0039BA98 /* MXCrossSigningKey.h in Headers */,
ED1AE92B2881AC7500D3432A /* MXWarnings.h in Headers */,
B14EF29E2397E90400758AF0 /* MXMediaScanStoreDelegate.h in Headers */,
B14EF29F2397E90400758AF0 /* MXAllowedCertificates.h in Headers */,
B14EF2A02397E90400758AF0 /* MXRealmAggregationsMapper.h in Headers */,
Expand Down
35 changes: 0 additions & 35 deletions MatrixSDK/Contrib/Swift/MXRestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -699,27 +699,6 @@ public extension MXRestClient {
return __historyVisibility(ofRoom: roomId, success: currySuccess(transform: MXRoomHistoryVisibility.init, completion), failure: curryFailure(completion))
}







/**
Set the join rule of a room.

- parameters:
- roomId: the id of the room.
- joinRule: the rule to set.
- completion: A block object called when the operation completes.
- response: Indicates whether the operation was successful.

- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func setJoinRule(ofRoom roomId: String, joinRule: MXRoomJoinRule, completion: @escaping (_ response: MXResponse<Void>) -> Void) -> MXHTTPOperation {
return __setRoomJoinRule(roomId, joinRule: joinRule.identifier, success: currySuccess(completion), failure: curryFailure(completion))
}

/**
Set the join rule of a room.

Expand All @@ -736,20 +715,6 @@ public extension MXRestClient {
return __setRoomJoinRule(joinRule.identifier, forRoomWithId: roomId, allowedParentIds: allowedParentIds, success: currySuccess(completion), failure: curryFailure(completion))
}

/**
Get the join rule of a room.

- parameters:
- roomId: the id of the room.
- completion: A block object called when the operation completes.
- response: Provides the room join rule on success.

- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func joinRule(ofRoom roomId: String, completion: @escaping (_ response: MXResponse<MXRoomJoinRule>) -> Void) -> MXHTTPOperation {
return __joinRule(ofRoom: roomId, success: currySuccess(transform: MXRoomJoinRule.init, completion), failure: curryFailure(completion))
}

/**
Get the enhanced join rule of a room.

Expand Down
4 changes: 2 additions & 2 deletions MatrixSDK/Contrib/Swift/MXSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ public extension MXSession {

if let types = types {
let typeStrings = types.map({ return $0.identifier })
return __listen(toEventsOfTypes: typeStrings, onEvent: legacyBlock)
return __listen(toEventsOfTypes: typeStrings, onEvent: legacyBlock) as Any
} else {
return __listen(toEvents: legacyBlock)
return __listen(toEvents: legacyBlock) as Any
}
}

Expand Down
4 changes: 4 additions & 0 deletions MatrixSDK/Data/MXRoom.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
@class MXSession;
@class MXUsersTrustLevelSummary;

MX_ASSUME_MISSING_NULLABILITY_BEGIN

#pragma mark - Notifications

/**
Expand Down Expand Up @@ -1343,3 +1345,5 @@ Remove a tag applied on an event of the room
- (void)membersTrustLevelSummaryWithForceDownload:(BOOL)forceDownload success:(void (^)(MXUsersTrustLevelSummary *usersTrustLevelSummary))success failure:(void (^)(NSError *error))failure;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/Data/MXRoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
NSInteger const kMXRoomAlreadyJoinedErrorCode = 9001;
NSInteger const kMXRoomInvalidInviteSenderErrorCode = 9002;

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Turns out that #warning cannot be a part of macro expansions so have to insert it manually, and moreoever each header file gets processed dozens of times which generates duplicate warnings (not sure why). So If these 6 warnings are kept in header files, build produces 1000 extra warnings, which is not great. So as a compromise I am putting these warnings in the implementation file instead


@interface MXRoom ()
{
/**
Expand Down
4 changes: 4 additions & 0 deletions MatrixSDK/Data/MXRoomAccountData.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#import "MXEvent.h"
#import "MXVirtualRoomInfo.h"

MX_ASSUME_MISSING_NULLABILITY_BEGIN

/**
`MXRoomAccountData` represents private data that the user has defined for a room.
*/
Expand Down Expand Up @@ -80,3 +82,5 @@
- (NSArray<NSString *> *)getTaggedEventsIds:(NSString*)tag;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/Data/MXRoomAccountData.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#import "MXEvent.h"
#import "MXRoomCreateContent.h"

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN

@interface MXRoomAccountData ()

@property (nonatomic, readwrite) MXVirtualRoomInfo *virtualRoomInfo;
Expand Down
5 changes: 5 additions & 0 deletions MatrixSDK/JSONModels/MXEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@

#import "MXEventUnsignedData.h"
#import "MXEventContentRelatesTo.h"
#import "MXWarnings.h"

@class MXEventDecryptionResult;
@class MXEncryptedContentFile;
@class MXEventContentLocation;

MX_ASSUME_MISSING_NULLABILITY_BEGIN

/**
Types of Matrix events

Expand Down Expand Up @@ -732,3 +735,5 @@ extern NSString *const kMXEventIdentifierKey;
- (NSArray<MXEncryptedContentFile*>*)getEncryptedContentFiles;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/JSONModels/MXEvent.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#import "MXEventReferenceChunk.h"
#import "MXEventContentLocation.h"

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN

#pragma mark - Constants definitions

NSString *const kMXEventTypeStringRoomName = @"m.room.name";
Expand Down
5 changes: 5 additions & 0 deletions MatrixSDK/JSONModels/MXJSONModels.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
#import "MXWellKnown.h"
#import "MXCrossSigningInfo.h"
#import "MXEnumConstants.h"
#import "MXWarnings.h"

MX_ASSUME_MISSING_NULLABILITY_BEGIN

@class MXEvent, MXDeviceInfo, MXKey, MXUser;

Expand Down Expand Up @@ -1510,3 +1513,5 @@ FOUNDATION_EXPORT NSString *const kMXPushRuleScopeStringDevice;
@property (nonatomic, nullable) MXRoomVersionCapabilities *roomVersions;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/JSONModels/MXJSONModels.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

#pragma mark - Implementation

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN

@implementation MXPublicRoom

+ (id)modelFromJSON:(NSDictionary *)JSONDictionary
Expand Down
4 changes: 2 additions & 2 deletions MatrixSDK/MXRestClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,7 @@ NS_REFINED_FOR_SWIFT;
- (MXHTTPOperation*)setRoomJoinRule:(NSString*)roomId
joinRule:(MXRoomJoinRule)joinRule
success:(void (^)(void))success
failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT __deprecated_msg("Use [setRoomJoinRule:forRoomWithId:allowedParentIds:success:failure:] instead");
failure:(void (^)(NSError *error))failure __deprecated_msg("Use [setRoomJoinRule:forRoomWithId:allowedParentIds:success:failure:] instead");

/**
Set the join rule of a room.
Expand Down Expand Up @@ -1078,7 +1078,7 @@ NS_REFINED_FOR_SWIFT;
*/
- (MXHTTPOperation*)joinRuleOfRoom:(NSString*)roomId
success:(void (^)(MXRoomJoinRule joinRule))success
failure:(void (^)(NSError *error))failure NS_REFINED_FOR_SWIFT __deprecated_msg("Use [joinRuleOfRoomWithId:success:failure:] instead");
failure:(void (^)(NSError *error))failure __deprecated_msg("Use [joinRuleOfRoomWithId:success:failure:] instead");

/**
Get the enhanced join rule of a room.
Expand Down
1 change: 1 addition & 0 deletions MatrixSDK/MatrixSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ FOUNDATION_EXPORT NSString *MatrixSDKVersion;
#import "MXRestClient.h"
#import "MXSession.h"
#import "MXError.h"
#import "MXWarnings.h"

#import "MXStore.h"
#import "MXNoStore.h"
Expand Down
14 changes: 4 additions & 10 deletions MatrixSDK/Space/MXSpaceFileStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,12 @@ class MXSpaceFileStore: MXSpaceStore {

let fileUrl = storeUrl.appendingPathComponent(Constants.fileStoreGraphFile)

do {
guard let graph = try? NSKeyedUnarchiver.unarchiveObject(withFile: fileUrl.path) as? MXSpaceGraphData else {
MXLog.warning("[MXSpaceStore] loadSpaceGraphData: found no archived graph")
return nil
}

return graph
} catch {
MXLog.warning("[MXSpaceStore] loadSpaceGraphData: failed with error: \(error)")
guard let graph = NSKeyedUnarchiver.unarchiveObject(withFile: fileUrl.path) as? MXSpaceGraphData else {
MXLog.warning("[MXSpaceStore] loadSpaceGraphData: found no archived graph")
return nil
}

return nil
return graph
}

// MARK - Private
Expand Down
5 changes: 5 additions & 0 deletions MatrixSDK/Utils/MXBugReportRestClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
*/

#import <Foundation/Foundation.h>
#import "MXWarnings.h"

MX_ASSUME_MISSING_NULLABILITY_BEGIN

/**
Call states.
Expand Down Expand Up @@ -123,3 +126,5 @@ typedef enum : NSUInteger
@property (nonatomic) NSDictionary<NSString*, NSString*> *others;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/Utils/MXBugReportRestClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#import <MatrixKit/MatrixKit.h>
#endif

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN

@interface MXBugReportRestClient ()
{
// The bug report API server URL.
Expand Down
4 changes: 4 additions & 0 deletions MatrixSDK/Utils/MXTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#import "MXCallSessionDescription.h"
#import "MXCallRejectReplacementEventContent.h"

MX_ASSUME_MISSING_NULLABILITY_BEGIN

@interface MXTools : NSObject

+ (MXEventTypeString)eventTypeString:(MXEventType)eventType;
Expand Down Expand Up @@ -354,3 +356,5 @@ FOUNDATION_EXPORT NSString *const kMXToolsRegexStringForMatrixGroupIdentifier;
+ (BOOL)isRunningUnitTests;

@end

MX_ASSUME_MISSING_NULLABILITY_END
2 changes: 2 additions & 0 deletions MatrixSDK/Utils/MXTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#import <os/proc.h>
#endif

#warning File has not been annotated with nullability, see MX_ASSUME_MISSING_NULLABILITY_BEGIN

#pragma mark - Constant definition
NSString *const kMXToolsRegexStringForEmailAddress = @"[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}";

Expand Down
39 changes: 39 additions & 0 deletions MatrixSDK/Utils/MXWarnings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// Copyright 2022 The Matrix.org Foundation C.I.C
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#ifndef MXWarnings_h
#define MXWarnings_h

/**
Mark the beginning of code chunk that will ignore nullability warnings
(counterpart to `NS_ASSUME_NONNULL_BEGIN`)
*/
#ifndef MX_ASSUME_MISSING_NULLABILITY_BEGIN
#define MX_ASSUME_MISSING_NULLABILITY_BEGIN \
_Pragma("clang diagnostic push")\
_Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
#endif

/**
Mark the end of code chunk that will ignore nullability warnings
(counterpart to `NS_ASSUME_NONNULL_END`)
*/
#ifndef MX_ASSUME_MISSING_NULLABILITY_END
#define MX_ASSUME_MISSING_NULLABILITY_END \
_Pragma("clang diagnostic pop")
#endif

#endif /* MXWarnings_h */
3 changes: 3 additions & 0 deletions MatrixSDK/VoIP/MXCall.m
Original file line number Diff line number Diff line change
Expand Up @@ -1635,6 +1635,9 @@ - (void)terminateWithReason:(MXEvent *)event
case MXCallHangupReasonInviteTimeout:
_endReason = MXCallEndReasonMissed;
break;
case MXCallHangupReasonUserBusy:
_endReason = MXCallEndReasonBusy;
break;
}
break;
}
Expand Down
4 changes: 2 additions & 2 deletions MatrixSDKTests/MXAggregatedReactionTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -649,12 +649,12 @@ - (void)checkGappySyncScenarionReactions:(MXAggregatedReactions*)reactions
XCTAssertEqual(reactionCount.count, 1);
if ([reactionCount.reaction isEqualToString: @"👍"])
{
#warning Not implemented yet - https://github.com/vector-im/riot-ios/issues/2452
// TODO: Not implemented yet - https://github.com/vector-im/riot-ios/issues/2452
// XCTAssertTrue(reactionCount.myUserHasReacted, @"We must know reaction made by our user");
}
else if ([reactionCount.reaction isEqualToString: @"🙂"])
{
#warning Not implemented yet - https://github.com/vector-im/riot-ios/issues/2452
// TODO: Not implemented yet - https://github.com/vector-im/riot-ios/issues/2452
// XCTAssertFalse(reactionCount.myUserHasReacted);
}
else
Expand Down
Loading