mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 22:13:38 +00:00
Minor refactoring
This commit is contained in:
parent
d96552fd9d
commit
631f77425b
@ -12,7 +12,7 @@ import org.session.libsession.messaging.sending_receiving.attachments.DatabaseAt
|
|||||||
import org.thoughtcrime.securesms.database.DatabaseFactory
|
import org.thoughtcrime.securesms.database.DatabaseFactory
|
||||||
import org.thoughtcrime.securesms.jobmanager.Job
|
import org.thoughtcrime.securesms.jobmanager.Job
|
||||||
import org.thoughtcrime.securesms.jobs.BaseJob
|
import org.thoughtcrime.securesms.jobs.BaseJob
|
||||||
import org.thoughtcrime.securesms.loki.utilities.audio.DecodedAudio
|
import org.thoughtcrime.securesms.loki.utilities.DecodedAudio
|
||||||
import org.thoughtcrime.securesms.mms.PartAuthority
|
import org.thoughtcrime.securesms.mms.PartAuthority
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
import java.lang.IllegalStateException
|
import java.lang.IllegalStateException
|
||||||
|
@ -16,11 +16,6 @@ object SessionMetaProtocol {
|
|||||||
|
|
||||||
private val timestamps = mutableSetOf<Long>()
|
private val timestamps = mutableSetOf<Long>()
|
||||||
|
|
||||||
@JvmStatic
|
|
||||||
fun dropFromTimestampCacheIfNeeded(timestamp: Long) {
|
|
||||||
timestamps.remove(timestamp)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun getTimestamps(): Set<Long> {
|
fun getTimestamps(): Set<Long> {
|
||||||
return timestamps
|
return timestamps
|
||||||
}
|
}
|
||||||
@ -73,9 +68,6 @@ object SessionMetaProtocol {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Should be invoked for the recipient's master device.
|
|
||||||
*/
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun canUserReplyToNotification(recipient: Recipient): Boolean {
|
fun canUserReplyToNotification(recipient: Recipient): Boolean {
|
||||||
// TODO return !recipient.address.isRSSFeed
|
// TODO return !recipient.address.isRSSFeed
|
||||||
@ -91,17 +83,11 @@ object SessionMetaProtocol {
|
|||||||
return hasBody || hasAttachment || hasLinkPreview
|
return hasBody || hasAttachment || hasLinkPreview
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Should be invoked for the recipient's master device.
|
|
||||||
*/
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun shouldSendReadReceipt(address: Address): Boolean {
|
fun shouldSendReadReceipt(address: Address): Boolean {
|
||||||
return !address.isGroup
|
return !address.isGroup
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Should be invoked for the recipient's master device.
|
|
||||||
*/
|
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun shouldSendTypingIndicator(address: Address): Boolean {
|
fun shouldSendTypingIndicator(address: Address): Boolean {
|
||||||
return !address.isGroup
|
return !address.isGroup
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package org.thoughtcrime.securesms.loki.utilities.audio
|
package org.thoughtcrime.securesms.loki.utilities
|
||||||
|
|
||||||
import android.media.AudioFormat
|
import android.media.AudioFormat
|
||||||
import android.media.MediaCodec
|
import android.media.MediaCodec
|
@ -14,7 +14,7 @@ import android.view.ViewConfiguration
|
|||||||
import android.view.animation.DecelerateInterpolator
|
import android.view.animation.DecelerateInterpolator
|
||||||
import androidx.core.math.MathUtils
|
import androidx.core.math.MathUtils
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.loki.utilities.audio.byteToNormalizedFloat
|
import org.thoughtcrime.securesms.loki.utilities.byteToNormalizedFloat
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
Loading…
x
Reference in New Issue
Block a user