mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07: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();
|
SpannableStringBuilder stringBuilder = new SpannableStringBuilder();
|
||||||
|
|
||||||
if (privacy.isDisplayContact() && threadRecipient.isGroupRecipient()) {
|
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()) {
|
if (privacy.isDisplayMessage()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user