Fixing code quality issues
This commit is contained in:
parent
4f1596d105
commit
a2aafb9b6b
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 New Vector Ltd
|
* Copyright (c) 2022 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 New Vector Ltd
|
* Copyright (c) 2022 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 New Vector Ltd
|
* Copyright (c) 2022 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2022 New Vector Ltd
|
* Copyright (c) 2022 The Matrix.org Foundation C.I.C.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -23,13 +23,21 @@ import org.matrix.android.sdk.internal.database.model.EventAnnotationsSummaryEnt
|
|||||||
import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationAggregatedSummaryEntity
|
import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationAggregatedSummaryEntity
|
||||||
import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationAggregatedSummaryEntityFields
|
import org.matrix.android.sdk.internal.database.model.livelocation.LiveLocationAggregatedSummaryEntityFields
|
||||||
|
|
||||||
internal fun LiveLocationAggregatedSummaryEntity.Companion.where(realm: Realm, roomId: String, eventId: String): RealmQuery<LiveLocationAggregatedSummaryEntity> {
|
internal fun LiveLocationAggregatedSummaryEntity.Companion.where(
|
||||||
|
realm: Realm,
|
||||||
|
roomId: String,
|
||||||
|
eventId: String,
|
||||||
|
): RealmQuery<LiveLocationAggregatedSummaryEntity> {
|
||||||
return realm.where<LiveLocationAggregatedSummaryEntity>()
|
return realm.where<LiveLocationAggregatedSummaryEntity>()
|
||||||
.equalTo(LiveLocationAggregatedSummaryEntityFields.ROOM_ID, roomId)
|
.equalTo(LiveLocationAggregatedSummaryEntityFields.ROOM_ID, roomId)
|
||||||
.equalTo(LiveLocationAggregatedSummaryEntityFields.EVENT_ID, eventId)
|
.equalTo(LiveLocationAggregatedSummaryEntityFields.EVENT_ID, eventId)
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun LiveLocationAggregatedSummaryEntity.Companion.create(realm: Realm, roomId: String, eventId: String): LiveLocationAggregatedSummaryEntity {
|
internal fun LiveLocationAggregatedSummaryEntity.Companion.create(
|
||||||
|
realm: Realm,
|
||||||
|
roomId: String,
|
||||||
|
eventId: String,
|
||||||
|
): LiveLocationAggregatedSummaryEntity {
|
||||||
val obj = realm.createObject(LiveLocationAggregatedSummaryEntity::class.java).apply {
|
val obj = realm.createObject(LiveLocationAggregatedSummaryEntity::class.java).apply {
|
||||||
this.eventId = eventId
|
this.eventId = eventId
|
||||||
this.roomId = roomId
|
this.roomId = roomId
|
||||||
@ -40,7 +48,11 @@ internal fun LiveLocationAggregatedSummaryEntity.Companion.create(realm: Realm,
|
|||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
internal fun LiveLocationAggregatedSummaryEntity.Companion.getOrCreate(realm: Realm, roomId: String, eventId: String): LiveLocationAggregatedSummaryEntity {
|
internal fun LiveLocationAggregatedSummaryEntity.Companion.getOrCreate(
|
||||||
|
realm: Realm,
|
||||||
|
roomId: String,
|
||||||
|
eventId: String,
|
||||||
|
): LiveLocationAggregatedSummaryEntity {
|
||||||
return LiveLocationAggregatedSummaryEntity.where(realm, roomId, eventId).findFirst()
|
return LiveLocationAggregatedSummaryEntity.where(realm, roomId, eventId).findFirst()
|
||||||
?: LiveLocationAggregatedSummaryEntity.create(realm, roomId, eventId)
|
?: LiveLocationAggregatedSummaryEntity.create(realm, roomId, eventId)
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,6 @@ import org.matrix.android.sdk.internal.session.content.ThumbnailExtractor
|
|||||||
import org.matrix.android.sdk.internal.session.permalinks.PermalinkFactory
|
import org.matrix.android.sdk.internal.session.permalinks.PermalinkFactory
|
||||||
import org.matrix.android.sdk.internal.session.room.send.pills.TextPillsUtils
|
import org.matrix.android.sdk.internal.session.room.send.pills.TextPillsUtils
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
import java.util.concurrent.TimeUnit
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user