Added t.me support
This commit is contained in:
parent
61401c8a14
commit
300721e9b5
@ -4934,7 +4934,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|||||||
function updateLink (force) {
|
function updateLink (force) {
|
||||||
var chat = AppChatsManager.getChat($scope.chatID)
|
var chat = AppChatsManager.getChat($scope.chatID)
|
||||||
if (chat.username) {
|
if (chat.username) {
|
||||||
$scope.exportedInvite = {link: 'https://telegram.me/' + chat.username, short: true}
|
$scope.exportedInvite = {link: 'https://t.me/' + chat.username, short: true}
|
||||||
selectLink()
|
selectLink()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -5197,6 +5197,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
$scope.share = function () {
|
$scope.share = function () {
|
||||||
LocationParamsService.shareUrl('https://telegram.me/addstickers/' + $scope.stickerset.short_name, $scope.stickerset.title)
|
LocationParamsService.shareUrl('https://t.me/addstickers/' + $scope.stickerset.short_name, $scope.stickerset.title)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -1660,10 +1660,6 @@ angular.module('izhukov.utils', [])
|
|||||||
|
|
||||||
case 'messageEntityUrl':
|
case 'messageEntityUrl':
|
||||||
case 'messageEntityTextUrl':
|
case 'messageEntityTextUrl':
|
||||||
if (options.noLinks) {
|
|
||||||
skipEntity = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
var inner
|
var inner
|
||||||
if (entity._ == 'messageEntityTextUrl') {
|
if (entity._ == 'messageEntityTextUrl') {
|
||||||
url = entity.url
|
url = entity.url
|
||||||
@ -1673,13 +1669,17 @@ angular.module('izhukov.utils', [])
|
|||||||
url = wrapUrl(entityText, false)
|
url = wrapUrl(entityText, false)
|
||||||
inner = encodeEntities(replaceUrlEncodings(entityText))
|
inner = encodeEntities(replaceUrlEncodings(entityText))
|
||||||
}
|
}
|
||||||
html.push(
|
if (options.noLinks) {
|
||||||
'<a href="',
|
html.push(inner);
|
||||||
encodeEntities(url),
|
} else {
|
||||||
'" target="_blank" rel="noopener noreferrer">',
|
html.push(
|
||||||
inner,
|
'<a href="',
|
||||||
'</a>'
|
encodeEntities(url),
|
||||||
)
|
'" target="_blank" rel="noopener noreferrer">',
|
||||||
|
inner,
|
||||||
|
'</a>'
|
||||||
|
)
|
||||||
|
}
|
||||||
break
|
break
|
||||||
|
|
||||||
case 'messageEntityLinebreak':
|
case 'messageEntityLinebreak':
|
||||||
@ -1929,7 +1929,7 @@ angular.module('izhukov.utils', [])
|
|||||||
if (unsafe == 2) {
|
if (unsafe == 2) {
|
||||||
url = 'tg://unsafe_url?url=' + encodeURIComponent(url)
|
url = 'tg://unsafe_url?url=' + encodeURIComponent(url)
|
||||||
}
|
}
|
||||||
else if ( (tgMeMatch = url.match(/^https?:\/\/telegram\.me\/(.+)/))) {
|
else if ( (tgMeMatch = url.match(/^https?:\/\/t(?:elegram)?\.me\/(.+)/))) {
|
||||||
var path = tgMeMatch[1].split('/')
|
var path = tgMeMatch[1].split('/')
|
||||||
switch (path[0]) {
|
switch (path[0]) {
|
||||||
case 'joinchat':
|
case 'joinchat':
|
||||||
|
@ -4409,11 +4409,17 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
}
|
}
|
||||||
Storage.set({tgme_sync: {canRedirect: canRedirect, ts: ts}})
|
Storage.set({tgme_sync: {canRedirect: canRedirect, ts: ts}})
|
||||||
|
|
||||||
var script = $('<script>').appendTo('body')
|
var script1 = $('<script>').appendTo('body')
|
||||||
.on('load error', function () {
|
.on('load error', function () {
|
||||||
script.remove()
|
script1.remove()
|
||||||
})
|
})
|
||||||
.attr('src', '//telegram.me/_websync_?authed=' + (canRedirect ? '1' : '0'))
|
.attr('src', '//telegram.me/_websync_?authed=' + (canRedirect ? '1' : '0'))
|
||||||
|
|
||||||
|
var script2 = $('<script>').appendTo('body')
|
||||||
|
.on('load error', function () {
|
||||||
|
script2.remove()
|
||||||
|
})
|
||||||
|
.attr('src', '//t.me/_websync_?authed=' + (canRedirect ? '1' : '0'))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4513,7 +4519,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
url: url
|
url: url
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
var target = '_blank'
|
var target = '_blank'
|
||||||
if (url.search('https://telegram.me/') === 0) {
|
if (url.search('https://telegram.me/') === 0 ||
|
||||||
|
url.search('https://t.me/') === 0) {
|
||||||
target = '_self'
|
target = '_self'
|
||||||
}
|
}
|
||||||
window.open(url, target)
|
window.open(url, target)
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
<div class="md_modal_section_param_wrap" ng-if="chatFull.chat.username">
|
<div class="md_modal_section_param_wrap" ng-if="chatFull.chat.username">
|
||||||
<div class="md_modal_section_param_value">
|
<div class="md_modal_section_param_value">
|
||||||
<a class="settings_modal_username_link" ng-click="shareLink($event)" ng-bind="'https://telegram.me/' + chatFull.chat.username" ng-href="https://telegram.me/{{chatFull.chat.username}}" target="_blank"></a>
|
<a class="settings_modal_username_link" ng-click="shareLink($event)" ng-bind="'https://t.me/' + chatFull.chat.username" ng-href="https://t.me/{{chatFull.chat.username}}" target="_blank"></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="md_modal_section_param_name" my-i18n="channel_modal_share_link"></div>
|
<div class="md_modal_section_param_name" my-i18n="channel_modal_share_link"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
<span ng-switch-when="INVITE_HASH_EMPTY" my-i18n="error_modal_invite_link_invalid"></span>
|
<span ng-switch-when="INVITE_HASH_EMPTY" my-i18n="error_modal_invite_link_invalid"></span>
|
||||||
<span ng-switch-when="CHANNEL_PRIVATE" my-i18n="error_modal_channel_not_accessible"></span>
|
<span ng-switch-when="CHANNEL_PRIVATE" my-i18n="error_modal_channel_not_accessible"></span>
|
||||||
<span ng-switch-when="PEER_FLOOD" my-i18n="error_modal_not_contact_flood">
|
<span ng-switch-when="PEER_FLOOD" my-i18n="error_modal_not_contact_flood">
|
||||||
<my-i18n-param name="more-info-link"><a href="https://telegram.me/spambot">{0}</a></my-i18n-param>
|
<my-i18n-param name="more-info-link"><a href="https://t.me/spambot">{0}</a></my-i18n-param>
|
||||||
</span>
|
</span>
|
||||||
<span ng-switch-when="2FA_RECENT_CONFIRM" my-i18n="error_modal_2fa_recent_confirm"></span>
|
<span ng-switch-when="2FA_RECENT_CONFIRM" my-i18n="error_modal_2fa_recent_confirm"></span>
|
||||||
<span ng-switch-when="2FA_CONFIRM_WAIT_TIME" my-i18n="error_modal_2fa_delayed_time_md">
|
<span ng-switch-when="2FA_CONFIRM_WAIT_TIME" my-i18n="error_modal_2fa_delayed_time_md">
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
<div class="mobile_modal_section" ng-if="chatFull.chat.username || chatFull.chat.pFlags.creator">
|
<div class="mobile_modal_section" ng-if="chatFull.chat.username || chatFull.chat.pFlags.creator">
|
||||||
<h4 class="mobile_modal_section_header" my-i18n="channel_modal_share_link"></h4>
|
<h4 class="mobile_modal_section_header" my-i18n="channel_modal_share_link"></h4>
|
||||||
<div class="mobile_modal_section_value" ng-switch="chatFull.chat.username.length > 0">
|
<div class="mobile_modal_section_value" ng-switch="chatFull.chat.username.length > 0">
|
||||||
<a ng-switch-when="true" class="settings_modal_username_link" ng-click="shareLink($event)" ng-bind="'https://telegram.me/' + chatFull.chat.username" ng-href="https://telegram.me/{{chatFull.chat.username}}" target="_blank"></a>
|
<a ng-switch-when="true" class="settings_modal_username_link" ng-click="shareLink($event)" ng-bind="'https://t.me/' + chatFull.chat.username" ng-href="https://t.me/{{chatFull.chat.username}}" target="_blank"></a>
|
||||||
<a ng-switch-default ng-click="shareLink($event)" ng-bind="chatFull.exported_invite.link" ng-href="{{chatFull.exported_invite.link}}" target="_blank"></a>
|
<a ng-switch-default ng-click="shareLink($event)" ng-bind="chatFull.exported_invite.link" ng-href="{{chatFull.exported_invite.link}}" target="_blank"></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user