Skip to content

Commit

Permalink
fix: remove You/null from self deleting notification (WPB-3553) (#2098)
Browse files Browse the repository at this point in the history
Co-authored-by: Alexandre Ferris <ferris.alexandre@gmail.com>
  • Loading branch information
github-actions[bot] and alexandreferris committed Aug 14, 2023
1 parent 2000815 commit 98db6d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,16 @@ class MessageNotificationManager
private fun NotificationMessage.intoStyledMessage(): NotificationCompat.MessagingStyle.Message {
val sender = Person.Builder()
.apply {
if (this@intoStyledMessage !is NotificationMessage.ObfuscatedMessage) {
if (this@intoStyledMessage is NotificationMessage.ObfuscatedMessage) {
setName(context.getString(R.string.notification_obfuscated_message_title))
} else {
author?.name.also {
setName(it)
}
}
author?.image?.toBitmap()?.let {
setIcon(IconCompat.createWithAdaptiveBitmap(it))

author?.image?.toBitmap()?.let {
setIcon(IconCompat.createWithAdaptiveBitmap(it))
}
}
}
.build()
Expand All @@ -273,7 +276,9 @@ class MessageNotificationManager
is NotificationMessage.ConnectionRequest -> italicTextFromResId(R.string.notification_connection_request)
is NotificationMessage.ConversationDeleted -> italicTextFromResId(R.string.notification_conversation_deleted)
is NotificationMessage.Knock -> italicTextFromResId(R.string.notification_knock)
is NotificationMessage.ObfuscatedMessage -> italicTextFromResId(R.string.notification_obfuscated_message)
is NotificationMessage.ObfuscatedMessage -> italicTextFromResId(
R.string.notification_obfuscated_message_content
)
}
return NotificationCompat.MessagingStyle.Message(message, time, sender)
}
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,8 @@
<string name="label_log_options_description">"This stores anonymized troubleshooting information locally. "</string>

<string name="label_no_application_found_open_downloads_folder">"No application found to open downloads folder"</string>
<string name="notification_obfuscated_message">Someone sent a Message</string>
<string name="notification_obfuscated_message_title">Someone</string>
<string name="notification_obfuscated_message_content">Sent a self-deleting message</string>
<string name="settings_licenses_settings_label">License Information</string>
<string name="settings_myaccount_logout">Delete Account</string>
<string name="app_not_found_for_action">No Application has been found to do Action</string>
Expand Down

0 comments on commit 98db6d7

Please sign in to comment.