You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

49 lines
1.3 KiB

  1. /*
  2. * meli - ui crate.
  3. *
  4. * Copyright 2017-2018 Manos Pitsidianakis
  5. *
  6. * This file is part of meli.
  7. *
  8. * meli is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * meli is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with meli. If not, see <http://www.gnu.org/licenses/>.
  20. */
  21. /*! Entities that handle Mail specific functions.
  22. */
  23. use super::*;
  24. use melib::backends::Folder;
  25. use melib::backends::FolderHash;
  26. use melib::thread::ThreadHash;
  27. pub mod listing;
  28. pub use crate::listing::*;
  29. pub mod view;
  30. pub use crate::view::*;
  31. mod compose;
  32. pub use self::compose::*;
  33. pub mod pgp;
  34. mod accounts;
  35. pub use self::accounts::*;
  36. fn get_display_name(context: &Context, idx: usize) -> String {
  37. let settings = context.accounts[idx].runtime_settings.account();
  38. if let Some(d) = settings.display_name.as_ref() {
  39. format!("{} <{}>", d, settings.identity)
  40. } else {
  41. settings.identity.to_string()
  42. }
  43. }