Commit 7051a65d authored by Christopher Davis's avatar Christopher Davis Committed by Daniel Garcia Moreno

Changing for future compatibility with !53

parent e89fa429
......@@ -1342,7 +1342,7 @@ impl AppOp {
}
}
pub fn send_message(&mut self, msg: String) {
pub fn send_message(&mut self, mut msg: String) {
if msg.is_empty() {
// Not sending empty messages
return;
......@@ -1367,7 +1367,8 @@ impl AppOp {
};
if msg.starts_with("/me ") {
m.body = msg.trim_left_matches("/me ").to_owned();
msg = msg.trim_left_matches("/me ").to_owned();
m.body = msg.to_string();
m.mtype = strn!("m.emote");
}
......@@ -1375,7 +1376,7 @@ impl AppOp {
self.autoscroll = true;
let md_parsed_msg = markdown_to_html(&msg, &ComrakOptions::default());
if !(md_parsed_msg.replace("<p>","").replace("</p>","") == msg.clone() + "\n") {
if md_parsed_msg.replace("<p>","").replace("</p>","") != msg.clone() + "\n" {
m.formatted_body = Some(md_parsed_msg);
m.format = Some(String::from("org.matrix.custom.html"));
}
......@@ -2865,7 +2866,8 @@ impl App {
let mut op = self.op.clone();
msg_entry.connect_activate(move |entry| if let Some(text) = entry.get_text() {
op.lock().unwrap().send_message(text);
let mut mut_text = text;
op.lock().unwrap().send_message(mut_text);
entry.set_text("");
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment