From be95f66b26ccebf56d4e6709203e6e31c3c06728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Wed, 2 Dec 2020 18:12:22 +0100 Subject: [PATCH] Integrate video messages in Chats, Notifications and ContactData --- app/widgets/Chat/Chat.php | 11 ++++++++--- app/widgets/Chats/_chats_item.tpl | 2 ++ app/widgets/Chats/locales.ini | 1 + app/widgets/ContactData/_contactdata.tpl | 2 ++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app/widgets/Chat/Chat.php b/app/widgets/Chat/Chat.php index 5fe6b7852..305b9451e 100644 --- a/app/widgets/Chat/Chat.php +++ b/app/widgets/Chat/Chat.php @@ -109,9 +109,14 @@ class Chat extends \Movim\Widget\Base } if ($message->file) { - $rawbody = (typeIsPicture($message->file['type'])) - ? '🖼️ ' . $this->__('chats.picture') - : '📄 ' . $this->__('avatar.file'); + $rawbody = '📄 ' . $this->__('avatar.file'); + + if (typeIsPicture($message->file['type'])) { + $rawbody = '🖼️ ' . $this->__('chats.picture'); + } + if (typeIsVideo($message->file['type'])) { + $rawbody = '🎞️ ' . $this->__('chats.video'); + } } if ($message->user_id == $message->jidto diff --git a/app/widgets/Chats/_chats_item.tpl b/app/widgets/Chats/_chats_item.tpl index 157ec45b4..ada5c6ed6 100644 --- a/app/widgets/Chats/_chats_item.tpl +++ b/app/widgets/Chats/_chats_item.tpl @@ -88,6 +88,8 @@ {/if} {if="typeIsPicture($message->file['type'])"} image {$c->__('chats.picture')} + {elseif="typeIsVideo($message->file['type'])"} + local_movies {$c->__('chats.video')} {else} insert_drive_file {$c->__('avatar.file')} {/if} diff --git a/app/widgets/Chats/locales.ini b/app/widgets/Chats/locales.ini index 56aaf1de3..0a4eec267 100644 --- a/app/widgets/Chats/locales.ini +++ b/app/widgets/Chats/locales.ini @@ -4,6 +4,7 @@ empty = Start a new conversation by clicking on the %s button. add = Chat with a contact me = Me picture = Picture +video = Video [button] chat = Chat diff --git a/app/widgets/ContactData/_contactdata.tpl b/app/widgets/ContactData/_contactdata.tpl index a4e182f8b..26c1c8572 100644 --- a/app/widgets/ContactData/_contactdata.tpl +++ b/app/widgets/ContactData/_contactdata.tpl @@ -140,6 +140,8 @@ {/if} {if="typeIsPicture($message->file['type'])"} image {$c->__('chats.picture')} + {elseif="typeIsVideo($message->file['type'])"} + local_movies {$c->__('chats.video')} {else} insert_drive_file {$c->__('avatar.file')} {/if}