summary refs log tree commit diff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 0520e0a..fd4b51c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,7 +29,7 @@ pub mod components {
     pub use preferences::Preferences;
 }
 
-use components::{post_editor::Post, PostEditorInput};
+use components::{post_editor::{Post, PostConversionSettings}, PostEditorInput};
 use soup::prelude::SessionExt;
 
 pub mod secrets;
@@ -43,6 +43,7 @@ pub struct App {
     secret_schema: libsecret::Schema,
     http: soup::Session,
     submit_busy_guard: Option<gtk::gio::ApplicationBusyGuard>,
+    settings: gio::Settings,
 
     // TODO: make this support multiple users
     micropub: Option<micropub::Client>,
@@ -415,7 +416,7 @@ impl AsyncComponent for App {
                         set_popover = &gtk::PopoverMenu::from_model(Some(&main_menu)) {},
                         #[watch]
                         set_visible: model.micropub.is_some(),
-                        set_icon_name: "menu",
+                        set_icon_name: "menu-symbolic",
                     },
                     pack_end = &gtk::Button {
                         set_icon_name: "paper-plane",
@@ -473,6 +474,7 @@ impl AsyncComponent for App {
             http: http.clone(),
             micropub: state,
             secret_schema,
+            settings: gio::Settings::new(crate::APPLICATION_ID),
 
             post_editor: {
                 #[cfg(feature = "smart-summary")]
@@ -561,7 +563,9 @@ impl AsyncComponent for App {
             }
             Input::PostEditor(Some(post)) => {
                 if let Some(micropub) = self.micropub.as_ref() {
-                    let mf2 = post.into();
+                    let mf2 = post.into_mf2(PostConversionSettings {
+                        send_html_directly: self.settings.get("send-html-directly")
+                    });
                     log::debug!("Submitting post: {:#}", serde_json::to_string(&mf2).unwrap());
                     match micropub.send_post(mf2).await {
                         Ok(uri) => {