mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2024-10-01 01:06:10 -04:00
Send optout for real and only once.
This commit is contained in:
parent
8fe60c29fb
commit
8aed93daa5
@ -178,7 +178,7 @@ void Network::sendOptOut()
|
|||||||
|
|
||||||
QJsonDocument doc;
|
QJsonDocument doc;
|
||||||
doc.setArray(array);
|
doc.setArray(array);
|
||||||
sendMixpanel(doc.toJson());
|
sendMixpanel(doc.toJson(), true /*isOptOut*/);
|
||||||
|
|
||||||
#if defined(DEBUG)
|
#if defined(DEBUG)
|
||||||
printf("%s %s\n", qPrintable("opt_out"), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
printf("%s %s\n", qPrintable("opt_out"), qPrintable(doc.toJson(QJsonDocument::Indented)));
|
||||||
@ -272,9 +272,9 @@ void Network::sendIpify()
|
|||||||
connect(reply, &QNetworkReply::finished, this, &Network::handleIpifyFinished);
|
connect(reply, &QNetworkReply::finished, this, &Network::handleIpifyFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Network::sendMixpanel(const QByteArray &json)
|
void Network::sendMixpanel(const QByteArray &json, bool isOptOut)
|
||||||
{
|
{
|
||||||
if (!m_usageStatsActive)
|
if (!m_usageStatsActive && !isOptOut)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QUrl trackUrl("https://api.mixpanel.com/track");
|
QUrl trackUrl("https://api.mixpanel.com/track");
|
||||||
|
@ -47,7 +47,7 @@ private:
|
|||||||
void sendHealth();
|
void sendHealth();
|
||||||
void sendIpify();
|
void sendIpify();
|
||||||
void sendMixpanelEvent(const QString &event);
|
void sendMixpanelEvent(const QString &event);
|
||||||
void sendMixpanel(const QByteArray &json);
|
void sendMixpanel(const QByteArray &json, bool isOptOut = false);
|
||||||
bool packageAndSendJson(const QString &ingestId, const QString &json);
|
bool packageAndSendJson(const QString &ingestId, const QString &json);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -21,14 +21,6 @@ Dialog {
|
|||||||
id: theme
|
id: theme
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: startupDialog
|
|
||||||
function onClosed() {
|
|
||||||
if (!Network.usageStatsActive)
|
|
||||||
Network.usageStatsActive = false // opt-out triggered
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: column
|
id: column
|
||||||
spacing: 20
|
spacing: 20
|
||||||
|
Loading…
Reference in New Issue
Block a user