We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5b98030 commit 46a5ff7Copy full SHA for 46a5ff7
src/statistics.rs
@@ -185,6 +185,17 @@ pub(crate) async fn set_last_excluded_msg_id(context: &Context) -> Result<()> {
185
}
186
187
pub(crate) async fn set_last_old_contact_id(context: &Context) -> Result<()> {
188
+ let config_exists = context
189
+ .sql
190
+ .get_raw_config(Config::StatsLastOldContactId.as_ref())
191
+ .await?
192
+ .is_some();
193
+ if config_exists {
194
+ // The user had statistics-sending enabled already in the past,
195
+ // keep the 'last old contact id' as-is
196
+ return Ok(());
197
+ }
198
+
199
let last_contact_id: u64 = context
200
.sql
201
.query_get_value("SELECT MAX(id) FROM contacts", ())
0 commit comments