Update for core changes

This commit is contained in:
Niels Andriesse 2019-06-24 14:57:53 +10:00
parent 1023227744
commit a3d23e55a1
3 changed files with 9 additions and 3 deletions

View File

@ -44,6 +44,7 @@ import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
import org.thoughtcrime.securesms.util.JsonUtils;
import org.thoughtcrime.securesms.util.TextSecurePreferences;
import org.whispersystems.libsignal.util.guava.Optional;
import org.whispersystems.signalservice.loki.messaging.LokiMessageFriendRequestStatus;
import java.io.IOException;
import java.security.SecureRandom;
@ -661,6 +662,11 @@ public class SmsDatabase extends MessagingDatabase {
ApplicationContext.getInstance(context).getJobManager().add(new TrimThreadJob(threadId));
}
// Loki - Set message friend request status
if (message.isFriendRequest) {
DatabaseFactory.getLokiMessageFriendRequestDatabase(context).setFriendRequestStatus(messageId, LokiMessageFriendRequestStatus.REQUEST_SENDING_OR_FAILED);
}
return messageId;
}

View File

@ -14,9 +14,9 @@ import org.whispersystems.libsignal.IdentityKey
import org.whispersystems.libsignal.ecc.Curve
import org.whispersystems.libsignal.state.PreKeyBundle
import org.whispersystems.signalservice.api.push.SignalServiceAddress
import org.whispersystems.signalservice.loki.messaging.LokiPreKeyDatabaseProtocol
import org.whispersystems.signalservice.loki.messaging.LokiPreKeyBundleDatabaseProtocol
class LokiPreKeyBundleDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), LokiPreKeyDatabaseProtocol {
class LokiPreKeyBundleDatabase(context: Context, helper: SQLCipherOpenHelper) : Database(context, helper), LokiPreKeyBundleDatabaseProtocol {
companion object {
private val tableName = "loki_pre_key_bundle_database"

View File

@ -21,7 +21,7 @@ class LokiThreadFriendRequestDatabase(context: Context, helper: SQLCipherOpenHel
return DatabaseFactory.getSmsDatabase(context).getThreadIdForMessage(messageID)
}
override fun getFriendRequestStatus(threadID: Long): LokiThreadFriendRequestStatus {
fun getFriendRequestStatus(threadID: Long): LokiThreadFriendRequestStatus {
val database = databaseHelper.readableDatabase
val result = database.get(tableName, "${Companion.threadID} = ?", arrayOf( threadID.toString() )) { cursor ->
cursor.getInt(friendRequestStatus)