Skip to content

Commit

Permalink
fix: Legalhold implementation in testservice (WPB-10479) (#3047)
Browse files Browse the repository at this point in the history
* fix: Testservice automatically approves legal hold requests (WPB-8746)

* legalHoldStatus 2 is enabled (1 is disabled)

* Only check legalHoldStatus if it is set
  • Loading branch information
mythsunwind authored Oct 1, 2024
1 parent d22a888 commit 4687ee8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ class ConversationResources(private val instanceService: InstanceService) {
mentions,
messageTimer,
quotedMessageId,
buttons
buttons,
legalHoldStatus
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,21 @@ sealed class ConversationRepository {
mentions: List<MessageMention>,
messageTimer: Int?,
quotedMessageId: String?,
buttons: List<String> = listOf()
buttons: List<String> = listOf(),
legalHoldStatus: Int?
): Response = instance.coreLogic.globalScope {
return when (val session = session.currentSession()) {
is CurrentSessionResult.Success -> {
instance.coreLogic.sessionScope(session.accountInfo.userId) {
if (text != null) {
setMessageTimer(instance, conversationId, messageTimer)
legalHoldStatus.let {
if (legalHoldStatus == 2) {
log.info("Instance ${instance.instanceId}: Approve legal hold request and don't block sending")
approveLegalHoldRequest(instance.password)
conversations.setNotifiedAboutConversationUnderLegalHold(conversationId)
}
}
log.info("Instance ${instance.instanceId}: Send text message '$text'")
val result = if (buttons.isEmpty()) {
val previews = mapLinkPreviews(linkPreviews)
Expand Down

0 comments on commit 4687ee8

Please sign in to comment.