mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-15 21:45:19 +00:00
Add new delegate which fires when the user selected "Send Always" in the alert
This commit is contained in:
parent
e975ce9e85
commit
20dc818137
@ -139,6 +139,9 @@ typedef enum CrashReportStatus {
|
||||
// Invoked before the user is asked to send a crash report, so you can do additional actions. E.g. to make sure not to ask the user for an app rating :)
|
||||
-(void) willShowSubmitCrashReportAlert;
|
||||
|
||||
// Invoked after the user did choose to send crashes always in the alert
|
||||
-(void) userDidChooseSendAlways;
|
||||
|
||||
@end
|
||||
|
||||
@interface BWQuincyManager : NSObject <NSXMLParserDelegate> {
|
||||
|
@ -377,22 +377,31 @@ NSString *BWQuincyLocalize(NSString *stringToken) {
|
||||
#pragma mark UIAlertView Delegate
|
||||
|
||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||
if ([alertView tag] == QuincyKitAlertTypeSend) {
|
||||
switch (buttonIndex) {
|
||||
case 0:
|
||||
if ([alertView tag] == QuincyKitAlertTypeSend) {
|
||||
switch (buttonIndex) {
|
||||
case 0:
|
||||
_sendingInProgress = NO;
|
||||
[self _cleanCrashReports];
|
||||
break;
|
||||
case 1:
|
||||
[self _sendCrashReports];
|
||||
break;
|
||||
case 2:
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kAutomaticallySendCrashReports];
|
||||
|
||||
[self _sendCrashReports];
|
||||
break;
|
||||
}
|
||||
}
|
||||
[self _cleanCrashReports];
|
||||
break;
|
||||
case 1:
|
||||
[self _sendCrashReports];
|
||||
break;
|
||||
case 2: {
|
||||
[[NSUserDefaults standardUserDefaults] setBool:YES forKey:kAutomaticallySendCrashReports];
|
||||
[[NSUserDefaults standardUserDefaults] synchronize];
|
||||
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(userDidChooseSendAlways)]) {
|
||||
[self.delegate userDidChooseSendAlways];
|
||||
}
|
||||
|
||||
[self _sendCrashReports];
|
||||
break;
|
||||
}
|
||||
default:
|
||||
_sendingInProgress = NO;
|
||||
[self _cleanCrashReports];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
Loading…
x
Reference in New Issue
Block a user