-
-
Notifications
You must be signed in to change notification settings - Fork 105
Opt-in weekly sending of statistics #6851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
b1c57ee
5b98030
46a5ff7
b0687fd
bb83934
90ccb43
4314864
2524c8f
cbf8697
91f2e9f
c94055f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ use tokio::fs; | |
|
||
use crate::blob::BlobObject; | ||
use crate::configure::EnteredLoginParam; | ||
use crate::constants; | ||
use crate::context::Context; | ||
use crate::events::EventType; | ||
use crate::log::{LogExt, info}; | ||
|
@@ -23,6 +22,7 @@ use crate::mimefactory::RECOMMENDED_FILE_SIZE; | |
use crate::provider::{Provider, get_provider_by_id}; | ||
use crate::sync::{self, Sync::*, SyncData}; | ||
use crate::tools::get_abs_path; | ||
use crate::{constants, statistics}; | ||
|
||
/// The available configuration keys. | ||
#[derive( | ||
|
@@ -431,9 +431,26 @@ pub enum Config { | |
/// used for signatures, encryption to self and included in `Autocrypt` header. | ||
KeyId, | ||
|
||
/// This key is sent to the self_reporting bot so that the bot can recognize the user | ||
/// Send statistics to Delta Chat's developers. | ||
/// Can be exposed to the user as a setting. | ||
SendStatistics, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe prefix everything with |
||
|
||
/// Last time statistics were sent to Delta Chat's developers | ||
LastStatisticsSent, | ||
|
||
/// This key is sent to the statistics bot so that the bot can recognize the user | ||
/// without storing the email address | ||
SelfReportingId, | ||
StatisticsId, | ||
|
||
/// The last message id that was already included in the previously sent statistics, | ||
/// or that already existed before the user opted in. | ||
/// Only messages with an id larger than this | ||
/// will be counted in the next statistics. | ||
StatsLastExcludedMsgId, | ||
|
||
/// The last contact id that already existed when statistics-sending was enabled. | ||
/// All newer contacts get the `"new": true` attribute. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
StatsLastOldContactId, | ||
|
||
/// MsgId of webxdc map integration. | ||
WebxdcIntegration, | ||
|
@@ -827,6 +844,11 @@ impl Context { | |
.await?; | ||
} | ||
} | ||
Config::SendStatistics => { | ||
self.sql.set_raw_config(key.as_ref(), value).await?; | ||
statistics::set_last_excluded_msg_id(self).await?; | ||
statistics::set_last_old_contact_id(self).await?; | ||
} | ||
_ => { | ||
self.sql.set_raw_config(key.as_ref(), value).await?; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ use crate::reaction::{Reaction, set_msg_reaction}; | |
use crate::rusqlite::OptionalExtension; | ||
use crate::securejoin::{self, handle_securejoin_handshake, observe_securejoin_on_other_device}; | ||
use crate::simplify; | ||
use crate::statistics::STATISTICS_BOT_EMAIL; | ||
use crate::stock_str; | ||
use crate::sync::Sync::*; | ||
use crate::tools::{self, buf_compress, remove_subject_prefix}; | ||
|
@@ -1744,7 +1745,11 @@ async fn add_parts( | |
|
||
let state = if !mime_parser.incoming { | ||
MessageState::OutDelivered | ||
} else if seen || is_mdn || chat_id_blocked == Blocked::Yes || group_changes.silent | ||
} else if seen | ||
|| is_mdn | ||
|| chat_id_blocked == Blocked::Yes | ||
|| group_changes.silent | ||
|| mime_parser.from.addr == STATISTICS_BOT_EMAIL | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the chat is archived and muted by default, maybe there's no need in this check? |
||
// No check for `hidden` because only reactions are such and they should be `InFresh`. | ||
{ | ||
MessageState::InSeen | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
source
anduipath
should be documented, their purpose and why they areu32
isn't clear when one sees this API for the first time.