Browse Source

Fixed commands in channel

Closes #965
master
Igor Zhukov 9 years ago
parent
commit
ddc4c87b50
  1. 4
      app/js/directives.js
  2. 7
      app/js/lib/mtproto_wrapper.js

4
app/js/directives.js

@ -451,7 +451,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -451,7 +451,7 @@ angular.module('myApp.directives', ['myApp.filters'])
})
.directive('myMessageText', function(AppPeersManager, AppMessagesManager, AppUsersManager, RichTextProcessor) {
.directive('myMessageText', function(AppPeersManager, AppMessagesManager, AppChatsManager, AppUsersManager, RichTextProcessor) {
return {
link: link,
scope: {
@ -465,7 +465,7 @@ angular.module('myApp.directives', ['myApp.filters']) @@ -465,7 +465,7 @@ angular.module('myApp.directives', ['myApp.filters'])
var fromBot = fromUser && fromUser.pFlags.bot && fromUser.username || false;
var toPeerID = AppPeersManager.getPeerID(message.to_id);
var withBot = (fromBot ||
toPeerID < 0 ||
toPeerID < 0 && !(AppChatsManager.isChannel(-toPeerID) && !AppChatsManager.isMegagroup(-toPeerID)) ||
toPeerID > 0 && AppUsersManager.isBot(toPeerID));
var options = {

7
app/js/lib/mtproto_wrapper.js

@ -487,14 +487,14 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) @@ -487,14 +487,14 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
}
}
console.log(dT(), 'Dload file', dcID, location, size);
// console.log(dT(), 'Dload file', dcID, location, size);
var fileName = getFileName(location),
toFileEntry = options.toFileEntry || null,
cachedPromise = cachedSavePromises[fileName] || cachedDownloadPromises[fileName];
var fileStorage = getFileStorage();
console.log(dT(), 'fs', fileStorage.name, fileName, cachedPromise);
// console.log(dT(), 'fs', fileStorage.name, fileName, cachedPromise);
if (cachedPromise) {
if (toFileEntry) {
@ -520,9 +520,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) @@ -520,9 +520,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
};
console.log(dT(), 'fs get file', fileName, size);
fileStorage.getFile(fileName, size).then(function (blob) {
console.log(dT(), 'fs got file', fileName, size);
if (toFileEntry) {
FileManager.copy(blob, toFileEntry).then(function () {
deferred.resolve();
@ -531,7 +529,6 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) @@ -531,7 +529,6 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto'])
deferred.resolve(cachedDownloads[fileName] = blob);
}
}, function () {
console.log(dT(), 'fs fail file', fileName, size);
var fileWriterPromise = toFileEntry ? FileManager.getFileWriter(toFileEntry) : fileStorage.getFileWriter(fileName, mimeType);
var processDownloaded = function (bytes) {

Loading…
Cancel
Save