|
|
@ -580,7 +580,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
placeholder: 'img/placeholders/' + placeholder + 'Avatar' + chat.num + '@2x.png', |
|
|
|
placeholder: 'img/placeholders/' + placeholder + 'Avatar' + (Config.Mobile ? chat.num : Math.ceil(chat.num / 2)) + '@2x.png', |
|
|
|
location: cachedPhotoLocations[id] |
|
|
|
location: cachedPhotoLocations[id] |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
@ -1290,20 +1290,27 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
|
|
|
|
|
|
|
|
apiMessage.date -= serverTimeOffset; |
|
|
|
apiMessage.date -= serverTimeOffset; |
|
|
|
|
|
|
|
|
|
|
|
if (apiMessage.media && apiMessage.media._ == 'messageMediaPhoto') { |
|
|
|
if (apiMessage.media) { |
|
|
|
AppPhotosManager.savePhoto(apiMessage.media.photo); |
|
|
|
switch (apiMessage.media._) { |
|
|
|
} |
|
|
|
case 'messageMediaEmpty': |
|
|
|
if (apiMessage.media && apiMessage.media._ == 'messageMediaVideo') { |
|
|
|
delete apiMessage.media; |
|
|
|
AppVideoManager.saveVideo(apiMessage.media.video); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 'messageMediaPhoto': |
|
|
|
if (apiMessage.media && apiMessage.media._ == 'messageMediaDocument') { |
|
|
|
AppPhotosManager.savePhoto(apiMessage.media.photo); |
|
|
|
AppDocsManager.saveDoc(apiMessage.media.document); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 'messageMediaVideo': |
|
|
|
if (apiMessage.media && apiMessage.media._ == 'messageMediaAudio') { |
|
|
|
AppVideoManager.saveVideo(apiMessage.media.video); |
|
|
|
AppAudioManager.saveAudio(apiMessage.media.audio); |
|
|
|
break; |
|
|
|
} |
|
|
|
case 'messageMediaDocument': |
|
|
|
if (apiMessage.media && apiMessage.media._ == 'messageMediaUnsupported') { |
|
|
|
AppDocsManager.saveDoc(apiMessage.media.document); |
|
|
|
delete apiMessage.media.bytes; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'messageMediaAudio': |
|
|
|
|
|
|
|
AppAudioManager.saveAudio(apiMessage.media.audio); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case 'messageMediaUnsupported': |
|
|
|
|
|
|
|
delete apiMessage.media.bytes; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (apiMessage.action && apiMessage.action._ == 'messageActionChatEditPhoto') { |
|
|
|
if (apiMessage.action && apiMessage.action._ == 'messageActionChatEditPhoto') { |
|
|
|
AppPhotosManager.savePhoto(apiMessage.action.photo); |
|
|
|
AppPhotosManager.savePhoto(apiMessage.action.photo); |
|
|
@ -1335,7 +1342,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
flags: 3, |
|
|
|
flags: 3, |
|
|
|
date: tsNow(true) + serverTimeOffset, |
|
|
|
date: tsNow(true) + serverTimeOffset, |
|
|
|
message: text, |
|
|
|
message: text, |
|
|
|
media: {_: 'messageMediaEmpty'}, |
|
|
|
|
|
|
|
random_id: randomIDS, |
|
|
|
random_id: randomIDS, |
|
|
|
pending: true |
|
|
|
pending: true |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1813,8 +1819,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
|
|
|
|
|
|
|
|
var message = angular.copy(messagesStorage[msgID]) || {id: msgID}; |
|
|
|
var message = angular.copy(messagesStorage[msgID]) || {id: msgID}; |
|
|
|
|
|
|
|
|
|
|
|
message.fromUser = AppUsersManager.getUser(message.from_id); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (message.chatID = message.to_id.chat_id) { |
|
|
|
if (message.chatID = message.to_id.chat_id) { |
|
|
|
message.peerID = -message.chatID; |
|
|
|
message.peerID = -message.chatID; |
|
|
|
message.peerData = AppChatsManager.getChat(message.chatID); |
|
|
|
message.peerData = AppChatsManager.getChat(message.chatID); |
|
|
@ -1878,9 +1882,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
{noLinks: true, noLinebreaks: true} |
|
|
|
{noLinks: true, noLinebreaks: true} |
|
|
|
); |
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case 'messageMediaEmpty': |
|
|
|
|
|
|
|
delete message.media; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else if (message.action) { |
|
|
|
else if (message.action) { |
|
|
@ -2012,7 +2013,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
|
|
|
|
|
|
|
|
if (message.message) { |
|
|
|
if (message.message) { |
|
|
|
notificationMessage = RichTextProcessor.wrapPlainText(message.message); |
|
|
|
notificationMessage = RichTextProcessor.wrapPlainText(message.message); |
|
|
|
} else if (message.media && message.media._ != 'messageMediaEmpty') { |
|
|
|
} else if (message.media) { |
|
|
|
switch (message.media._) { |
|
|
|
switch (message.media._) { |
|
|
|
case 'messageMediaPhoto': notificationMessage = _('conversation_media_photo_raw'); break; |
|
|
|
case 'messageMediaPhoto': notificationMessage = _('conversation_media_photo_raw'); break; |
|
|
|
case 'messageMediaVideo': notificationMessage = _('conversation_media_video_raw'); break; |
|
|
|
case 'messageMediaVideo': notificationMessage = _('conversation_media_video_raw'); break; |
|
|
@ -3253,8 +3254,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
to_id: AppPeersManager.getOutputPeer(MtpApiManager.getUserID()), |
|
|
|
to_id: AppPeersManager.getOutputPeer(MtpApiManager.getUserID()), |
|
|
|
flags: 1, |
|
|
|
flags: 1, |
|
|
|
date: updateMessage.date, |
|
|
|
date: updateMessage.date, |
|
|
|
message: updateMessage.message, |
|
|
|
message: updateMessage.message |
|
|
|
media: {_: 'messageMediaEmpty'} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
pts: updateMessage.pts |
|
|
|
pts: updateMessage.pts |
|
|
|
}); |
|
|
|
}); |
|
|
@ -3276,8 +3276,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
to_id: AppPeersManager.getOutputPeer(-updateMessage.chat_id), |
|
|
|
to_id: AppPeersManager.getOutputPeer(-updateMessage.chat_id), |
|
|
|
flags: 1, |
|
|
|
flags: 1, |
|
|
|
date: updateMessage.date, |
|
|
|
date: updateMessage.date, |
|
|
|
message: updateMessage.message, |
|
|
|
message: updateMessage.message |
|
|
|
media: {_: 'messageMediaEmpty'} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
pts: updateMessage.pts |
|
|
|
pts: updateMessage.pts |
|
|
|
}); |
|
|
|
}); |
|
|
|