|
|
@ -1,5 +1,5 @@ |
|
|
|
/*! |
|
|
|
/*! |
|
|
|
* Webogram v0.4.2 - messaging web application for MTProto |
|
|
|
* Webogram v0.4.3 - messaging web application for MTProto |
|
|
|
* https://github.com/zhukov/webogram
|
|
|
|
* https://github.com/zhukov/webogram
|
|
|
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com> |
|
|
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com> |
|
|
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
|
|
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
|
|
@ -791,22 +791,6 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
return result; |
|
|
|
}, function (error) { |
|
|
|
|
|
|
|
if (error.code == 401) { |
|
|
|
|
|
|
|
MtpApiManager.logOut()['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(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
error.handled = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return $q.reject(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -2626,6 +2610,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
$scope.password = {_: 'account.noPassword'}; |
|
|
|
$scope.password = {_: 'account.noPassword'}; |
|
|
|
updatePasswordState(); |
|
|
|
updatePasswordState(); |
|
|
|
var updatePasswordTimeout = false; |
|
|
|
var updatePasswordTimeout = false; |
|
|
|
|
|
|
|
var stopped = false; |
|
|
|
|
|
|
|
|
|
|
|
$scope.changePassword = function (options) { |
|
|
|
$scope.changePassword = function (options) { |
|
|
|
options = options || {}; |
|
|
|
options = options || {}; |
|
|
@ -2660,12 +2645,17 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
updatePasswordTimeout = false; |
|
|
|
updatePasswordTimeout = false; |
|
|
|
PasswordManager.getState().then(function (result) { |
|
|
|
PasswordManager.getState().then(function (result) { |
|
|
|
$scope.password = result; |
|
|
|
$scope.password = result; |
|
|
|
if (result._ == 'account.noPassword' && result.email_unconfirmed_pattern) { |
|
|
|
if (result._ == 'account.noPassword' && result.email_unconfirmed_pattern && !stopped) { |
|
|
|
updatePasswordTimeout = $timeout(updatePasswordState, 5000); |
|
|
|
updatePasswordTimeout = $timeout(updatePasswordState, 5000); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('$destroy', function () { |
|
|
|
|
|
|
|
$timeout.cancel(updatePasswordTimeout); |
|
|
|
|
|
|
|
stopped = true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function onPhotoSelected (photo) { |
|
|
|
function onPhotoSelected (photo) { |
|
|
|
if (!photo || !photo.type || photo.type.indexOf('image') !== 0) { |
|
|
|
if (!photo || !photo.type || photo.type.indexOf('image') !== 0) { |
|
|
@ -2997,6 +2987,7 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
$scope.slice = {limit: 20, limitDelta: 20}; |
|
|
|
$scope.slice = {limit: 20, limitDelta: 20}; |
|
|
|
|
|
|
|
|
|
|
|
var updateSessionsTimeout = false; |
|
|
|
var updateSessionsTimeout = false; |
|
|
|
|
|
|
|
var stopped = false; |
|
|
|
|
|
|
|
|
|
|
|
function updateSessions () { |
|
|
|
function updateSessions () { |
|
|
|
$timeout.cancel(updateSessionsTimeout); |
|
|
|
$timeout.cancel(updateSessionsTimeout); |
|
|
@ -3018,7 +3009,9 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
} |
|
|
|
} |
|
|
|
return sB.date_active - sA.date_active; |
|
|
|
return sB.date_active - sA.date_active; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
if (!stopped) { |
|
|
|
updateSessionsTimeout = $timeout(updateSessions, 5000); |
|
|
|
updateSessionsTimeout = $timeout(updateSessions, 5000); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -3042,6 +3035,11 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.$on('$destroy', function () { |
|
|
|
|
|
|
|
$timeout.cancel(updateSessionsTimeout); |
|
|
|
|
|
|
|
stopped = true; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.controller('PasswordUpdateModalController', function ($scope, $q, _, PasswordManager, MtpApiManager, ErrorService, $modalInstance) { |
|
|
|
.controller('PasswordUpdateModalController', function ($scope, $q, _, PasswordManager, MtpApiManager, ErrorService, $modalInstance) { |
|
|
|