Skip to content

Commit 0b5ad2f

Browse files
committed
Fixes #14080: Show "declined" string for call instead of "missed"
1 parent 7f42f35 commit 0b5ad2f

File tree

3 files changed

+25
-12
lines changed

3 files changed

+25
-12
lines changed

app/src/main/java/org/thoughtcrime/securesms/components/settings/conversation/preferences/CallPreference.kt

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,25 @@ object CallPreference {
8383

8484
@StringRes
8585
private fun getMissedCallString(isVideo: Boolean, callEvent: CallTable.Event): Int {
86-
return if (callEvent == CallTable.Event.MISSED_NOTIFICATION_PROFILE) {
87-
if (isVideo) {
88-
R.string.MessageRecord_missed_video_call_notification_profile
89-
} else {
90-
R.string.MessageRecord_missed_voice_call_notification_profile
91-
}
92-
} else {
93-
if (isVideo) {
94-
R.string.MessageRecord_missed_video_call
95-
} else {
96-
R.string.MessageRecord_missed_voice_call
97-
}
86+
return when (callEvent) {
87+
CallTable.Event.MISSED_NOTIFICATION_PROFILE ->
88+
if (isVideo) {
89+
R.string.MessageRecord_missed_video_call_notification_profile
90+
} else {
91+
R.string.MessageRecord_missed_voice_call_notification_profile
92+
}
93+
CallTable.Event.NOT_ACCEPTED ->
94+
if (isVideo) {
95+
R.string.MessageRecord_declined_video_call
96+
} else {
97+
R.string.MessageRecord_declined_voice_call
98+
}
99+
else ->
100+
if (isVideo) {
101+
R.string.MessageRecord_missed_video_call
102+
} else {
103+
R.string.MessageRecord_missed_voice_call
104+
}
98105
}
99106
}
100107

app/src/main/java/org/thoughtcrime/securesms/database/model/MmsMessageRecord.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ public SpannableString getDisplayBody(@NonNull Context context) {
267267
int message;
268268
if (call.getEvent() == CallTable.Event.MISSED_NOTIFICATION_PROFILE) {
269269
message = isVideoCall ? R.string.MessageRecord_missed_video_call_notification_profile : R.string.MessageRecord_missed_voice_call_notification_profile;
270+
} else if (call.getEvent() == CallTable.Event.NOT_ACCEPTED){
271+
message = isVideoCall ? R.string.MessageRecord_declined_video_call : R.string.MessageRecord_declined_voice_call;
270272
} else {
271273
message = isVideoCall ? R.string.MessageRecord_missed_video_call : R.string.MessageRecord_missed_voice_call;
272274
}

app/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,6 +1787,10 @@
17871787
<string name="MessageRecord_missed_voice_call">Missed voice call</string>
17881788
<!-- Update message shown when receiving an incoming 1:1 video call and not answered -->
17891789
<string name="MessageRecord_missed_video_call">Missed video call</string>
1790+
<!-- Update message shown when receiving an incoming 1:1 voice/audio call and not answered -->
1791+
<string name="MessageRecord_declined_voice_call">Declined voice call</string>
1792+
<!-- Update message shown when receiving an incoming 1:1 video call and not answered -->
1793+
<string name="MessageRecord_declined_video_call">Declined video call</string>
17901794
<!-- Update message shown when receiving an incoming voice call and declined due to notification profile -->
17911795
<string name="MessageRecord_missed_voice_call_notification_profile">Missed voice call while notification profile on</string>
17921796
<!-- Update message shown when receiving an incoming video call and declined due to notification profile -->

0 commit comments

Comments
 (0)