Skip to content
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

Mail/Msg refactoring #173

Merged
merged 133 commits into from
Sep 10, 2021
Merged

Mail/Msg refactoring #173

merged 133 commits into from
Sep 10, 2021

Conversation

TornaxO7
Copy link
Contributor

@TornaxO7 TornaxO7 commented Jul 1, 2021

Hi! I did some changes to the Msg struct. You should be able now to use it for everything which is related to Msgs/Mails. This means:

  • You can build templates with it
  • You can reply with it
  • Edit the body
  • Add new attachments

and so on.

I'd really appreaciate it, if this could be merged, because the "new" Msg struct will be able to store all related information of a Msg which should make it easier for the TUI to display them.

Hint

It's not completely done yet. You can see below in the TODO section what is missing, but the rest should work.

TODO

  • Finish the Documentation
  • Finish/Add Tests

TornaxO7 added 14 commits June 24, 2021 17:14
Adding a main structure which can be used for *everything* which has to do with
a mail:
    - Writing a new mail
    - Fetching the information of a mail
User can write mails now
When mail is converted to a sendable message, it'll print out a nice little
error message what to do and which field is missing a value.
List subcommand works with new struct now.
Started implementation for forwarding message
This is just a "backup" commit
Himalaya can compile successfully now.
- Moved everything from msg/mail to msg/model
- Removed uneccessary files
Renamed all "Mail" and "Mails" struct to "Msg" and "Msgs".
Removed an CLI-Subcommand which can't be used anymore
Fixed flags to vector and added the template subcommand back
Changed the datatype from Vec<Flag<'static>> to HashSet<Flag<'static>>, because
each Message/Mail can include only one flag-type, so why not a HashSet for this
job?
Fixed the lettre-dependencie which points to the pull request with the given
serde implementation for ContentType (needed for Attachments).
- Removed the msg/flag/flag.rs file since we can use the imap::types::Flag
  implementation now
- `himalaya template new` printed the template two times. This should be fixed
  now
@TornaxO7 TornaxO7 marked this pull request as draft July 1, 2021 11:28
Fixed formatting when printing out template
TornaxO7 and others added 13 commits July 2, 2021 19:08
Fixed bug that user can't send a mail
Moved the body from the attachment-vector out to an external attribute of the
struct.
- Fixed bug that listing didn't showed up addresses in the `From:` field for
  example
- Made each `from` trait function to `try_from` for better error-handling
- Fixed tests in `tests/imap_conn.rs`
- Updated mailparse to 0.13.4
- Added new "new" function to Account
- Cleaned up some functions (removed some)
- Added Eq and PartialEq derives for msg
- Bugfix:
    It couldn't get the body of some mails, because they were inside a
    multipart/alternative part. Now the mail is iterating through all subparts
    and picks up the firs text/plain "attachment" and uses it as the body.
- Made the "main attributes" of the Msg struct public
- Removed to getter functions
- Added documentation
- Removed the getter functions, beacuse the attributes are public
- Removed the `new` constructor of the envelope, since it's actually the same as
  Envelope::default()
- Addded tests and Documentation to Attachments.rs
- Added docuemntation for msg/body.rs
- Fixed some syntax errors in the doc strings
- Added `get_raw` function and `raw` field for the `Msg` struct.
- Fixed raw output of msg
- Started documentation + tests for the Msg struct
- Added Clone derive
- Added documentation for change_to_reply method
- Added tests to change_to_reply method
- Changed `Account::new()` function
- Added more documentation to Msg struct
- Added more tests to Msg struct
@TornaxO7
Copy link
Contributor Author

So this PR should be ready to merge now 👍

@TornaxO7
Copy link
Contributor Author

Eh, what are you waiting for? Are you doing a review at the moment? Are you unhappy with something? (Just wondering)

@soywod
Copy link
Member

soywod commented Sep 1, 2021

So this PR should be ready to merge now 👍

Great, I will review and test the branch one last time, so we don't miss sth.

@soywod
Copy link
Member

soywod commented Sep 1, 2021

Eh, what are you waiting for? Are you doing a review at the moment? Are you unhappy with something? (Just wondering)

Just sleeping...

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Sep 1, 2021

Oh sorry 😅

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Sep 5, 2021

Are you still reviewing?

@soywod
Copy link
Member

soywod commented Sep 5, 2021

Yes, it's a big PR, I want to take time to test it well. I'm quite busy at work those days, I will finish it as soon as I can.

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Sep 5, 2021

Ok, I was just wondering because about five days passed now. Take your time! I don't want to put you under pressure!

@soywod
Copy link
Member

soywod commented Sep 8, 2021

I opened 4 issues on your repo https://github.com/TornaxO7/himalaya/issues.

TornaxO7 and others added 11 commits September 8, 2021 22:22
Changes the order of the signature for forwarded messages.
Changed the output if an error occurs.
When printing the message in json, the raw message is printed out as a string
now.
- When displaying the table, we'll look first, if a name exists, if yes => use
  it otherwise use the email address.

- Added the rfc2047_decoder for parsing addresses
…n_format

Template shows raw data with json format
Run 'cargo fmt'
@soywod
Copy link
Member

soywod commented Sep 10, 2021

If all tests pass, I'm ready to merge!

@TornaxO7
Copy link
Contributor Author

TornaxO7 commented Sep 10, 2021

What the? Why are the tests failing again? They are working locally on my machine ._.

@TornaxO7
Copy link
Contributor Author

Wait, it's still testing? o.O Nevermind my previous message 😅

@TornaxO7
Copy link
Contributor Author

Yehaaaw! Tests passed!

@soywod soywod merged commit 0e68801 into pimalaya:master Sep 10, 2021
@soywod
Copy link
Member

soywod commented Sep 10, 2021

Congratulations 🎉 and thank you for your patience!

@soywod soywod deleted the mail_refactor branch September 10, 2021 22:35
@TornaxO7
Copy link
Contributor Author

Thanks and thank you for accepting my PR :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants