diff options
author | Petr Mrázek <peterix@gmail.com> | 2016-11-21 21:18:30 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2016-11-21 21:18:30 +0100 |
commit | ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de (patch) | |
tree | c6eb6056e54d51dce33c46cd28b1cc920f144dde /libraries/ganalytics | |
parent | 95f961fb6102f782482c057f51dae8ae8aed966c (diff) | |
download | MultiMC-ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de.tar MultiMC-ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de.tar.gz MultiMC-ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de.tar.lz MultiMC-ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de.tar.xz MultiMC-ee6f2f0a8ebdeede68b6768e1d75d047ec2c50de.zip |
NOISSUE implement analytics IP anonymization
Diffstat (limited to 'libraries/ganalytics')
-rw-r--r-- | libraries/ganalytics/include/ganalytics.h | 3 | ||||
-rw-r--r-- | libraries/ganalytics/src/ganalytics.cpp | 10 | ||||
-rw-r--r-- | libraries/ganalytics/src/ganalytics_worker.cpp | 6 | ||||
-rw-r--r-- | libraries/ganalytics/src/ganalytics_worker.h | 3 |
4 files changed, 20 insertions, 2 deletions
diff --git a/libraries/ganalytics/include/ganalytics.h b/libraries/ganalytics/include/ganalytics.h index 7cbd2c85..48025dc1 100644 --- a/libraries/ganalytics/include/ganalytics.h +++ b/libraries/ganalytics/include/ganalytics.h @@ -33,6 +33,9 @@ public: void setLanguage(const QString &language); QString language() const; + void setAnonymizeIPs(bool anonymize); + bool anonymizeIPs(); + void setSendInterval(int milliseconds); int sendInterval() const; diff --git a/libraries/ganalytics/src/ganalytics.cpp b/libraries/ganalytics/src/ganalytics.cpp index 8d25efe9..a03dfcad 100644 --- a/libraries/ganalytics/src/ganalytics.cpp +++ b/libraries/ganalytics/src/ganalytics.cpp @@ -60,6 +60,16 @@ QString GAnalytics::language() const return d->m_language; } +void GAnalytics::setAnonymizeIPs(bool anonymize) +{ + d->m_anonymizeIPs = anonymize; +} + +bool GAnalytics::anonymizeIPs() +{ + return d->m_anonymizeIPs; +} + void GAnalytics::setSendInterval(int milliseconds) { d->m_timer.setInterval(milliseconds); diff --git a/libraries/ganalytics/src/ganalytics_worker.cpp b/libraries/ganalytics/src/ganalytics_worker.cpp index 01aa69ce..2b03e14c 100644 --- a/libraries/ganalytics/src/ganalytics_worker.cpp +++ b/libraries/ganalytics/src/ganalytics_worker.cpp @@ -12,7 +12,7 @@ const QLatin1String GAnalyticsWorker::dateTimeFormat("yyyy,MM,dd-hh:mm::ss:zzz"); GAnalyticsWorker::GAnalyticsWorker(GAnalytics *parent) - : QObject(parent), q(parent), m_logLevel(GAnalytics::Error), m_isSending(false) + : QObject(parent), q(parent), m_logLevel(GAnalytics::Error) { m_appName = QCoreApplication::instance()->applicationName(); m_appVersion = QCoreApplication::instance()->applicationVersion(); @@ -57,6 +57,10 @@ QUrlQuery GAnalyticsWorker::buildStandardPostQuery(const QString &type) query.addQueryItem("ul", m_language); query.addQueryItem("vp", m_viewportSize); query.addQueryItem("sr", m_screenResolution); + if(m_anonymizeIPs) + { + query.addQueryItem("aip", "1"); + } return query; } diff --git a/libraries/ganalytics/src/ganalytics_worker.h b/libraries/ganalytics/src/ganalytics_worker.h index 280f9ab2..88fa223a 100644 --- a/libraries/ganalytics/src/ganalytics_worker.h +++ b/libraries/ganalytics/src/ganalytics_worker.h @@ -37,7 +37,8 @@ public: QString m_screenResolution; QString m_viewportSize; - bool m_isSending; + bool m_anonymizeIPs = false; + bool m_isSending = false; const static int fourHours = 4 * 60 * 60 * 1000; const static QLatin1String dateTimeFormat; |