2424#import " RootTabViewController.h"
2525#import " Message_RootViewController.h"
2626
27+ #import " ProjectCommitsViewController.h"
28+ #import " MRPRDetailViewController.h"
29+
2730#import " UnReadManager.h"
2831
2932typedef NS_ENUM (NSInteger , AnalyseMethodType) {
@@ -152,6 +155,7 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
152155 NSString *ppRegexStr = @" /u/([^/]+)/pp/([0-9]+)$" ;
153156 NSString *topicRegexStr = @" /u/([^/]+)/p/([^/]+)/topic/(\\ d+)" ;
154157 NSString *taskRegexStr = @" /u/([^/]+)/p/([^/]+)/task/(\\ d+)" ;
158+ NSString *mergeRegexStr = @" /u/([^/]+)/p/([^/]+)/git/merge/(\\ d+)" ;
155159 NSString *conversionRegexStr = @" /user/messages/history/([^/]+)$" ;
156160 NSString *projectRegexStr = @" /u/([^/]+)/p/([^/]+)" ;
157161 NSArray *matchedCaptures = nil ;
@@ -174,6 +178,21 @@ + (UIViewController *)analyseVCFromLinkStr:(NSString *)linkStr analyseMethod:(An
174178 vc.curTweet = [Tweet tweetWithGlobalKey: user_global_key andPPID: pp_id];
175179 analyseVC = vc;
176180 }
181+ }else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: mergeRegexStr]).count > 0 ){
182+ // MR
183+ NSString *path = [linkStr stringByReplacingOccurrencesOfString: @" https://coding.net" withString: @" " ];
184+
185+ if ([presentingVC isKindOfClass: [MRPRDetailViewController class ]]) {
186+ MRPRDetailViewController *vc = (MRPRDetailViewController *)presentingVC;
187+ if ([vc.curMRPR.path isEqualToString: path]) {
188+ [vc refresh ];
189+ analyseVCIsNew = NO ;
190+ analyseVC = vc;
191+ }
192+ }
193+ if (!analyseVC) {
194+ analyseVC = [MRPRDetailViewController vcWithPath: path];
195+ }
177196 }else if ((matchedCaptures = [linkStr captureComponentsMatchedByRegex: topicRegexStr]).count > 0 ){
178197 // 讨论
179198 NSString *topic_id = matchedCaptures[3 ];
0 commit comments