Skip to content

Commit

Permalink
Send call link update sync message upon call link creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-signal committed Apr 24, 2024
1 parent 4134df3 commit 293634c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import io.reactivex.rxjava3.schedulers.Schedulers
import org.thoughtcrime.securesms.database.CallLinkTable
import org.thoughtcrime.securesms.database.SignalDatabase
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies
import org.thoughtcrime.securesms.jobs.CallLinkUpdateSendJob
import org.thoughtcrime.securesms.recipients.Recipient
import org.thoughtcrime.securesms.recipients.RecipientId
import org.thoughtcrime.securesms.service.webrtc.links.CallLinkCredentials
import org.thoughtcrime.securesms.service.webrtc.links.CreateCallLinkResult
import org.thoughtcrime.securesms.service.webrtc.links.SignalCallLinkManager
import org.whispersystems.signalservice.internal.push.SyncMessage

/**
* Repository for creating new call links. This will delegate to the [SignalCallLinkManager]
Expand Down Expand Up @@ -44,6 +46,13 @@ class CreateCallLinkRepository(
)
)

ApplicationDependencies.getJobManager().add(
CallLinkUpdateSendJob(
credentials.roomId,
SyncMessage.CallLinkUpdate.Type.UPDATE
)
)

EnsureCallLinkCreatedResult.Success(
Recipient.resolved(
SignalDatabase.recipients.getByCallLinkRoomId(credentials.roomId).get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class CallLinkUpdateSendJob private constructor(

val callLinkUpdate = CallLinkUpdate(
rootKey = callLink.credentials.linkKeyBytes.toByteString(),
adminPassKey = callLink.credentials.adminPassBytes?.toByteString(),
type = callLinkUpdateType
)

Expand Down

0 comments on commit 293634c

Please sign in to comment.