From 9981a03327382e5a0b9d0d213767780368c1423b Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Thu, 21 Jan 2021 13:52:14 +0300 Subject: [PATCH] Do not show tile for incoming call --- .../Direct/RoomDirectCallStatusBubbleCell.swift | 8 ++++++-- Riot/Utils/EventFormatter.m | 13 +++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift b/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift index 23b534e3a..8a5391c8b 100644 --- a/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift +++ b/Riot/Modules/Room/Views/BubbleCells/Call/Direct/RoomDirectCallStatusBubbleCell.swift @@ -73,8 +73,12 @@ class RoomDirectCallStatusBubbleCell: RoomBaseCallBubbleCell { .remotelyOnHold: statusTextView.text = VectorL10n.eventFormatterCallYouCurrentlyIn case .ringing: - // TODO: Waiting for design decision here - statusTextView.text = nil + if call.isIncoming { + // should not be here + statusTextView.text = nil + } else { + statusTextView.text = VectorL10n.eventFormatterCallYouCurrentlyIn + } case .ended: switch call.endReason { case .unknown, diff --git a/Riot/Utils/EventFormatter.m b/Riot/Utils/EventFormatter.m index ba8303469..6dd3aa6ce 100644 --- a/Riot/Utils/EventFormatter.m +++ b/Riot/Utils/EventFormatter.m @@ -26,6 +26,7 @@ #import "DecryptionFailureTracker.h" #import "EventFormatter+DTCoreTextFix.h" +#import #pragma mark - Constants definitions @@ -198,6 +199,18 @@ static NSString *const kEventFormatterTimeFormat = @"HH:mm"; case MXEventTypeCallRejectReplacement: // Do not show call events except invite and reject in timeline return nil; + case MXEventTypeCallInvite: + { + MXCallInviteEventContent *content = [MXCallInviteEventContent modelFromJSON:event.content]; + MXCall *call = [mxSession.callManager callWithCallId:content.callId]; + if (call && call.isIncoming && call.state == MXCallStateRinging) + { + // incoming call UI will be handled by CallKit (or incoming call screen if CallKit disabled) + // do not show a bubble for this case + return nil; + } + } + break; case MXEventTypeKeyVerificationCancel: case MXEventTypeKeyVerificationDone: // Make event types MXEventTypeKeyVerificationCancel and MXEventTypeKeyVerificationDone visible in timeline.