Improve logging

This commit is contained in:
nielsandriesse 2020-05-19 13:59:19 +10:00
parent 5cb98d8fc3
commit a907d78916
2 changed files with 8 additions and 7 deletions

View File

@ -1451,6 +1451,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType {
}
if (SessionMetaProtocol.shouldIgnoreMessage(content)) {
Log.d("Loki", "Ignoring duplicate message.");
return true;
}

View File

@ -16,7 +16,6 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences
import org.whispersystems.libsignal.loki.LokiSessionResetStatus
import org.whispersystems.signalservice.api.messages.SignalServiceContent
import org.whispersystems.signalservice.loki.protocol.multidevice.MultiDeviceProtocol
import org.whispersystems.signalservice.loki.protocol.todo.LokiThreadFriendRequestStatus
object SessionManagementProtocol {
@ -65,12 +64,13 @@ object SessionManagementProtocol {
val lokiThreadDB = DatabaseFactory.getLokiThreadDatabase(context)
val threadFRStatus = lokiThreadDB.getFriendRequestStatus(threadID)
// If we received a friend request (i.e. also a new pre key bundle), but we were already friends with the other user, reset the session.
if (content.isFriendRequest && threadFRStatus == LokiThreadFriendRequestStatus.FRIENDS) {
val sessionStore = TextSecureSessionStore(context)
sessionStore.archiveAllSessions(content.sender)
val ephemeralMessage = EphemeralMessage.create(content.sender)
ApplicationContext.getInstance(context).jobManager.add(PushEphemeralMessageSendJob(ephemeralMessage))
}
// FIXME: Temporarily disabled to avoid a session out of sync issue
// if (content.isFriendRequest && threadFRStatus == LokiThreadFriendRequestStatus.FRIENDS) {
// val sessionStore = TextSecureSessionStore(context)
// sessionStore.archiveAllSessions(content.sender)
// val ephemeralMessage = EphemeralMessage.create(content.sender)
// ApplicationContext.getInstance(context).jobManager.add(PushEphemeralMessageSendJob(ephemeralMessage))
// }
}
@JvmStatic