Parse display name from messages

pull/2/head
Niels Andriesse 5 years ago
parent 244d4fd899
commit acae76161d

@ -252,7 +252,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
return;
}
// Loki - Handle Loki specific messages
// Loki - Handle Loki specific logic if needed
if (content.lokiMessage.isPresent()) {
LokiServiceMessage lokiMessage = content.lokiMessage.get();
if (lokiMessage.getPreKeyBundleMessage() != null) {
@ -269,6 +269,11 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
}
}
Optional<String> senderDisplayName = content.senderDisplayName;
if (senderDisplayName.isPresent()) {
// TODO: Use display name
}
if (content.getDataMessage().isPresent()) {
SignalServiceDataMessage message = content.getDataMessage().get();
boolean isMediaMessage = message.getAttachments().isPresent() || message.getQuote().isPresent() || message.getSharedContacts().isPresent() || message.getPreviews().isPresent();

@ -77,6 +77,10 @@ class LokiAPIDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(
val row = wrap(mapOf( userID to userPublicKey, receivedMessageHashValues to receivedMessageHashValuesAsString ))
database.insertOrUpdate(receivedMessageHashValuesCache, row, "$userID = ?", wrap(userPublicKey))
}
override fun getUserDisplayName(): String? {
return TextSecurePreferences.getProfileName(context)
}
}
// region Convenience

Loading…
Cancel
Save