diff --git a/src/config.rs b/src/config.rs index e719ac389..2350f75f0 100644 --- a/src/config.rs +++ b/src/config.rs @@ -452,6 +452,10 @@ pub enum Config { /// The options are from the `WhoCanCallMe` enum. #[strum(props(default = "1"))] WhoCanCallMe, + + /// Experimental option denoting that the current profile is shared between multiple team members. + /// For now, the only effect of this option is that seen flags are not synchronized. + TeamProfile, } impl Config { diff --git a/src/context.rs b/src/context.rs index 12c3f645d..d6f72f491 100644 --- a/src/context.rs +++ b/src/context.rs @@ -1106,6 +1106,10 @@ impl Context { .await? .unwrap_or_default(), ); + res.insert( + "team_profile", + self.get_config_bool(Config::TeamProfile).await?.to_string(), + ); let elapsed = time_elapsed(&self.creation_time); res.insert("uptime", duration_to_str(elapsed)); diff --git a/src/imap.rs b/src/imap.rs index 0806c14a9..84c91ba63 100644 --- a/src/imap.rs +++ b/src/imap.rs @@ -1112,6 +1112,11 @@ impl Session { /// Stores pending `\Seen` flags for messages in `imap_markseen` table. pub(crate) async fn store_seen_flags_on_imap(&mut self, context: &Context) -> Result<()> { + if context.get_config_bool(Config::TeamProfile).await? { + info!(context, "Team profile, skipping seen flag synchronization."); + return Ok(()); + } + let rows = context .sql .query_map_vec( @@ -1180,6 +1185,11 @@ impl Session { return Ok(()); } + if context.get_config_bool(Config::TeamProfile).await? { + info!(context, "Team profile, skipping seen flag synchronization."); + return Ok(()); + } + let create = false; let folder_exists = self .select_with_uidvalidity(context, folder, create)