Implement reactions

Co-Authored-By: bjoern <r10s@b44t.com>
Co-Authored-By: Simon Laux <mobile.info@simonlaux.de>
This commit is contained in:
link2xt
2022-10-21 19:29:02 +00:00
parent cd15a0e966
commit e5c9fea52d
29 changed files with 983 additions and 28 deletions

View File

@@ -22,6 +22,7 @@ use crate::imap::markseen_on_imap_table;
use crate::mimeparser::{parse_message_id, DeliveryReport, SystemMessage};
use crate::param::{Param, Params};
use crate::pgp::split_armored_data;
use crate::reaction::get_msg_reactions;
use crate::scheduler::InterruptInfo;
use crate::sql;
use crate::stock_str;
@@ -751,6 +752,11 @@ impl Message {
self.param.set_int(Param::Duration, duration);
}
/// Marks the message as reaction.
pub(crate) fn set_reaction(&mut self) {
self.param.set_int(Param::Reaction, 1);
}
pub async fn latefiling_mediasize(
&mut self,
context: &Context,
@@ -1082,6 +1088,11 @@ pub async fn get_msg_info(context: &Context, msg_id: MsgId) -> Result<String> {
ret += "\n";
let reactions = get_msg_reactions(context, msg_id).await?;
if !reactions.is_empty() {
ret += &format!("Reactions: {}\n", reactions);
}
if let Some(error) = msg.error.as_ref() {
ret += &format!("Error: {}", error);
}