diff --git a/apps/rebreak-native/lib/callkit.ts b/apps/rebreak-native/lib/callkit.ts index cc29075..c89eba3 100644 --- a/apps/rebreak-native/lib/callkit.ts +++ b/apps/rebreak-native/lib/callkit.ts @@ -100,6 +100,13 @@ export function displayIncomingCall(callId: string, callerName: string): void { } export function startOutgoingCall(callId: string, calleeName: string): void { + // Android: NICHT aufrufen \u2014 `RNCallKeep.startCall` triggert + // `telecomManager.placeCall` was die System-Telefon-Wahl-UI \u00f6ffnet. F\u00fcr + // In-App-WebRTC-Calls v\u00f6llig falsch (User sieht "Telefon w\u00e4hlt\u2026" statt + // unserem /call-Screen). iOS-CallKit macht das richtig (Audio-Session + // setup, keine native UI weil supportsHolding=false und wir keine + // CXEndCallAction triggern bis User auflegt). + if (Platform.OS !== 'ios') return; try { const uuid = callIdToUuid(callId); RNCallKeep.startCall(uuid, calleeName, calleeName, 'generic', false); diff --git a/backend/server/api/calls/ring.post.ts b/backend/server/api/calls/ring.post.ts index b64b307..9f0231a 100644 --- a/backend/server/api/calls/ring.post.ts +++ b/backend/server/api/calls/ring.post.ts @@ -39,6 +39,8 @@ export default defineEventHandler(async (event) => { const callerName = me.nickname || me.username || "Jemand"; + console.log(`[ring] from=${me.id.slice(0,8)} (${callerName}) → to=${peerId.slice(0,8)} callId=${callId}`); + // Fire-and-forget — auch wenn der Push fehlschlägt soll der Caller // keine Verzögerung sehen. Der Realtime-Ring läuft parallel. void sendCallRingPush({ diff --git a/backend/server/db/chat.ts b/backend/server/db/chat.ts index 8e48d91..db6885f 100644 --- a/backend/server/db/chat.ts +++ b/backend/server/db/chat.ts @@ -66,11 +66,30 @@ export async function sendDirectMessage( "../services/push" ); const senderName = await getDisplayName(senderId); - const preview = truncatePreview( - content || - (opts?.attachmentType === "audio" ? "🎤 Sprachnachricht" : - opts?.attachmentType === "image" || opts?.attachmentUrl ? "📷 Foto" : "") - ); + // Call-DM-Eintrag (attachmentType='call', attachmentName='::') + // → schöne Preview statt leeren String. Bei verpassten/abgelehnten Calls + // ist content immer "". + let basePreview = content; + if (opts?.attachmentType === "call" && opts.attachmentName) { + const [, state, durSecStr] = opts.attachmentName.split(":"); + const durSec = parseInt(durSecStr ?? "0", 10) || 0; + if (state === "unanswered") basePreview = "📞 Verpasster Anruf"; + else if (state === "declined") basePreview = "📞 Anruf abgelehnt"; + else if (state === "failed") basePreview = "📞 Anruf fehlgeschlagen"; + else if (state === "busy") basePreview = "📞 Besetzt"; + else if (state === "ended") { + const mm = Math.floor(durSec / 60); + const ss = String(durSec % 60).padStart(2, "0"); + basePreview = `📞 Anruf (${mm}:${ss})`; + } else { + basePreview = "📞 Anruf"; + } + } else if (!basePreview) { + basePreview = + opts?.attachmentType === "audio" ? "🎤 Sprachnachricht" : + (opts?.attachmentType === "image" || opts?.attachmentUrl) ? "📷 Foto" : ""; + } + const preview = truncatePreview(basePreview); console.log(`[dm-push] sender=${senderId} receiver=${receiverId} preview="${preview.slice(0, 30)}"`); await sendChatPush({ receiverId, diff --git a/backend/server/services/voip-push.ts b/backend/server/services/voip-push.ts index 4151a9f..ce90690 100644 --- a/backend/server/services/voip-push.ts +++ b/backend/server/services/voip-push.ts @@ -138,6 +138,7 @@ export async function sendVoIPPush(payload: VoIPCallPayload): Promise { const result = await prov.send(note, payload.voipToken); if (result.failed.length === 0) { tokenEnvCache.set(payload.voipToken, env); + console.log(`[voip-push] sent token=${payload.voipToken.slice(0, 8)}… env=${env} callId=${payload.callId}`); return true; } const f = result.failed[0];