From 0c43e11d4653e5584dc6c469f695366bb72d8228 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 1 Apr 2026 23:23:45 +0000 Subject: [PATCH] refactor: observe call events from LocalCache instead of EventProcessor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove callManager injection from EventProcessor — let the existing gift wrap pipeline consume and index call events normally. Instead, observe new notes from LocalCache.live.newEventBundles in AccountViewModel and route call signaling events to CallManager from there. This keeps the EventProcessor clean and follows the existing pattern for UI-layer event observation. https://claude.ai/code/session_017hZm7yu7CzmcQgZGSaqSXS --- .../loggedIn/DecryptAndIndexProcessor.kt | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt index b36bf9d3d..a569b5ac9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/DecryptAndIndexProcessor.kt @@ -20,7 +20,6 @@ */ package com.vitorpamplona.amethyst.ui.screen.loggedIn -import com.vitorpamplona.amethyst.commons.call.CallManager import com.vitorpamplona.amethyst.commons.model.privateChats.ChatroomList import com.vitorpamplona.amethyst.model.Account import com.vitorpamplona.amethyst.model.LocalCache @@ -37,19 +36,12 @@ import com.vitorpamplona.quartz.nip57Zaps.LnZapRequestEvent import com.vitorpamplona.quartz.nip57Zaps.PrivateZapCache import com.vitorpamplona.quartz.nip59Giftwrap.seals.SealedRumorEvent import com.vitorpamplona.quartz.nip59Giftwrap.wraps.GiftWrapEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallAnswerEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallHangupEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallIceCandidateEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallOfferEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallRejectEvent -import com.vitorpamplona.quartz.nipACWebRtcCalls.events.CallRenegotiateEvent import com.vitorpamplona.quartz.utils.Log import kotlinx.coroutines.CancellationException class EventProcessor( private val account: Account, private val cache: LocalCache, - var callManager: CallManager? = null, ) { private val chatHandler = ChatHandler(account.chatroomList) private val draftHandler = DraftEventHandler(account, cache) @@ -76,22 +68,10 @@ class EventProcessor( publicNote: Note, ) { when (event) { - is CallOfferEvent, - is CallAnswerEvent, - is CallIceCandidateEvent, - is CallHangupEvent, - is CallRejectEvent, - is CallRenegotiateEvent, - -> callManager?.onSignalingEvent(event) - is ChatroomKeyable -> chatHandler.add(event, eventNote, publicNote) - is DraftWrapEvent -> draftHandler.add(event, eventNote, publicNote) - is GiftWrapEvent -> giftWrapHandler.add(event, eventNote, publicNote) - is SealedRumorEvent -> sealHandler.add(event, eventNote, publicNote) - is LnZapRequestEvent -> zapRequest.add(event, eventNote, publicNote) } }