mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-24 02:25:19 +00:00
Include public key with display names
This commit is contained in:
parent
dbb07d78b0
commit
cbb7f9827c
@ -292,12 +292,16 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loki - Get the sender display name if needed
|
// Loki - Store the sender display name if needed
|
||||||
Optional<String> senderDisplayName = content.senderDisplayName;
|
Optional<String> rawSenderDisplayName = content.senderDisplayName;
|
||||||
if (senderDisplayName.isPresent()) {
|
if (rawSenderDisplayName.isPresent() && rawSenderDisplayName.get().length() > 0) {
|
||||||
DatabaseFactory.getLokiUserDatabase(context).setDisplayName(envelope.getSource(), senderDisplayName.get());
|
String senderHexEncodedPublicKey = envelope.getSource();
|
||||||
|
String senderDisplayName = rawSenderDisplayName + " (..." + senderHexEncodedPublicKey.substring(senderHexEncodedPublicKey.length() - 8) + ")";
|
||||||
|
DatabaseFactory.getLokiUserDatabase(context).setDisplayName(senderHexEncodedPublicKey, senderDisplayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Deleting the display name
|
||||||
|
|
||||||
if (content.getDataMessage().isPresent()) {
|
if (content.getDataMessage().isPresent()) {
|
||||||
SignalServiceDataMessage message = content.getDataMessage().get();
|
SignalServiceDataMessage message = content.getDataMessage().get();
|
||||||
boolean isMediaMessage = message.getAttachments().isPresent() || message.getQuote().isPresent() || message.getSharedContacts().isPresent() || message.getPreviews().isPresent() || message.getSticker().isPresent();
|
boolean isMediaMessage = message.getAttachments().isPresent() || message.getQuote().isPresent() || message.getSharedContacts().isPresent() || message.getPreviews().isPresent() || message.getSticker().isPresent();
|
||||||
|
Loading…
Reference in New Issue
Block a user