[self dismissModalViewControllerAnimated:YES];
}
+- (void) _setupMail:(MFMailComposeViewController *)controller {
+}
+
- (void) _openMailToURL:(NSURL *)url {
if ($MFMailComposeViewController != nil && [$MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *controller([[[$MFMailComposeViewController alloc] init] autorelease]);
[controller setMailToURL:url];
+ [self _setupMail:controller];
+
[self presentModalViewController:controller animated:YES];
return;
}
[window setValue:cydia_ forKey:@"cydia"];
}
+- (void) _setupMail:(MFMailComposeViewController *)controller {
+ [controller addAttachmentData:[NSData dataWithContentsOfFile:@"/tmp/cydia.log"] mimeType:@"text/plain" fileName:@"cydia.log"];
+
+ system("/usr/bin/dpkg -l >/tmp/dpkgl.log");
+ [controller addAttachmentData:[NSData dataWithContentsOfFile:@"/tmp/dpkgl.log"] mimeType:@"text/plain" fileName:@"dpkgl.log"];
+}
+
- (NSURL *) URLWithURL:(NSURL *)url {
return [Diversion divertURL:url];
}