mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-23 18:05:59 +03:00
GlobalScope -> sessionScope
This commit is contained in:
parent
82ee2567b7
commit
8afa697591
3 changed files with 5 additions and 7 deletions
|
@ -115,7 +115,7 @@ class VectorGlideDataFetcher(context: Context,
|
|||
callback.onLoadFailed(IllegalArgumentException("No File service"))
|
||||
}
|
||||
// Use the file vector service, will avoid flickering and redownload after upload
|
||||
GlobalScope.launch {
|
||||
activeSessionHolder.getSafeActiveSession()?.launch {
|
||||
val result = runCatching {
|
||||
fileService.downloadFile(
|
||||
fileName = data.filename,
|
||||
|
|
|
@ -1749,7 +1749,7 @@ class RoomDetailFragment @Inject constructor(
|
|||
sharedActionViewModel.pendingAction = action
|
||||
return
|
||||
}
|
||||
lifecycleScope.launch {
|
||||
session.launch {
|
||||
val result = runCatching { session.fileService().downloadFile(messageContent = action.messageContent) }
|
||||
if (!isAdded) return@launch
|
||||
result.fold(
|
||||
|
|
|
@ -23,8 +23,6 @@ import androidx.core.app.RemoteInput
|
|||
import im.vector.app.R
|
||||
import im.vector.app.core.di.ActiveSessionHolder
|
||||
import im.vector.app.core.extensions.vectorComponent
|
||||
import kotlinx.coroutines.GlobalScope
|
||||
import kotlinx.coroutines.launch
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import org.matrix.android.sdk.api.session.room.Room
|
||||
|
@ -78,7 +76,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
activeSessionHolder.getSafeActiveSession()?.let { session ->
|
||||
val room = session.getRoom(roomId)
|
||||
if (room != null) {
|
||||
GlobalScope.launch {
|
||||
session.launch {
|
||||
tryOrNull { room.join() }
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +87,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
activeSessionHolder.getSafeActiveSession()?.let { session ->
|
||||
val room = session.getRoom(roomId)
|
||||
if (room != null) {
|
||||
GlobalScope.launch {
|
||||
session.launch {
|
||||
tryOrNull { room.leave() }
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +98,7 @@ class NotificationBroadcastReceiver : BroadcastReceiver() {
|
|||
activeSessionHolder.getActiveSession().let { session ->
|
||||
val room = session.getRoom(roomId)
|
||||
if (room != null) {
|
||||
GlobalScope.launch {
|
||||
session.launch {
|
||||
tryOrNull { room.markAsRead(ReadService.MarkAsReadParams.READ_RECEIPT) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue