Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
signalapp
GitHub Repository: signalapp/Signal-iOS
Path: blob/main/SignalServiceKit/Messages/InvalidKeyMessages/TSInvalidIdentityKeyReceivingErrorMessage.m
1 views
1
//
2
// Copyright 2017 Signal Messenger, LLC
3
// SPDX-License-Identifier: AGPL-3.0-only
4
//
5
6
#import "TSInvalidIdentityKeyReceivingErrorMessage.h"
7
#import <SignalServiceKit/SignalServiceKit-Swift.h>
8
9
NS_ASSUME_NONNULL_BEGIN
10
11
/* DEPRECATED */ @interface TSInvalidIdentityKeyReceivingErrorMessage ()
12
13
@property (nonatomic, readonly, copy) NSString *authorId;
14
15
@property (atomic, nullable) NSData *envelopeData;
16
17
@end
18
19
#pragma mark -
20
21
@implementation TSInvalidIdentityKeyReceivingErrorMessage {
22
SSKProtoEnvelope *_Nullable _envelope;
23
}
24
25
- (NSUInteger)hash
26
{
27
NSUInteger result = [super hash];
28
result ^= self.authorId.hash;
29
result ^= self.envelopeData.hash;
30
return result;
31
}
32
33
- (BOOL)isEqual:(id)other
34
{
35
if (![super isEqual:other]) {
36
return NO;
37
}
38
TSInvalidIdentityKeyReceivingErrorMessage *typedOther = (TSInvalidIdentityKeyReceivingErrorMessage *)other;
39
if (![NSObject isObject:self.authorId equalToObject:typedOther.authorId]) {
40
return NO;
41
}
42
if (![NSObject isObject:self.envelopeData equalToObject:typedOther.envelopeData]) {
43
return NO;
44
}
45
return YES;
46
}
47
48
// --- CODE GENERATION MARKER
49
50
// This snippet is generated by /Scripts/sds_codegen/sds_generate.py. Do not manually edit it, instead run
51
// `sds_codegen.sh`.
52
53
// clang-format off
54
55
- (instancetype)initWithGrdbId:(int64_t)grdbId
56
uniqueId:(NSString *)uniqueId
57
receivedAtTimestamp:(uint64_t)receivedAtTimestamp
58
sortId:(uint64_t)sortId
59
timestamp:(uint64_t)timestamp
60
uniqueThreadId:(NSString *)uniqueThreadId
61
body:(nullable NSString *)body
62
bodyRanges:(nullable MessageBodyRanges *)bodyRanges
63
contactShare:(nullable OWSContact *)contactShare
64
deprecated_attachmentIds:(nullable NSArray<NSString *> *)deprecated_attachmentIds
65
editState:(TSEditState)editState
66
expireStartedAt:(uint64_t)expireStartedAt
67
expireTimerVersion:(nullable NSNumber *)expireTimerVersion
68
expiresAt:(uint64_t)expiresAt
69
expiresInSeconds:(unsigned int)expiresInSeconds
70
giftBadge:(nullable OWSGiftBadge *)giftBadge
71
isGroupStoryReply:(BOOL)isGroupStoryReply
72
isPoll:(BOOL)isPoll
73
isSmsMessageRestoredFromBackup:(BOOL)isSmsMessageRestoredFromBackup
74
isViewOnceComplete:(BOOL)isViewOnceComplete
75
isViewOnceMessage:(BOOL)isViewOnceMessage
76
linkPreview:(nullable OWSLinkPreview *)linkPreview
77
messageSticker:(nullable MessageSticker *)messageSticker
78
quotedMessage:(nullable TSQuotedMessage *)quotedMessage
79
storedShouldStartExpireTimer:(BOOL)storedShouldStartExpireTimer
80
storyAuthorUuidString:(nullable NSString *)storyAuthorUuidString
81
storyReactionEmoji:(nullable NSString *)storyReactionEmoji
82
storyTimestamp:(nullable NSNumber *)storyTimestamp
83
wasRemotelyDeleted:(BOOL)wasRemotelyDeleted
84
errorType:(TSErrorMessageType)errorType
85
read:(BOOL)read
86
recipientAddress:(nullable SignalServiceAddress *)recipientAddress
87
sender:(nullable SignalServiceAddress *)sender
88
wasIdentityVerified:(BOOL)wasIdentityVerified
89
authorId:(NSString *)authorId
90
envelopeData:(nullable NSData *)envelopeData
91
{
92
self = [super initWithGrdbId:grdbId
93
uniqueId:uniqueId
94
receivedAtTimestamp:receivedAtTimestamp
95
sortId:sortId
96
timestamp:timestamp
97
uniqueThreadId:uniqueThreadId
98
body:body
99
bodyRanges:bodyRanges
100
contactShare:contactShare
101
deprecated_attachmentIds:deprecated_attachmentIds
102
editState:editState
103
expireStartedAt:expireStartedAt
104
expireTimerVersion:expireTimerVersion
105
expiresAt:expiresAt
106
expiresInSeconds:expiresInSeconds
107
giftBadge:giftBadge
108
isGroupStoryReply:isGroupStoryReply
109
isPoll:isPoll
110
isSmsMessageRestoredFromBackup:isSmsMessageRestoredFromBackup
111
isViewOnceComplete:isViewOnceComplete
112
isViewOnceMessage:isViewOnceMessage
113
linkPreview:linkPreview
114
messageSticker:messageSticker
115
quotedMessage:quotedMessage
116
storedShouldStartExpireTimer:storedShouldStartExpireTimer
117
storyAuthorUuidString:storyAuthorUuidString
118
storyReactionEmoji:storyReactionEmoji
119
storyTimestamp:storyTimestamp
120
wasRemotelyDeleted:wasRemotelyDeleted
121
errorType:errorType
122
read:read
123
recipientAddress:recipientAddress
124
sender:sender
125
wasIdentityVerified:wasIdentityVerified];
126
127
if (!self) {
128
return self;
129
}
130
131
_authorId = authorId;
132
_envelopeData = envelopeData;
133
134
return self;
135
}
136
137
// clang-format on
138
139
// --- CODE GENERATION MARKER
140
141
@end
142
143
NS_ASSUME_NONNULL_END
144
145