Fix video and audio file names
This commit is contained in:
parent
e8ceb21e64
commit
7be7fb12f4
1 changed files with 11 additions and 3 deletions
14
tgp-ft.c
14
tgp-ft.c
|
@ -35,12 +35,20 @@ static char *tgp_strdup_determine_filename (const char *mime, const char *captio
|
|||
if (caption) {
|
||||
return g_strdup (caption);
|
||||
}
|
||||
|
||||
const char *type = NULL;
|
||||
if (mime) {
|
||||
type = tgp_mime_to_filetype (mime);
|
||||
if (flags & TGLDF_VIDEO) {
|
||||
// video message
|
||||
type = "mp4";
|
||||
} else if (flags & TGLDF_AUDIO) {
|
||||
// audio message
|
||||
type = "ogg";
|
||||
} else {
|
||||
// document message
|
||||
type = tgp_mime_to_filetype (mime);
|
||||
}
|
||||
}
|
||||
if (!type) {
|
||||
if (! str_not_empty(type)) {
|
||||
if (flags & TGLDF_IMAGE) {
|
||||
type = "png";
|
||||
} else if (flags & TGLDF_AUDIO) {
|
||||
|
|
Loading…
Add table
Reference in a new issue