Browse Source

Supported new service messages

master
Igor Zhukov 7 years ago
parent
commit
90557e2f67
  1. 2
      app/js/locales/en-us.json
  2. 10
      app/js/messages_manager.js
  3. 9
      app/partials/desktop/message_media.html
  4. 7
      app/partials/desktop/message_service.html
  5. 5
      app/partials/desktop/short_message.html
  6. 6
      app/partials/mobile/message_service.html

2
app/js/locales/en-us.json

@ -384,6 +384,7 @@ @@ -384,6 +384,7 @@
"message_service_removed_channel_photo": "Channel photo removed",
"message_service_scored_X": "{'one': 'scored {}', 'other': 'scored {}'}",
"message_service_payment_sent": "Payment sent",
"message_service_screenshot_taken": "took a screenshot!",
"message_admin_badge": "admin",
@ -617,6 +618,7 @@ @@ -617,6 +618,7 @@
"message_attach_video_play": "Play video",
"message_attach_unsupported": "The message is not supported on your version of Telegram Web. Update the app to view: {link}.",
"message_attach_notweb": "The message is not supported on Telegram Web yet. Use Telegram mobile apps to view: {link}.",
"conversation_select_modal_title": "Select conversation",
"conversation_select_modal_chats_contacts": "Chats and contacts",

10
app/js/messages_manager.js

@ -1424,14 +1424,14 @@ angular.module('myApp.services') @@ -1424,14 +1424,14 @@ angular.module('myApp.services')
break
case 'messageMediaPhoto':
if (apiMessage.media.ttl_seconds) {
apiMessage.media = {_: 'messageMediaUnsupported'}
apiMessage.media = {_: 'messageMediaUnsupportedWeb'}
} else {
AppPhotosManager.savePhoto(apiMessage.media.photo, mediaContext)
}
break
case 'messageMediaDocument':
if (apiMessage.media.ttl_seconds) {
apiMessage.media = {_: 'messageMediaUnsupported'}
apiMessage.media = {_: 'messageMediaUnsupportedWeb'}
} else {
AppDocsManager.saveDoc(apiMessage.media.document, mediaContext)
}
@ -1444,7 +1444,7 @@ angular.module('myApp.services') @@ -1444,7 +1444,7 @@ angular.module('myApp.services')
apiMessage.media.handleMessage = true
break
case 'messageMediaInvoice':
apiMessage.media = {_: 'messageMediaUnsupported'}
apiMessage.media = {_: 'messageMediaUnsupportedWeb'}
break
case 'messageMediaGeoLive':
apiMessage.media._ = 'messageMediaGeo'
@ -1524,10 +1524,6 @@ angular.module('myApp.services') @@ -1524,10 +1524,6 @@ angular.module('myApp.services')
: 'ok'
)
break
case 'messageActionScreenshotTaken':
apiMessage.media = {_: 'messageMediaUnsupported'}
delete apiMessage.action
}
if (migrateFrom &&

9
app/partials/desktop/message_media.html

@ -6,10 +6,17 @@ @@ -6,10 +6,17 @@
<div ng-switch-when="messageMediaContact" my-message-contact="media"></div>
<div ng-switch-when="messageMediaWebPage" my-message-webpage="media" message-id="messageId"></div>
<div ng-switch-when="messageMediaGame" my-message-game="media" message-id="messageId"></div>
<div ng-switch-when="messageMediaPending" my-message-pending="media"></div>
<div ng-switch-when="messageMediaPending" my-message-pending="media"></div>
<div ng-switch-when="messageMediaUnsupported">
<div class="im_message_text" my-i18n="message_attach_unsupported">
<my-i18n-param name="link"><a href="https://web.telegram.org" target="_blank">web.telegram.org</a></my-i18n-param>
</div>
</div>
<div ng-switch-default>
<div class="im_message_text" my-i18n="message_attach_notweb">
<my-i18n-param name="link"><a href="https://telegram.org/dl" target="_blank">telegram.org/dl</a></my-i18n-param>
</div>
</div>
</div>

7
app/partials/desktop/message_service.html

@ -50,7 +50,12 @@ @@ -50,7 +50,12 @@
<span ng-if="historyMessage.action.duration > 0" ng-bind="historyMessage.action.duration | duration" class="im_service_message_phonecall_duration"></span>
</a>
<span ng-switch-when="messageActionPaymentSent" class="message_service_payment_sent"></span>
<span ng-switch-when="messageActionPaymentSent" my-i18n="message_service_payment_sent"></span>
<span ng-switch-when="messageActionScreenshotTaken" my-i18n="message_service_screenshot_taken"></span>
<span ng-switch-when="messageActionCustomAction" ng-bind="historyMessage.action.message"></span>
<span ng-switch-default my-i18n="message_service_unsupported_action">
<my-i18n-param name="action"><span ng-bind="historyMessage.action._"></span></my-i18n-param>

5
app/partials/desktop/short_message.html

@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
<span my-emoji-image="🎮"></span>
<span ng-bind-html="message.media.game.rTitle"></span>
</span>
<span ng-switch-when="messageMediaUnsupported" my-i18n="conversation_media_unsupported"></span>
<span ng-switch-default my-i18n="conversation_media_unsupported"></span>
</span><span class="im_short_message_service" ng-if="message._ == 'messageService'" ng-switch="message.action._">
<span ng-switch-when="messageActionChatCreate" my-i18n="conversation_group_created"></span>
<span ng-switch-when="messageActionChatEditTitle" my-i18n="conversation_group_renamed"></span>
@ -58,5 +58,8 @@ @@ -58,5 +58,8 @@
<span ng-switch-when="in_ok" my-i18n="message_service_phonecall_incoming"></span>
</span>
<span ng-switch-when="messageActionPaymentSent" my-i18n="message_service_payment_sent"></span>
<span ng-switch-when="messageActionScreenshotTaken" my-i18n="message_service_screenshot_taken"></span>
<span ng-switch-when="messageActionCustomAction" ng-bind="message.action.message"></span>
</span><span class="im_short_message_text" ng-if="message.message.length && (!message.media || message.media._ == 'messageMediaWebPage')" ng-bind-html="message.richMessage"></span>

6
app/partials/mobile/message_service.html

@ -50,7 +50,11 @@ @@ -50,7 +50,11 @@
<span ng-if="historyMessage.action.duration > 0" ng-bind="historyMessage.action.duration | duration" class="im_service_message_phonecall_duration"></span>
</a>
<span ng-switch-when="messageActionPaymentSent" class="message_service_payment_sent"></span>
<span ng-switch-when="messageActionPaymentSent" my-i18n="message_service_payment_sent"></span>
<span ng-switch-when="messageActionScreenshotTaken" my-i18n="message_service_screenshot_taken"></span>
<span ng-switch-when="messageActionCustomAction" ng-bind="historyMessage.action.message"></span>
<span ng-switch-default my-i18n="message_service_unsupported_action">
<my-i18n-param name="action"><span ng-bind="historyMessage.action._"></span></my-i18n-param>

Loading…
Cancel
Save