Browse Source

Fixed confirm for opening URL from verified bots

master
Igor Zhukov 8 years ago
parent
commit
82786e91ce
  1. 2
      app/js/directives.js
  2. 6
      app/js/messages_manager.js
  3. 4
      app/js/services.js

2
app/js/directives.js

@ -232,7 +232,7 @@ angular.module('myApp.directives', ['myApp.filters'])
} }
var scope = $scope.$new(true) var scope = $scope.$new(true)
scope.markup = AppMessagesManager.wrapReplyMarkup(message.reply_markup) scope.markup = AppMessagesManager.wrapReplyMarkup(message.reply_markup, message.fromID)
scope.messageId = message.mid scope.messageId = message.mid
messageKeyboardCompiled(scope, function (clonedElement) { messageKeyboardCompiled(scope, function (clonedElement) {
$('.im_message_keyboard', element).replaceWith(clonedElement) $('.im_message_keyboard', element).replaceWith(clonedElement)

6
app/js/messages_manager.js

@ -2319,7 +2319,7 @@ angular.module('myApp.services')
return messagesForHistory[msgID] = message return messagesForHistory[msgID] = message
} }
function wrapReplyMarkup (replyMarkup) { function wrapReplyMarkup (replyMarkup, fromID) {
if (!replyMarkup || if (!replyMarkup ||
replyMarkup._ == 'replyKeyboardHide') { replyMarkup._ == 'replyKeyboardHide') {
return false return false
@ -2340,7 +2340,9 @@ angular.module('myApp.services')
angular.forEach(markupRow.buttons, function (markupButton) { angular.forEach(markupRow.buttons, function (markupButton) {
markupButton.rText = RichTextProcessor.wrapRichText(markupButton.text, {noLinks: true, noLinebreaks: true}) markupButton.rText = RichTextProcessor.wrapRichText(markupButton.text, {noLinks: true, noLinebreaks: true})
if (markupButton._ == 'keyboardButtonUrl') { if (markupButton._ == 'keyboardButtonUrl') {
markupButton.pUrl = RichTextProcessor.wrapUrl(markupButton.url, 1) var from = AppUsersManager.getUser(fromID)
var unsafe = !(from && from.pFlags && from.pFlags.verified)
markupButton.pUrl = RichTextProcessor.wrapUrl(markupButton.url, unsafe)
} }
}) })
}) })

4
app/js/services.js

@ -2800,13 +2800,13 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
showCallbackMessage(callbackAnswer.message, callbackAnswer.pFlags.alert) showCallbackMessage(callbackAnswer.message, callbackAnswer.pFlags.alert)
} }
else if (typeof callbackAnswer.url === 'string') { else if (typeof callbackAnswer.url === 'string') {
LocationParamsService.openUrl(callbackAnswer.url) var url = RichTextProcessor.wrapUrl(callbackAnswer.url, true)
LocationParamsService.openUrl(url)
} }
}) })
} }
function gameButtonClick (id) { function gameButtonClick (id) {
console.trace()
var message = AppMessagesManager.getMessage(id) var message = AppMessagesManager.getMessage(id)
var peerID = AppMessagesManager.getMessagePeer(message) var peerID = AppMessagesManager.getMessagePeer(message)

Loading…
Cancel
Save