-
Notifications
You must be signed in to change notification settings - Fork 103
Support HTML comments & embedded images #101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4f4e292
Initial working version based on CsQuery
ac05f09
revert bad change
51b2e7e
Initial hacky way to support embedded images
7f91bfe
Support images in both description and comments. Do so in a less hack…
2ea8638
Add UTs + comments
0d79810
Ensure embedded images are preserved in both the original bug and in …
de963ad
Split classes into their own files
9ecdbe5
Gate new behavior behind an EnableExperimentalHtmlFeatures setting
47a5cfb
Tweaks/fixes
ed9f1d8
Ensure locally-downloaded attachments are deleted even if errors are …
b99f312
Fix NullReferenceException
7c5b186
Fix bug where overrides/@@@s were including html artifacts in replies
5d05bcc
Avoid including line-like message delimiters when detecting last mess…
d85a390
Prevent duplicate attachments from being uploaded
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| using System; | ||
| using System.CodeDom.Compiler; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
|
|
||
| namespace Mail2Bug.Email | ||
| { | ||
| /// <summary> | ||
| /// Collection of Exchange email attachments that have been downloaded locally | ||
| /// </summary> | ||
| public class MessageAttachmentCollection : IDisposable | ||
| { | ||
| private readonly List<MessageAttachmentInfo> _attachments; | ||
| private readonly TempFileCollection _tempFileCollection; | ||
|
|
||
| public IReadOnlyCollection<MessageAttachmentInfo> Attachments => _attachments; | ||
| public IEnumerable<string> LocalFilePaths => _attachments.Select(a => a.FilePath); | ||
|
|
||
| public MessageAttachmentCollection() | ||
| { | ||
| _attachments = new List<MessageAttachmentInfo>(); | ||
| _tempFileCollection = new TempFileCollection(); | ||
| } | ||
|
|
||
| public void Add(string localFilePath, string contentId) | ||
| { | ||
| _attachments.Add(new MessageAttachmentInfo(localFilePath, contentId)); | ||
| _tempFileCollection.AddFile(localFilePath, keepFile: false); | ||
| } | ||
|
|
||
| public void DeleteLocalFiles() | ||
| { | ||
| _tempFileCollection.Delete(); | ||
| } | ||
|
|
||
| public void Dispose() | ||
| { | ||
| DeleteLocalFiles(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| namespace Mail2Bug.Email | ||
| { | ||
| /// <summary> | ||
| /// Represents basic information about an Exchange email attachment that has been downloaded locally and has a known exchange content id | ||
| /// </summary> | ||
| public class MessageAttachmentInfo | ||
| { | ||
| public MessageAttachmentInfo(string filePath, string contentId) | ||
| { | ||
| FilePath = filePath; | ||
| ContentId = contentId; | ||
| } | ||
|
|
||
| public string FilePath { get; } | ||
|
|
||
| public string ContentId { get; } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.