File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
app/src/main/java/org/thoughtcrime/securesms/groups Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import androidx.work.WorkerParameters
12
12
import dagger.assisted.Assisted
13
13
import dagger.assisted.AssistedInject
14
14
import kotlinx.coroutines.CancellationException
15
+ import kotlinx.coroutines.channels.Channel
15
16
import org.session.libsession.messaging.groups.GroupScope
16
17
import org.session.libsession.messaging.messages.control.GroupUpdated
17
18
import org.session.libsession.messaging.sending_receiving.MessageSender
@@ -73,14 +74,19 @@ class GroupLeavingWorker @AssistedInject constructor(
73
74
)
74
75
75
76
// If we are not the only admin, send a left message for other admin to handle the member removal
77
+ // We'll have to wait for this message to be sent before going ahead to delete the group
78
+ val statusChannel = Channel < kotlin.Result <Unit >>()
76
79
MessageSender .send(
77
80
GroupUpdated (
78
81
GroupUpdateMessage .newBuilder()
79
82
.setMemberLeftMessage(DataMessage .GroupUpdateMemberLeftMessage .getDefaultInstance())
80
83
.build()
81
84
),
82
85
address,
86
+ statusCallback = statusChannel
83
87
)
88
+
89
+ statusChannel.receive().getOrThrow()
84
90
}
85
91
86
92
// If we are the only admin, leaving this group will destroy the group
You can’t perform that action at this time.
0 commit comments