mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 00:37:47 +00:00
Display username in notifications instead of public keys fixed
This commit is contained in:
parent
df1814800a
commit
ea0ba98722
@ -226,7 +226,18 @@ public class SingleRecipientNotificationBuilder extends AbstractNotificationBuil
|
||||
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||
|
||||
if (privacy.isDisplayContact() && threadRecipient.isGroupRecipient()) {
|
||||
stringBuilder.append(Util.getBoldedString(individualRecipient.toShortString() + ": "));
|
||||
long threadID = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(threadRecipient);
|
||||
LokiPublicChat publicChat = DatabaseFactory.getLokiThreadDatabase(context).getPublicChat(threadID);
|
||||
String hexEncodedPublicKey = individualRecipient.getAddress().toString();
|
||||
String displayName;
|
||||
if (publicChat != null) {
|
||||
displayName = DatabaseFactory.getLokiUserDatabase(context).getServerDisplayName(publicChat.getId(), hexEncodedPublicKey);
|
||||
} else {
|
||||
displayName = DatabaseFactory.getLokiUserDatabase(context).getDisplayName(hexEncodedPublicKey);
|
||||
}
|
||||
if (displayName != null) {
|
||||
stringBuilder.append(Util.getBoldedString(displayName + ": "));
|
||||
}
|
||||
}
|
||||
|
||||
if (privacy.isDisplayMessage()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user