I2P specific changes
This commit is contained in:
parent
4c2d1654c4
commit
9432fd62b8
@ -1,3 +1,8 @@
|
||||
### Warning!
|
||||
|
||||
That fork of Webogram contain changes to work with I2P network.
|
||||
|
||||
|
||||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
|
||||
[![Stories in Ready](https://badge.waffle.io/zhukov/webogram.png?label=ready&title=Ready)](https://waffle.io/zhukov/webogram)
|
||||
|
||||
|
@ -18,12 +18,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
||||
$location.url('/im')
|
||||
return
|
||||
}
|
||||
if (location.protocol == 'http:' &&
|
||||
!Config.Modes.http &&
|
||||
Config.App.domains.indexOf(location.hostname) != -1) {
|
||||
location.href = location.href.replace(/^http:/, 'https:')
|
||||
return
|
||||
}
|
||||
$location.url('/login')
|
||||
})
|
||||
|
||||
@ -40,12 +34,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
||||
$location.url('/im')
|
||||
return
|
||||
}
|
||||
if (location.protocol == 'http:' &&
|
||||
!Config.Modes.http &&
|
||||
Config.App.domains.indexOf(location.hostname) != -1) {
|
||||
location.href = location.href.replace(/^http:/, 'https:')
|
||||
return
|
||||
}
|
||||
TelegramMeWebService.setAuthorized(false)
|
||||
WebPushApiManager.forceUnsubscribe()
|
||||
})
|
||||
@ -454,7 +442,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
||||
LayoutSwitchService.start()
|
||||
})
|
||||
|
||||
.controller('AppIMController', function ($q, qSync, $scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ContactsSelectService, ChangelogNotifyService, ErrorService, AppRuntimeManager, HttpsMigrateService, LayoutSwitchService, LocationParamsService, AppStickersManager) {
|
||||
.controller('AppIMController', function ($q, qSync, $scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ContactsSelectService, ChangelogNotifyService, ErrorService, AppRuntimeManager, LayoutSwitchService, LocationParamsService, AppStickersManager) {
|
||||
$scope.$on('$routeUpdate', updateCurDialog)
|
||||
|
||||
var pendingParams = false
|
||||
@ -686,7 +674,6 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
||||
}
|
||||
|
||||
ChangelogNotifyService.checkUpdate()
|
||||
HttpsMigrateService.start()
|
||||
LayoutSwitchService.start()
|
||||
LocationParamsService.start()
|
||||
AppStickersManager.start()
|
||||
|
File diff suppressed because one or more lines are too long
@ -34,7 +34,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
|
||||
if (Config.Modes.ssl || !Config.Modes.http) {
|
||||
var subdomain = sslSubdomains[dcID - 1] + (upload ? '-1' : '')
|
||||
var path = Config.Modes.test ? 'apiw_test1' : 'apiw1'
|
||||
chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path
|
||||
chosenServer = 'http://' + location.hostname + '/web/' + subdomain + '/' + path
|
||||
return chosenServer
|
||||
}
|
||||
|
||||
|
@ -172,14 +172,8 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
|
||||
if (!error.handled) {
|
||||
if (error.code == 401) {
|
||||
mtpLogOut()['finally'](function () {
|
||||
if (location.protocol == 'http:' &&
|
||||
!Config.Modes.http &&
|
||||
Config.App.domains.indexOf(location.hostname) != -1) {
|
||||
location.href = location.href.replace(/^http:/, 'https:')
|
||||
} else {
|
||||
location.hash = '/login'
|
||||
AppRuntimeManager.reload()
|
||||
}
|
||||
location.hash = '/login'
|
||||
AppRuntimeManager.reload()
|
||||
})
|
||||
} else {
|
||||
ErrorService.show({error: error})
|
||||
|
@ -2152,7 +2152,7 @@ angular.module('izhukov.utils', [])
|
||||
if (navigator.serviceWorker.controller) {
|
||||
navigator.serviceWorker.controller.postMessage(eventData)
|
||||
}
|
||||
isAliveTO = setTimeout(isAliveNotify, 10000)
|
||||
isAliveTO = setTimeout(isAliveNotify, 15000)
|
||||
}
|
||||
|
||||
function setSettings(newSettings) {
|
||||
|
@ -2759,7 +2759,7 @@ angular.module('myApp.services')
|
||||
incrementedMessageViews[curMessage.mid] = true
|
||||
needIncrementMessageViews.push(curMessage.mid)
|
||||
if (incrementMessageViewsTimeout === false) {
|
||||
incrementMessageViewsTimeout = setTimeout(incrementMessageViews, 10000)
|
||||
incrementMessageViewsTimeout = setTimeout(incrementMessageViews, 15000)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4564,46 +4564,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
||||
}
|
||||
})
|
||||
|
||||
.service('HttpsMigrateService', function (ErrorService, Storage) {
|
||||
var started = false
|
||||
|
||||
function check () {
|
||||
Storage.get('https_dismiss').then(function (ts) {
|
||||
if (!ts || tsNow() > ts + 43200000) {
|
||||
ErrorService.confirm({
|
||||
type: 'MIGRATE_TO_HTTPS'
|
||||
}).then(function () {
|
||||
var popup
|
||||
try {
|
||||
popup = window.open('https://web.telegram.org', '_blank')
|
||||
} catch (e) {}
|
||||
if (!popup) {
|
||||
location.href = 'https://web.telegram.org'
|
||||
}
|
||||
}, function () {
|
||||
Storage.set({https_dismiss: tsNow()})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function start () {
|
||||
if (started ||
|
||||
location.protocol != 'http:' ||
|
||||
Config.Modes.http ||
|
||||
Config.App.domains.indexOf(location.hostname) == -1) {
|
||||
return
|
||||
}
|
||||
started = true
|
||||
setTimeout(check, 120000)
|
||||
}
|
||||
|
||||
return {
|
||||
start: start,
|
||||
check: check
|
||||
}
|
||||
})
|
||||
|
||||
.service('LayoutSwitchService', function (ErrorService, Storage, AppRuntimeManager, $window) {
|
||||
var started = false
|
||||
var confirmShown = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user