Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/Threema/Utilities/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 959 B image not shown  

Quelle  EventEnricher.swift   Sprache: JAVA

 

import Foundation
import Sentry
import ThreemaFramework

/// Identifies an event by the anonymized app device hash instead of by the user.
struct EventEnricher {

    /// Persists the anonymized app device hash. Defaults to `UserSettings`.
    var saveAppDevice: (String) -> Void = { UserSettings.shared()?.sentryAppDevice = $0 }

    /// Replaces the event's user with one identified only by the app device hash, so events can be
    /// counted per device in the Sentry UI without identifying anyone.
    func enrich(_ event: Sentry.Event) {
        guard let appDevice = event.context?["app"]?["device_app_hash"] as? String else {
            return
        }

        // Save anonymous app device, it will be displayed under Settings -> Advanced
        saveAppDevice(appDevice)

        // Send app device hash to count users per event on sentry ui
        // swiftformat:disable:next acronyms
        event.user = Sentry.User(userId: appDevice)
    }
}

Messung
CHZG
869410093

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.