Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-android
Commits
f79e04ad
Commit
f79e04ad
authored
2 years ago
by
Amirhossein Naghshzan
Committed by
Adrien Béraud
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
conversation: delete swarm file
Change-Id: I15df72081a1f5ab254767e6e666e685e251baf25
parent
637b20e7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ring-android/libjamiclient/src/main/kotlin/net/jami/services/ConversationFacade.kt
+15
-7
15 additions, 7 deletions
...t/src/main/kotlin/net/jami/services/ConversationFacade.kt
with
15 additions
and
7 deletions
ring-android/libjamiclient/src/main/kotlin/net/jami/services/ConversationFacade.kt
+
15
−
7
View file @
f79e04ad
...
...
@@ -166,20 +166,28 @@ class ConversationFacade(
}
fun
deleteConversationItem
(
conversation
:
Conversation
,
element
:
Interaction
)
{
if
(
conversation
.
isSwarm
)
return
if
(
element
.
type
===
Interaction
.
InteractionType
.
DATA_TRANSFER
)
{
val
transfer
=
element
as
DataTransfer
if
(
transfer
.
status
===
InteractionStatus
.
TRANSFER_ONGOING
)
{
mAccountService
.
cancelDataTransfer
(
conversation
.
accountId
,
conversation
.
uri
.
rawRingId
,
transfer
.
messageId
,
transfer
.
fileId
!!
)
}
else
{
val
file
=
mDeviceRuntimeService
.
getConversationPath
(
conversation
.
uri
.
rawRingId
,
transfer
.
storagePath
)
mDisposableBag
.
add
(
Completable
.
mergeArrayDelayError
(
mHistoryService
.
deleteInteraction
(
element
.
id
,
element
.
account
!!
),
Completable
.
fromAction
{
file
.
delete
()
}
.
subscribeOn
(
Schedulers
.
io
()))
.
subscribe
({
conversation
.
removeInteraction
(
transfer
)
})
if
(
conversation
.
isSwarm
)
{
mDisposableBag
.
add
(
Completable
.
fromAction
{
file
.
delete
()
}
.
subscribeOn
(
Schedulers
.
io
())
.
subscribe
({
transfer
.
status
=
InteractionStatus
.
FILE_AVAILABLE
conversation
.
updateInteraction
(
transfer
)
})
{
e
:
Throwable
->
Log
.
e
(
TAG
,
"Can't delete file transfer"
,
e
)
})
}
else
{
mDisposableBag
.
add
(
Completable
.
mergeArrayDelayError
(
mHistoryService
.
deleteInteraction
(
element
.
id
,
element
.
account
!!
),
Completable
.
fromAction
{
file
.
delete
()
}
.
subscribeOn
(
Schedulers
.
io
()))
.
subscribe
({
conversation
.
removeInteraction
(
transfer
)
})
{
e
:
Throwable
->
Log
.
e
(
TAG
,
"Can't delete file transfer"
,
e
)
})
}
}
}
else
{
// handling is the same for calls and texts
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment