Fixed notification empty group photo, mtproto baseDcID bug, empty thumb bug

This commit is contained in:
Igor Zhukov 2014-01-11 10:30:29 +04:00
parent 8d1f2706a5
commit f38f15f4a7
5 changed files with 21 additions and 17 deletions

View File

@ -32,14 +32,14 @@
<script type="text/javascript" src="js/lib/config.js"></script>
<script type="text/javascript" src="js/lib/mtproto.js"></script>
<script type="text/javascript" src="js/lib/mtproto.js?1"></script>
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/app.js"></script>
<script type="text/javascript" src="js/services.js?1"></script>
<script type="text/javascript" src="js/services.js?2"></script>
<script type="text/javascript" src="js/controllers.js?1"></script>
<script type="text/javascript" src="js/filters.js?1"></script>
<script type="text/javascript" src="js/directives.js?1"></script>
<script type="text/javascript" src="js/directives.js?2"></script>
</body>
</html>

View File

@ -331,8 +331,7 @@ angular.module('myApp.directives', ['myApp.filters'])
function link (scope, element, attrs) {
scope.$watch('thumb.location', function (newVal) {
if (!scope.thumb) dLog(222, scope);
if (!scope.thumb.location) {
if (!scope.thumb || !scope.thumb.location) {
element.attr('src', scope.thumb.placeholder || '');
return;
}

View File

@ -2117,14 +2117,23 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
};
function mtpInvokeApi (method, params, options) {
var deferred = $q.defer();
options = options || {};
var dcID = options.dcID || baseDcID || 1;
var deferred = $q.defer(),
dcID,
networkerPromise;
if (dcID = options.dcID) {
networkerPromise = mtpGetNetworker(dcID);
} else {
networkerPromise = AppConfigManager.get('dc').then(function (baseDcID) {
return mtpGetNetworker(dcID = baseDcID || 1);
});
}
var cachedNetworker;
mtpGetNetworker(dcID).then(function (networker) {
networkerPromise.then(function (networker) {
return (cachedNetworker = networker).wrapApiCall(method, params, options).then(
function (result) {
deferred.resolve(result);
@ -2175,13 +2184,9 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
};
function mtpGetUserID () {
var deferred = $q.defer();
AppConfigManager.get('user_auth').then(function (auth) {
deferred.resolve(auth.id || 0);
return AppConfigManager.get('user_auth').then(function (auth) {
return auth.id || 0;
});
return deferred.promise;
}
return {

View File

@ -1013,7 +1013,7 @@ angular.module('myApp.services', [])
notification.message = message.message;
notificationPhoto = AppChatsManager.getChatPhoto(-peerID);
notificationPhoto = AppChatsManager.getChatPhoto(-peerID, 'Chat');
peerString = AppChatsManager.getChatString(-peerID);
}

View File

@ -32,7 +32,7 @@
<span class="glyphicon glyphicon-camera"></span> Photo
</span>
<span ng-switch-when="messageMediaVideo">
<span class="glyphicon glyphicon-facetime-video"></span> Video
<span class="glyphicon glyphicon-facetime-video"></span> Video
</span>
<span ng-switch-when="messageMediaDocument">
<span class="glyphicon glyphicon-document"></span> Document