mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-29 14:38:45 +03:00
Cleanup: rename parameters, make some fields private, add Javadoc, fix copy paste error
This commit is contained in:
parent
bf4f869524
commit
28081aa7d2
3 changed files with 14 additions and 5 deletions
|
@ -124,8 +124,14 @@ interface SendService {
|
|||
*/
|
||||
fun deleteFailedEcho(localEcho: TimelineEvent)
|
||||
|
||||
/**
|
||||
* Delete all the events in one of the sending states
|
||||
*/
|
||||
fun clearSendingQueue()
|
||||
|
||||
/**
|
||||
* Cancel sending a specific event. It has to be in one of the sending states
|
||||
*/
|
||||
fun cancelSend(eventId: String)
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,9 +22,12 @@ import java.io.IOException
|
|||
import java.io.InputStream
|
||||
import java.security.MessageDigest
|
||||
|
||||
class MatrixDigestCheckInputStream(`in`: InputStream?, val expectedDigest: String) : FilterInputStream(`in`) {
|
||||
class MatrixDigestCheckInputStream(
|
||||
inputStream: InputStream?,
|
||||
private val expectedDigest: String
|
||||
) : FilterInputStream(inputStream) {
|
||||
|
||||
val digest = MessageDigest.getInstance("SHA-256")
|
||||
private val digest = MessageDigest.getInstance("SHA-256")
|
||||
|
||||
@Throws(IOException::class)
|
||||
override fun read(): Int {
|
||||
|
|
|
@ -1076,12 +1076,12 @@ class RoomDetailViewModel @AssistedInject constructor(
|
|||
private fun handleCancel(action: RoomDetailAction.CancelSend) {
|
||||
val targetEventId = action.eventId
|
||||
room.getTimeLineEvent(targetEventId)?.let {
|
||||
// State must be UNDELIVERED or Failed
|
||||
// State must be in one of the sending states
|
||||
if (!it.root.sendState.isSending()) {
|
||||
Timber.e("Cannot resend message, it is not failed, Cancel first")
|
||||
Timber.e("Cannot cancel message, it is not sending")
|
||||
return
|
||||
}
|
||||
room.cancelSend(action.eventId)
|
||||
room.cancelSend(targetEventId)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue