mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-22 01:40:07 +01:00
Fix various compiler warnings.
This commit is contained in:
@@ -2186,7 +2186,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
}
|
||||
|
||||
fun bulkUpdatedRegisteredStatus(registered: Map<RecipientId, ServiceId?>, unregistered: Collection<RecipientId>) {
|
||||
writableDatabase.withinTransaction { db ->
|
||||
writableDatabase.withinTransaction {
|
||||
val registeredWithServiceId: Set<RecipientId> = getRegisteredWithServiceIds()
|
||||
val needsMarkRegistered: Map<RecipientId, ServiceId?> = registered - registeredWithServiceId
|
||||
|
||||
@@ -2855,7 +2855,7 @@ open class RecipientTable(context: Context, databaseHelper: SignalDatabase) : Da
|
||||
operations += PnpOperation.ChangeNumberInsert(
|
||||
recipientId = data.byAciSid,
|
||||
oldE164 = data.aciSidRecord.e164,
|
||||
newE164 = e164!!
|
||||
newE164 = e164
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -15,6 +15,7 @@ import org.signal.core.util.delete
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.core.util.or
|
||||
import org.signal.core.util.readToList
|
||||
import org.signal.core.util.readToSingleLong
|
||||
import org.signal.core.util.requireBoolean
|
||||
import org.signal.core.util.requireInt
|
||||
import org.signal.core.util.requireLong
|
||||
@@ -1072,13 +1073,7 @@ class ThreadTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTa
|
||||
.from(TABLE_NAME)
|
||||
.where("$RECIPIENT_ID = ?", recipientId)
|
||||
.run()
|
||||
.use { cursor ->
|
||||
return if (cursor.moveToFirst()) {
|
||||
cursor.requireLong(ID)
|
||||
} else {
|
||||
-1
|
||||
}
|
||||
}
|
||||
.readToSingleLong(-1)
|
||||
}
|
||||
|
||||
fun getOrCreateValidThreadId(recipient: Recipient, candidateId: Long): Long {
|
||||
|
||||
@@ -19,7 +19,7 @@ enum class StoryViewState {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun getForRecipientId(recipientId: RecipientId): Observable<StoryViewState> {
|
||||
if (recipientId.equals(Recipient.self().id)) {
|
||||
if (recipientId == Recipient.self().id) {
|
||||
return Observable.fromCallable {
|
||||
SignalDatabase.recipients.getDistributionListRecipientIds()
|
||||
}.flatMap { ids ->
|
||||
@@ -27,7 +27,7 @@ enum class StoryViewState {
|
||||
if (combined.isEmpty()) {
|
||||
NONE
|
||||
} else {
|
||||
val results = combined.toList() as List<StoryViewState>
|
||||
val results: List<StoryViewState> = combined.filterIsInstance<StoryViewState>()
|
||||
when {
|
||||
results.any { it == UNVIEWED } -> UNVIEWED
|
||||
results.any { it == VIEWED } -> VIEWED
|
||||
|
||||
Reference in New Issue
Block a user