Fix order of execution.

This commit is contained in:
Mikunj 2019-09-09 13:20:59 +10:00
parent 842be4378a
commit 7c6c551b32
2 changed files with 3 additions and 2 deletions

View File

@ -95,10 +95,10 @@ class LokiGroupChatPoller(private val context: Context, private val group: LokiG
val x2 = SignalServiceDataMessage(message.timestamp, x1, null, message.body) val x2 = SignalServiceDataMessage(message.timestamp, x1, null, message.body)
val x3 = SignalServiceContent(x2, message.hexEncodedPublicKey, SignalServiceAddress.DEFAULT_DEVICE_ID, message.timestamp, false) val x3 = SignalServiceContent(x2, message.hexEncodedPublicKey, SignalServiceAddress.DEFAULT_DEVICE_ID, message.timestamp, false)
PushDecryptJob(context).handleTextMessage(x3, x2, Optional.absent(), Optional.of(message.serverID))
val senderDisplayName = "${message.displayName} (...${message.hexEncodedPublicKey.takeLast(8)})" val senderDisplayName = "${message.displayName} (...${message.hexEncodedPublicKey.takeLast(8)})"
DatabaseFactory.getLokiUserDatabase(context).setServerDisplayName(group.id, message.hexEncodedPublicKey, senderDisplayName) DatabaseFactory.getLokiUserDatabase(context).setServerDisplayName(group.id, message.hexEncodedPublicKey, senderDisplayName)
PushDecryptJob(context).handleTextMessage(x3, x2, Optional.absent(), Optional.of(message.serverID))
} }
fun processOutgoingMessage(message: LokiGroupMessage) { fun processOutgoingMessage(message: LokiGroupMessage) {
val messageServerID = message.serverID ?: return val messageServerID = message.serverID ?: return

View File

@ -57,6 +57,7 @@ class LokiUserDatabase(context: Context, helper: SQLCipherOpenHelper) : Database
values.put(Companion.displayName, displayName) values.put(Companion.displayName, displayName)
try { try {
database.insertWithOnConflict(serverDisplayNameTable, null, values, SQLiteDatabase.CONFLICT_REPLACE) database.insertWithOnConflict(serverDisplayNameTable, null, values, SQLiteDatabase.CONFLICT_REPLACE)
Recipient.from(context, Address.fromSerialized(hexEncodedPublicKey), false).notifyListeners()
} catch (e: Exception) { } catch (e: Exception) {
print(e) print(e)
} }