mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Fix duplicate push notification bug
This commit is contained in:
parent
b6264be795
commit
6977846ce2
|
@ -130,6 +130,10 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
stringWithFormat:@"%@ with message timestamps: %lu", self.logTag, (unsigned long)self.messageTimestamps.count];
|
||||
}
|
||||
|
||||
#pragma mark - Other
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeReceipt]; }
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
|
|
|
@ -8,11 +8,16 @@ public final class TTLUtilities : NSObject {
|
|||
@objc(LKMessageType)
|
||||
public enum MessageType : Int {
|
||||
case address
|
||||
case call
|
||||
case disappearingMessagesConfiguration
|
||||
case ephemeral
|
||||
case friendRequest
|
||||
case linkDevice
|
||||
case profileKey
|
||||
case receipt
|
||||
case regular
|
||||
case sessionRequest
|
||||
case sync
|
||||
case typingIndicator
|
||||
case unlinkDevice
|
||||
}
|
||||
|
@ -20,11 +25,16 @@ public final class TTLUtilities : NSObject {
|
|||
@objc public static func getTTL(for messageType: MessageType) -> UInt64 {
|
||||
switch messageType {
|
||||
case .address: return 1 * kMinuteInMs
|
||||
case .call: return 1 * kMinuteInMs
|
||||
case .disappearingMessagesConfiguration: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .ephemeral: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .friendRequest: return 4 * kDayInMs
|
||||
case .linkDevice: return 4 * kMinuteInMs
|
||||
case .sessionRequest: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .profileKey: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .receipt: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .regular: return 2 * kDayInMs
|
||||
case .sessionRequest: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .sync: return 4 * kDayInMs - 1 * kHourInMs
|
||||
case .typingIndicator: return 1 * kMinuteInMs
|
||||
case .unlinkDevice: return 4 * kDayInMs - 1 * kHourInMs
|
||||
}
|
||||
|
|
|
@ -60,6 +60,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return self;
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeSync]; }
|
||||
|
||||
- (BOOL)shouldBeSaved
|
||||
{
|
||||
return NO;
|
||||
|
|
|
@ -42,6 +42,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return self;
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeSync]; }
|
||||
|
||||
- (BOOL)shouldBeSaved
|
||||
{
|
||||
return NO;
|
||||
|
|
|
@ -24,6 +24,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeDisappearingMessagesConfiguration]; }
|
||||
|
||||
- (instancetype)initWithConfiguration:(OWSDisappearingMessagesConfiguration *)configuration thread:(TSThread *)thread
|
||||
{
|
||||
// MJK TODO - remove sender timestamp
|
||||
|
|
|
@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return NO;
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeEphemeral]; }
|
||||
|
||||
- (nullable SSKProtoDataMessageBuilder *)dataMessageBuilder
|
||||
{
|
||||
SSKProtoDataMessageBuilder *_Nullable builder = [super dataMessageBuilder];
|
||||
|
|
|
@ -162,6 +162,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
|
||||
#pragma mark - TSYapDatabaseObject overrides
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeCall]; }
|
||||
|
||||
- (BOOL)shouldBeSaved
|
||||
{
|
||||
return NO;
|
||||
|
|
|
@ -84,6 +84,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return contentData;
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeEphemeral]; }
|
||||
|
||||
- (BOOL)shouldSyncTranscript
|
||||
{
|
||||
return NO;
|
||||
|
|
|
@ -32,6 +32,8 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
return [super initWithCoder:coder];
|
||||
}
|
||||
|
||||
- (uint)ttl { return (uint)[LKTTLUtilities getTTLFor:LKMessageTypeProfileKey]; }
|
||||
|
||||
- (BOOL)shouldBeSaved
|
||||
{
|
||||
return NO;
|
||||
|
|
Loading…
Reference in a new issue