Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
linphone-android
Commits
f6d4f56b
Commit
f6d4f56b
authored
5 months ago
by
Sylvain Berfini
Browse files
Options
Download
Patches
Plain Diff
Fix voice record not playable if displayed before download terminated
parent
31d92abc
master
feature/show_unsecure_conversation_event_at_top
feature/use_theme_main_color_for_icon_and_splashscreen
fix/insistent_notification
fix/restore_previous_release_ringtone_player
fix/telecom_default_audio_endpoint
release/6.0
6.1.0-alpha
6.0.0
6.0.0-beta
1 merge request
!1537
Prevent other accounts message notification header to be displayed when a...
Pipeline
#83674
passed with stage
in 4 minutes and 56 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/org/linphone/ui/main/chat/model/MessageModel.kt
+26
-10
...main/java/org/linphone/ui/main/chat/model/MessageModel.kt
with
26 additions
and
10 deletions
app/src/main/java/org/linphone/ui/main/chat/model/MessageModel.kt
+
26
−
10
View file @
f6d4f56b
...
...
@@ -209,6 +209,14 @@ class MessageModel @WorkerThread constructor(
if
(!
allFilesDownloaded
)
{
computeContentsList
()
}
for
(
content
in
message
.
contents
)
{
if
(
content
.
isVoiceRecording
)
{
Log
.
i
(
"$TAG File transfer done, updating voice record info"
)
computeVoiceRecordContent
(
content
)
break
}
}
}
}
...
...
@@ -390,16 +398,7 @@ class MessageModel @WorkerThread constructor(
}
else
if
(
content
.
isVoiceRecording
)
{
Log
.
d
(
"$TAG Found voice recording content"
)
isVoiceRecord
.
postValue
(
true
)
voiceRecordPath
=
content
.
filePath
?:
""
val
duration
=
content
.
fileDuration
voiceRecordingDuration
.
postValue
(
duration
)
val
formattedDuration
=
SimpleDateFormat
(
"mm:ss"
,
Locale
.
getDefault
()
).
format
(
duration
)
// duration is in ms
formattedVoiceRecordingDuration
.
postValue
(
formattedDuration
)
computeVoiceRecordContent
(
content
)
displayableContentFound
=
true
}
else
{
if
(
content
.
isFile
)
{
...
...
@@ -952,4 +951,21 @@ class MessageModel @WorkerThread constructor(
}
}
}
@WorkerThread
private
fun
computeVoiceRecordContent
(
content
:
Content
)
{
voiceRecordPath
=
content
.
filePath
?:
""
val
duration
=
content
.
fileDuration
voiceRecordingDuration
.
postValue
(
duration
)
val
formattedDuration
=
SimpleDateFormat
(
"mm:ss"
,
Locale
.
getDefault
()
).
format
(
duration
)
// duration is in ms
formattedVoiceRecordingDuration
.
postValue
(
formattedDuration
)
Log
.
i
(
"$TAG Found voice record with path [$voiceRecordPath] and duration [$formattedDuration]"
)
}
}
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets