Path: blob/main/SignalServiceKit/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m
1 views
//1// Copyright 2017 Signal Messenger, LLC2// SPDX-License-Identifier: AGPL-3.0-only3//45#import "TSInvalidIdentityKeyReceivingErrorMessage.h"6#import <SignalServiceKit/SignalServiceKit-Swift.h>78NS_ASSUME_NONNULL_BEGIN910/* DEPRECATED */ @interface TSInvalidIdentityKeyReceivingErrorMessage ()1112@property (nonatomic, readonly, copy) NSString *authorId;1314@property (atomic, nullable) NSData *envelopeData;1516@end1718#pragma mark -1920@implementation TSInvalidIdentityKeyReceivingErrorMessage {21SSKProtoEnvelope *_Nullable _envelope;22}2324- (NSUInteger)hash25{26NSUInteger result = [super hash];27result ^= self.authorId.hash;28result ^= self.envelopeData.hash;29return result;30}3132- (BOOL)isEqual:(id)other33{34if (![super isEqual:other]) {35return NO;36}37TSInvalidIdentityKeyReceivingErrorMessage *typedOther = (TSInvalidIdentityKeyReceivingErrorMessage *)other;38if (![NSObject isObject:self.authorId equalToObject:typedOther.authorId]) {39return NO;40}41if (![NSObject isObject:self.envelopeData equalToObject:typedOther.envelopeData]) {42return NO;43}44return YES;45}4647// --- CODE GENERATION MARKER4849// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run50// `sds_codegen.sh`.5152// clang-format off5354- (instancetype)initWithGrdbId:(int64_t)grdbId55uniqueId:(NSString *)uniqueId56receivedAtTimestamp:(uint64_t)receivedAtTimestamp57sortId:(uint64_t)sortId58timestamp:(uint64_t)timestamp59uniqueThreadId:(NSString *)uniqueThreadId60body:(nullable NSString *)body61bodyRanges:(nullable MessageBodyRanges *)bodyRanges62contactShare:(nullable OWSContact *)contactShare63deprecated_attachmentIds:(nullable NSArray<NSString *> *)deprecated_attachmentIds64editState:(TSEditState)editState65expireStartedAt:(uint64_t)expireStartedAt66expireTimerVersion:(nullable NSNumber *)expireTimerVersion67expiresAt:(uint64_t)expiresAt68expiresInSeconds:(unsigned int)expiresInSeconds69giftBadge:(nullable OWSGiftBadge *)giftBadge70isGroupStoryReply:(BOOL)isGroupStoryReply71isPoll:(BOOL)isPoll72isSmsMessageRestoredFromBackup:(BOOL)isSmsMessageRestoredFromBackup73isViewOnceComplete:(BOOL)isViewOnceComplete74isViewOnceMessage:(BOOL)isViewOnceMessage75linkPreview:(nullable OWSLinkPreview *)linkPreview76messageSticker:(nullable MessageSticker *)messageSticker77quotedMessage:(nullable TSQuotedMessage *)quotedMessage78storedShouldStartExpireTimer:(BOOL)storedShouldStartExpireTimer79storyAuthorUuidString:(nullable NSString *)storyAuthorUuidString80storyReactionEmoji:(nullable NSString *)storyReactionEmoji81storyTimestamp:(nullable NSNumber *)storyTimestamp82wasRemotelyDeleted:(BOOL)wasRemotelyDeleted83errorType:(TSErrorMessageType)errorType84read:(BOOL)read85recipientAddress:(nullable SignalServiceAddress *)recipientAddress86sender:(nullable SignalServiceAddress *)sender87wasIdentityVerified:(BOOL)wasIdentityVerified88authorId:(NSString *)authorId89envelopeData:(nullable NSData *)envelopeData90{91self = [super initWithGrdbId:grdbId92uniqueId:uniqueId93receivedAtTimestamp:receivedAtTimestamp94sortId:sortId95timestamp:timestamp96uniqueThreadId:uniqueThreadId97body:body98bodyRanges:bodyRanges99contactShare:contactShare100deprecated_attachmentIds:deprecated_attachmentIds101editState:editState102expireStartedAt:expireStartedAt103expireTimerVersion:expireTimerVersion104expiresAt:expiresAt105expiresInSeconds:expiresInSeconds106giftBadge:giftBadge107isGroupStoryReply:isGroupStoryReply108isPoll:isPoll109isSmsMessageRestoredFromBackup:isSmsMessageRestoredFromBackup110isViewOnceComplete:isViewOnceComplete111isViewOnceMessage:isViewOnceMessage112linkPreview:linkPreview113messageSticker:messageSticker114quotedMessage:quotedMessage115storedShouldStartExpireTimer:storedShouldStartExpireTimer116storyAuthorUuidString:storyAuthorUuidString117storyReactionEmoji:storyReactionEmoji118storyTimestamp:storyTimestamp119wasRemotelyDeleted:wasRemotelyDeleted120errorType:errorType121read:read122recipientAddress:recipientAddress123sender:sender124wasIdentityVerified:wasIdentityVerified];125126if (!self) {127return self;128}129130_authorId = authorId;131_envelopeData = envelopeData;132133return self;134}135136// clang-format on137138// --- CODE GENERATION MARKER139140@end141142NS_ASSUME_NONNULL_END143144145