diff --git a/Riot/Modules/BugReport/BugReportViewController.h b/Riot/Modules/BugReport/BugReportViewController.h index 7156396614..d7dcd78f1b 100644 --- a/Riot/Modules/BugReport/BugReportViewController.h +++ b/Riot/Modules/BugReport/BugReportViewController.h @@ -65,4 +65,11 @@ */ @property (nonatomic) BOOL reportCrash; +// Tchap +/** + Option to report a VoIP incident. + The crash log will sent in the report. + */ +@property (nonatomic) BOOL reportVoIPIncident; + @end diff --git a/Riot/Modules/BugReport/BugReportViewController.m b/Riot/Modules/BugReport/BugReportViewController.m index da9d75995c..dd3e916dbc 100644 --- a/Riot/Modules/BugReport/BugReportViewController.m +++ b/Riot/Modules/BugReport/BugReportViewController.m @@ -23,6 +23,9 @@ #import "RageShakeManager.h" #import "ThemeService.h" +// Tchap: use AFNetworkReachability connection state in VoIP RageShake +#import "AFNetworkReachabilityManager.h" + @interface BugReportViewController () { MXBugReportRestClient *bugReportRestClient; @@ -84,7 +87,13 @@ - (void)viewDidLoad _bugReportDescriptionTextView.text = nil; _bugReportDescriptionTextView.delegate = self; - if (_reportCrash) + // Tchap: add `reportVoIPIncident` configuration + if (_reportVoIPIncident) + { + _titleLabel.text = [TchapL10n voidReportIncidentTitle]; + _descriptionLabel.text = [TchapL10n voidReportIncidentDescription]; + } + else if (_reportCrash) { _titleLabel.text = [VectorL10n bugCrashReportTitle]; _descriptionLabel.text = [VectorL10n bugCrashReportDescription]; @@ -361,6 +370,21 @@ - (IBAction)onSendButtonPress:(id)sender NSMutableDictionary *customFields = NSMutableDictionary.dictionary; customFields[@"email"] = mainAccount.linkedEmails.firstObject ?: @"undefined"; + // Tchap : add "context: 'voip'" (if necessary) for support automation + if ( _reportVoIPIncident == YES ) { + customFields[@"context"] = @"voip"; + + if ( AFNetworkReachabilityManager.sharedManager.isReachableViaWiFi ) { + customFields[@"connection"] = @"wifi"; + } + else if ( AFNetworkReachabilityManager.sharedManager.isReachableViaWWAN ) { + customFields[@"connection"] = @"mobile"; + } + else { + customFields[@"connection"] = @"unknown"; + } + } + bugReportRestClient.others = userInfo; // Screenshot @@ -388,7 +412,7 @@ - (IBAction)onSendButtonPress:(id)sender sendCrashLog:_reportCrash sendFiles:files additionalLabels:nil - customFields:customFields // Tchap : add custom fields (fro email actually) + customFields:customFields // Tchap : add custom fields (for email actually) progress:^(MXBugReportState state, NSProgress *progress) { switch (state) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 63a47078ed..b0024715e8 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -3888,6 +3888,16 @@ - (void)dataSource:(MXKDataSource *)dataSource didRecognizeAction:(NSString *)ac MXCall *call = [self.mainSession.callManager callWithCallId:eventContent.callId]; [call hangup]; } + // Tchap: handle "rport VoIP incident" action + else if ([actionIdentifier isEqualToString:RoomDirectCallStatusCell.reportIncidentAction]) + { + MXEvent *callInviteEvent = userInfo[kMXKRoomBubbleCellEventKey]; + MXCallInviteEventContent *eventContent = [MXCallInviteEventContent modelFromJSON:callInviteEvent.content]; + + BugReportViewController *bugReportViewController = [BugReportViewController bugReportViewController]; + bugReportViewController.reportVoIPIncident = YES; + [bugReportViewController showInViewController:self]; + } else if ([actionIdentifier isEqualToString:RoomGroupCallStatusCell.joinAction] || [actionIdentifier isEqualToString:RoomGroupCallStatusCell.answerAction]) { diff --git a/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib b/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib index 3a69de9b50..03c049087f 100644 --- a/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib +++ b/Riot/Modules/Room/TimelineCells/Call/CallCellContentView.xib @@ -87,7 +87,7 @@ -