mirror of https://github.com/oxen-io/session-ios
commit
ed06555567
@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict/>
|
||||
<dict>
|
||||
<key>aps-environment</key>
|
||||
<string>development</string>
|
||||
</dict>
|
||||
</plist>
|
||||
|
@ -0,0 +1,15 @@
|
||||
// Created by Michael Kirk on 9/14/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class PushManager;
|
||||
|
||||
@interface OWSStaleNotificationObserver : NSObject
|
||||
|
||||
- (instancetype)initWithPushManager:(PushManager *)pushManager NS_DESIGNATED_INITIALIZER;
|
||||
- (void)startObserving;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,71 @@
|
||||
// Created by Michael Kirk on 9/14/16.
|
||||
// Copyright © 2016 Open Whisper Systems. All rights reserved.
|
||||
|
||||
#import "OWSStaleNotificationObserver.h"
|
||||
#import "PushManager.h"
|
||||
#import <SignalServiceKit/OWSReadReceiptsProcessor.h>
|
||||
#import <SignalServiceKit/TSIncomingMessage.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface OWSStaleNotificationObserver ()
|
||||
|
||||
@property (nonatomic, readonly) PushManager *pushManager;
|
||||
|
||||
@end
|
||||
|
||||
@implementation OWSStaleNotificationObserver
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
||||
}
|
||||
|
||||
- (instancetype)init
|
||||
{
|
||||
return [self initWithPushManager:[PushManager sharedManager]];
|
||||
}
|
||||
|
||||
- (instancetype)initWithPushManager:(PushManager *)pushManager
|
||||
{
|
||||
self = [super init];
|
||||
if (!self) {
|
||||
return self;
|
||||
}
|
||||
|
||||
_pushManager = pushManager;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)startObserving
|
||||
{
|
||||
[[NSNotificationCenter defaultCenter] addObserver:self
|
||||
selector:@selector(handleMessageRead:)
|
||||
name:OWSReadReceiptsProcessorMarkedMessageAsReadNotification
|
||||
object:nil];
|
||||
}
|
||||
|
||||
- (void)handleMessageRead:(NSNotification *)notification
|
||||
{
|
||||
if ([notification.object isKindOfClass:[TSIncomingMessage class]]) {
|
||||
TSIncomingMessage *message = (TSIncomingMessage *)notification.object;
|
||||
|
||||
DDLogDebug(@"%@ canceled notification for message:%@", self.tag, message);
|
||||
[self.pushManager cancelNotificationsWithThreadId:message.uniqueThreadId];
|
||||
}
|
||||
}
|
||||
|
||||
+ (NSString *)tag
|
||||
{
|
||||
return [NSString stringWithFormat:@"[%@]", self.class];
|
||||
}
|
||||
|
||||
- (NSString *)tag
|
||||
{
|
||||
return self.class.tag;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -x
|
||||
|
||||
function usage() {
|
||||
cat <<EOS
|
||||
Extracts string from target file to new.strings
|
||||
|
||||
$0 <filename.m>
|
||||
|
||||
e.g.
|
||||
|
||||
$0 path/to/my/ClassName.m
|
||||
EOS
|
||||
}
|
||||
|
||||
TARGET=$1
|
||||
if [[ -z $TARGET ]]
|
||||
then
|
||||
echo "Can't proceed without target"
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OUTPUT_DIR=new_strings
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
genstrings -o "${OUTPUT_DIR}" "${TARGET}"
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue