From 27c561aeb7e8c2cf1843247892e1347417afbd8c Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 1 May 2024 12:08:40 -0400 Subject: [PATCH] mixpanel: fix opt-out events after #2238 (#2296) Signed-off-by: Jared Van Bortel --- gpt4all-chat/network.cpp | 7 ++----- gpt4all-chat/network.h | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gpt4all-chat/network.cpp b/gpt4all-chat/network.cpp index 499ca7ff..45a9a4f7 100644 --- a/gpt4all-chat/network.cpp +++ b/gpt4all-chat/network.cpp @@ -228,7 +228,7 @@ void Network::sendOptOut() QJsonDocument doc; doc.setArray(array); - emit requestMixpanel(doc.toJson(QJsonDocument::Compact), true /*isOptOut*/); + emit requestMixpanel(doc.toJson(QJsonDocument::Compact)); #if defined(DEBUG) printf("%s %s\n", qPrintable("opt_out"), qPrintable(doc.toJson(QJsonDocument::Indented))); @@ -339,11 +339,8 @@ void Network::sendIpify() connect(reply, &QNetworkReply::finished, this, &Network::handleIpifyFinished); } -void Network::sendMixpanel(const QByteArray &json, bool isOptOut) +void Network::sendMixpanel(const QByteArray &json) { - if (!m_sendUsageStats) - return; - QUrl trackUrl("https://api.mixpanel.com/track"); QNetworkRequest request(trackUrl); QSslConfiguration conf = request.sslConfiguration(); diff --git a/gpt4all-chat/network.h b/gpt4all-chat/network.h index 70896cf3..5e9f6e6e 100644 --- a/gpt4all-chat/network.h +++ b/gpt4all-chat/network.h @@ -37,7 +37,7 @@ private Q_SLOTS: void handleMixpanelFinished(); void handleIsActiveChanged(); void handleUsageStatsActiveChanged(); - void sendMixpanel(const QByteArray &json, bool isOptOut); + void sendMixpanel(const QByteArray &json); private: void sendOptOut();