mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-07-29 14:40:42 +00:00
Store the app identifier with the feedback thread. So in case they change by accident, new posts will cause a new thread in the current app to be created
This commit is contained in:
parent
9e436f3d26
commit
f09ea53fba
@ -47,6 +47,7 @@
|
||||
#define kBITFeedbackName @"HockeyFeedbackName"
|
||||
#define kBITFeedbackEmail @"HockeyFeedbackEmail"
|
||||
#define kBITFeedbackLastMessageID @"HockeyFeedbackLastMessageID"
|
||||
#define kBITFeedbackAppID @"HockeyFeedbackAppID"
|
||||
|
||||
|
||||
@implementation BITFeedbackManager {
|
||||
@ -320,6 +321,17 @@
|
||||
if ([unarchiver containsValueForKey:kBITFeedbackToken])
|
||||
self.token = [unarchiver decodeObjectForKey:kBITFeedbackToken];
|
||||
|
||||
if ([unarchiver containsValueForKey:kBITFeedbackAppID]) {
|
||||
NSString *appID = [unarchiver decodeObjectForKey:kBITFeedbackAppID];
|
||||
|
||||
// the stored thread is from another application identifier, so clear the token
|
||||
// which will cause the new posts to create a new thread on the server for the
|
||||
// current app identifier
|
||||
if ([appID compare:self.appIdentifier] != NSOrderedSame) {
|
||||
self.token = nil;
|
||||
}
|
||||
}
|
||||
|
||||
if ([unarchiver containsValueForKey:kBITFeedbackDateOfLastCheck])
|
||||
self.lastCheck = [unarchiver decodeObjectForKey:kBITFeedbackDateOfLastCheck];
|
||||
|
||||
@ -356,6 +368,9 @@
|
||||
if (self.token)
|
||||
[archiver encodeObject:self.token forKey:kBITFeedbackToken];
|
||||
|
||||
if (self.appIdentifier)
|
||||
[archiver encodeObject:self.appIdentifier forKey:kBITFeedbackAppID];
|
||||
|
||||
if (self.userID)
|
||||
[archiver encodeObject:self.userID forKey:kBITFeedbackUserID];
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
NSDateFormatter *_rfc3339Formatter;
|
||||
|
||||
NSString *_appIdentifier;
|
||||
BOOL _isAppStoreEnvironment;
|
||||
}
|
||||
|
||||
@ -54,7 +53,7 @@
|
||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment {
|
||||
if ((self = [self init])) {
|
||||
|
||||
_appIdentifier = appIdentifier;
|
||||
self.appIdentifier = appIdentifier;
|
||||
_isAppStoreEnvironment = isAppStoreEnvironment;
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,8 @@
|
||||
|
||||
@interface BITHockeyBaseManager()
|
||||
|
||||
@property (nonatomic, retain) NSString *appIdentifier;
|
||||
|
||||
- (id)initWithAppIdentifier:(NSString *)appIdentifier isAppStoreEnvironemt:(BOOL)isAppStoreEnvironment;
|
||||
|
||||
- (void)startManager;
|
||||
|
Loading…
x
Reference in New Issue
Block a user