     }
     
     func launchBackgroundSync(forEventId eventId: String) {
-        guard let mxSession = mxSession else {
+        guard let mxSession = NotificationService.mxSession else {
             NSLog("[NotificationService] launchBackgroundSync: mxSession is missing.")
             self.fallbackToOriginalContent(forEventId: eventId)
             return

    }
    
    func processEvent(_ event: MXEvent) {
        guard let content = originalContents[event.eventId], let mxSession = mxSession else {
            self.fallbackToOriginalContent(forEventId: event.eventId)
            return
        }

    
    /// Cached events. Keys are eventId's
    var cachedEvents: [String: MXEvent] = [:]
    static var mxSession: MXSession?
    static var store: NSEMemoryStore!
    lazy var showDecryptedContentInNotifications: Bool = {
        return RiotSettings.shared.showDecryptedContentInNotifications
