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