Page MenuHomePhabricator

D4472.id14276.diff
No OneTemporary

D4472.id14276.diff

diff --git a/native/ios/Comm/TemporaryMessageStorage/TemporaryMessageStorage.mm b/native/ios/Comm/TemporaryMessageStorage/TemporaryMessageStorage.mm
--- a/native/ios/Comm/TemporaryMessageStorage/TemporaryMessageStorage.mm
+++ b/native/ios/Comm/TemporaryMessageStorage/TemporaryMessageStorage.mm
@@ -4,6 +4,12 @@
#import "NonBlockingLock.h"
#import <string>
+@interface TemporaryMessageStorage ()
+- (BOOL)_updateCurrentStorage;
+- (NSString *)_getLockName:(NSString *)fileName;
+- (NSString *)_getPath:(NSString *)fileName;
+@end
+
@implementation TemporaryMessageStorage
- (instancetype)init {
@@ -33,4 +39,26 @@
return self;
}
+- (BOOL)_updateCurrentStorage {
+ int64_t updateTimestamp = (int64_t)[NSDate date].timeIntervalSince1970;
+ NSString *updatedStorageName =
+ [NSString stringWithFormat:@"msg_%lld", updateTimestamp];
+ NSString *updatedStoragePath =
+ [self.directoryURL URLByAppendingPathComponent:updatedStorageName].path;
+ return [NSFileManager.defaultManager createFileAtPath:updatedStoragePath
+ contents:nil
+ attributes:nil];
+}
+
+- (NSString *)_getLockName:(NSString *)fileName {
+ return [NSString stringWithFormat:@"group.app.comm/%@", fileName];
+}
+
+- (NSString *)_getPath:(NSString *)fileName {
+ if (!fileName) {
+ return nil;
+ }
+ return [self.directoryURL URLByAppendingPathComponent:fileName].path;
+}
+
@end

File Metadata

Mime Type
text/plain
Expires
Sat, Dec 28, 7:12 AM (3 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2724549
Default Alt Text
D4472.id14276.diff (1 KB)

Event Timeline