mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 18:00:02 +01:00
Fix SSE event bug and make the assertion guarded by a separate flag.
This commit is contained in:
@@ -1293,7 +1293,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
|
||||
}
|
||||
|
||||
fun insertSessionSwitchoverEvent(recipientId: RecipientId, threadId: Long, event: SessionSwitchoverEvent) {
|
||||
check(FeatureFlags.phoneNumberPrivacy()) { "Should not occur in a non-PNP world!" }
|
||||
check(!FeatureFlags.blockSessionSwitchoverEvents()) { "Should not occur in a non-PNP world!" }
|
||||
writableDatabase
|
||||
.insertInto(TABLE_NAME)
|
||||
.values(
|
||||
|
||||
@@ -2650,7 +2650,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
* records and turning it into a possible event.
|
||||
*/
|
||||
private fun sessionSwitchoverEventIfNeeded(pniVerified: Boolean, oldRecord: RecipientRecord?, newRecord: RecipientRecord?): PnpOperation? {
|
||||
return if (oldRecord != null && newRecord != null && needsSessionSwitchoverEvent(pniVerified, oldRecord.serviceId, newRecord.serviceId)) {
|
||||
return if (oldRecord != null && newRecord != null && oldRecord.serviceId == oldRecord.pni && newRecord.serviceId == newRecord.aci && needsSessionSwitchoverEvent(pniVerified, oldRecord.serviceId, newRecord.serviceId)) {
|
||||
PnpOperation.SessionSwitchoverInsert(
|
||||
recipientId = newRecord.id,
|
||||
e164 = newRecord.e164
|
||||
|
||||
Reference in New Issue
Block a user