Commit 51add404 authored by DrKLO's avatar DrKLO

update to 1.3.6

parent a65f5f9f
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.telegram.messenger" package="org.telegram.messenger"
android:versionCode="126" android:versionCode="129"
android:versionName="1.3.5"> android:versionName="1.3.6">
<supports-screens android:anyDensity="true" <supports-screens android:anyDensity="true"
android:smallScreens="true" android:smallScreens="true"
......
...@@ -39,18 +39,19 @@ public class TLClassStore { ...@@ -39,18 +39,19 @@ public class TLClassStore {
classStore.put(TLRPC.TL_rpc_answer_dropped.constructor, TLRPC.TL_rpc_answer_dropped.class); classStore.put(TLRPC.TL_rpc_answer_dropped.constructor, TLRPC.TL_rpc_answer_dropped.class);
classStore.put(TLRPC.TL_rpc_answer_dropped_running.constructor, TLRPC.TL_rpc_answer_dropped_running.class); classStore.put(TLRPC.TL_rpc_answer_dropped_running.constructor, TLRPC.TL_rpc_answer_dropped_running.class);
classStore.put(TLRPC.TL_contacts_link.constructor, TLRPC.TL_contacts_link.class); classStore.put(TLRPC.TL_contacts_link.constructor, TLRPC.TL_contacts_link.class);
classStore.put(TLRPC.TL_encryptedFile.constructor, TLRPC.TL_encryptedFile.class);
classStore.put(TLRPC.TL_encryptedFileEmpty.constructor, TLRPC.TL_encryptedFileEmpty.class);
classStore.put(TLRPC.TL_peerUser.constructor, TLRPC.TL_peerUser.class); classStore.put(TLRPC.TL_peerUser.constructor, TLRPC.TL_peerUser.class);
classStore.put(TLRPC.TL_peerChat.constructor, TLRPC.TL_peerChat.class); classStore.put(TLRPC.TL_peerChat.constructor, TLRPC.TL_peerChat.class);
classStore.put(TLRPC.TL_encryptedFile.constructor, TLRPC.TL_encryptedFile.class);
classStore.put(TLRPC.TL_encryptedFileEmpty.constructor, TLRPC.TL_encryptedFileEmpty.class);
classStore.put(TLRPC.TL_destroy_session_ok.constructor, TLRPC.TL_destroy_session_ok.class); classStore.put(TLRPC.TL_destroy_session_ok.constructor, TLRPC.TL_destroy_session_ok.class);
classStore.put(TLRPC.TL_destroy_session_none.constructor, TLRPC.TL_destroy_session_none.class); classStore.put(TLRPC.TL_destroy_session_none.constructor, TLRPC.TL_destroy_session_none.class);
classStore.put(TLRPC.TL_updates_difference.constructor, TLRPC.TL_updates_difference.class);
classStore.put(TLRPC.TL_updates_getDifference.constructor, TLRPC.TL_updates_getDifference.class);
classStore.put(TLRPC.TL_updates_differenceSlice.constructor, TLRPC.TL_updates_differenceSlice.class);
classStore.put(TLRPC.TL_updates_differenceEmpty.constructor, TLRPC.TL_updates_differenceEmpty.class); classStore.put(TLRPC.TL_updates_differenceEmpty.constructor, TLRPC.TL_updates_differenceEmpty.class);
classStore.put(TLRPC.TL_updates_differenceSlice.constructor, TLRPC.TL_updates_differenceSlice.class);
classStore.put(TLRPC.TL_updates_difference.constructor, TLRPC.TL_updates_difference.class);
classStore.put(TLRPC.TL_geoPointEmpty.constructor, TLRPC.TL_geoPointEmpty.class); classStore.put(TLRPC.TL_geoPointEmpty.constructor, TLRPC.TL_geoPointEmpty.class);
classStore.put(TLRPC.TL_geoPoint.constructor, TLRPC.TL_geoPoint.class); classStore.put(TLRPC.TL_geoPoint.constructor, TLRPC.TL_geoPoint.class);
classStore.put(TLRPC.TL_help_appUpdate.constructor, TLRPC.TL_help_appUpdate.class);
classStore.put(TLRPC.TL_help_noAppUpdate.constructor, TLRPC.TL_help_noAppUpdate.class);
classStore.put(TLRPC.TL_messageForwarded.constructor, TLRPC.TL_messageForwarded.class); classStore.put(TLRPC.TL_messageForwarded.constructor, TLRPC.TL_messageForwarded.class);
classStore.put(TLRPC.TL_messageEmpty.constructor, TLRPC.TL_messageEmpty.class); classStore.put(TLRPC.TL_messageEmpty.constructor, TLRPC.TL_messageEmpty.class);
classStore.put(TLRPC.TL_message.constructor, TLRPC.TL_message.class); classStore.put(TLRPC.TL_message.constructor, TLRPC.TL_message.class);
...@@ -58,10 +59,13 @@ public class TLClassStore { ...@@ -58,10 +59,13 @@ public class TLClassStore {
classStore.put(TLRPC.TL_inputPhoneContact.constructor, TLRPC.TL_inputPhoneContact.class); classStore.put(TLRPC.TL_inputPhoneContact.constructor, TLRPC.TL_inputPhoneContact.class);
classStore.put(TLRPC.TL_invokeAfterMsg.constructor, TLRPC.TL_invokeAfterMsg.class); classStore.put(TLRPC.TL_invokeAfterMsg.constructor, TLRPC.TL_invokeAfterMsg.class);
classStore.put(TLRPC.TL_messageMediaVideo.constructor, TLRPC.TL_messageMediaVideo.class); classStore.put(TLRPC.TL_messageMediaVideo.constructor, TLRPC.TL_messageMediaVideo.class);
classStore.put(TLRPC.TL_messageMediaGeo.constructor, TLRPC.TL_messageMediaGeo.class);
classStore.put(TLRPC.TL_messageMediaPhoto.constructor, TLRPC.TL_messageMediaPhoto.class); classStore.put(TLRPC.TL_messageMediaPhoto.constructor, TLRPC.TL_messageMediaPhoto.class);
classStore.put(TLRPC.TL_messageMediaDocument.constructor, TLRPC.TL_messageMediaDocument.class);
classStore.put(TLRPC.TL_messageMediaGeo.constructor, TLRPC.TL_messageMediaGeo.class);
classStore.put(TLRPC.TL_messageMediaEmpty.constructor, TLRPC.TL_messageMediaEmpty.class); classStore.put(TLRPC.TL_messageMediaEmpty.constructor, TLRPC.TL_messageMediaEmpty.class);
classStore.put(TLRPC.TL_messageMediaAudio.constructor, TLRPC.TL_messageMediaAudio.class);
classStore.put(TLRPC.TL_messageMediaContact.constructor, TLRPC.TL_messageMediaContact.class); classStore.put(TLRPC.TL_messageMediaContact.constructor, TLRPC.TL_messageMediaContact.class);
classStore.put(TLRPC.TL_messageMediaUnsupported.constructor, TLRPC.TL_messageMediaUnsupported.class);
classStore.put(TLRPC.TL_auth_sentCode.constructor, TLRPC.TL_auth_sentCode.class); classStore.put(TLRPC.TL_auth_sentCode.constructor, TLRPC.TL_auth_sentCode.class);
classStore.put(TLRPC.TL_peerNotifySettingsEmpty.constructor, TLRPC.TL_peerNotifySettingsEmpty.class); classStore.put(TLRPC.TL_peerNotifySettingsEmpty.constructor, TLRPC.TL_peerNotifySettingsEmpty.class);
classStore.put(TLRPC.TL_peerNotifySettings.constructor, TLRPC.TL_peerNotifySettings.class); classStore.put(TLRPC.TL_peerNotifySettings.constructor, TLRPC.TL_peerNotifySettings.class);
...@@ -74,6 +78,8 @@ public class TLClassStore { ...@@ -74,6 +78,8 @@ public class TLClassStore {
classStore.put(TLRPC.TL_help_inviteText.constructor, TLRPC.TL_help_inviteText.class); classStore.put(TLRPC.TL_help_inviteText.constructor, TLRPC.TL_help_inviteText.class);
classStore.put(TLRPC.TL_messages_dhConfigNotModified.constructor, TLRPC.TL_messages_dhConfigNotModified.class); classStore.put(TLRPC.TL_messages_dhConfigNotModified.constructor, TLRPC.TL_messages_dhConfigNotModified.class);
classStore.put(TLRPC.TL_messages_dhConfig.constructor, TLRPC.TL_messages_dhConfig.class); classStore.put(TLRPC.TL_messages_dhConfig.constructor, TLRPC.TL_messages_dhConfig.class);
classStore.put(TLRPC.TL_audioEmpty.constructor, TLRPC.TL_audioEmpty.class);
classStore.put(TLRPC.TL_audio.constructor, TLRPC.TL_audio.class);
classStore.put(TLRPC.TL_destroy_sessions_res.constructor, TLRPC.TL_destroy_sessions_res.class); classStore.put(TLRPC.TL_destroy_sessions_res.constructor, TLRPC.TL_destroy_sessions_res.class);
classStore.put(TLRPC.TL_contacts_contacts.constructor, TLRPC.TL_contacts_contacts.class); classStore.put(TLRPC.TL_contacts_contacts.constructor, TLRPC.TL_contacts_contacts.class);
classStore.put(TLRPC.TL_contacts_contactsNotModified.constructor, TLRPC.TL_contacts_contactsNotModified.class); classStore.put(TLRPC.TL_contacts_contactsNotModified.constructor, TLRPC.TL_contacts_contactsNotModified.class);
...@@ -99,9 +105,11 @@ public class TLClassStore { ...@@ -99,9 +105,11 @@ public class TLClassStore {
classStore.put(TLRPC.TL_inputNotifyUsers.constructor, TLRPC.TL_inputNotifyUsers.class); classStore.put(TLRPC.TL_inputNotifyUsers.constructor, TLRPC.TL_inputNotifyUsers.class);
classStore.put(TLRPC.TL_inputNotifyGeoChatPeer.constructor, TLRPC.TL_inputNotifyGeoChatPeer.class); classStore.put(TLRPC.TL_inputNotifyGeoChatPeer.constructor, TLRPC.TL_inputNotifyGeoChatPeer.class);
classStore.put(TLRPC.TL_inputNotifyAll.constructor, TLRPC.TL_inputNotifyAll.class); classStore.put(TLRPC.TL_inputNotifyAll.constructor, TLRPC.TL_inputNotifyAll.class);
classStore.put(TLRPC.TL_inputAudioFileLocation.constructor, TLRPC.TL_inputAudioFileLocation.class);
classStore.put(TLRPC.TL_inputEncryptedFileLocation.constructor, TLRPC.TL_inputEncryptedFileLocation.class); classStore.put(TLRPC.TL_inputEncryptedFileLocation.constructor, TLRPC.TL_inputEncryptedFileLocation.class);
classStore.put(TLRPC.TL_inputFileLocation.constructor, TLRPC.TL_inputFileLocation.class);
classStore.put(TLRPC.TL_inputVideoFileLocation.constructor, TLRPC.TL_inputVideoFileLocation.class); classStore.put(TLRPC.TL_inputVideoFileLocation.constructor, TLRPC.TL_inputVideoFileLocation.class);
classStore.put(TLRPC.TL_inputDocumentFileLocation.constructor, TLRPC.TL_inputDocumentFileLocation.class);
classStore.put(TLRPC.TL_inputFileLocation.constructor, TLRPC.TL_inputFileLocation.class);
classStore.put(TLRPC.TL_photos_photo.constructor, TLRPC.TL_photos_photo.class); classStore.put(TLRPC.TL_photos_photo.constructor, TLRPC.TL_photos_photo.class);
classStore.put(TLRPC.TL_userContact.constructor, TLRPC.TL_userContact.class); classStore.put(TLRPC.TL_userContact.constructor, TLRPC.TL_userContact.class);
classStore.put(TLRPC.TL_userRequest.constructor, TLRPC.TL_userRequest.class); classStore.put(TLRPC.TL_userRequest.constructor, TLRPC.TL_userRequest.class);
...@@ -128,31 +136,43 @@ public class TLClassStore { ...@@ -128,31 +136,43 @@ public class TLClassStore {
classStore.put(TLRPC.TL_dh_gen_retry.constructor, TLRPC.TL_dh_gen_retry.class); classStore.put(TLRPC.TL_dh_gen_retry.constructor, TLRPC.TL_dh_gen_retry.class);
classStore.put(TLRPC.TL_dh_gen_fail.constructor, TLRPC.TL_dh_gen_fail.class); classStore.put(TLRPC.TL_dh_gen_fail.constructor, TLRPC.TL_dh_gen_fail.class);
classStore.put(TLRPC.TL_dh_gen_ok.constructor, TLRPC.TL_dh_gen_ok.class); classStore.put(TLRPC.TL_dh_gen_ok.constructor, TLRPC.TL_dh_gen_ok.class);
classStore.put(TLRPC.TL_peerNotifyEventsEmpty.constructor, TLRPC.TL_peerNotifyEventsEmpty.class);
classStore.put(TLRPC.TL_peerNotifyEventsAll.constructor, TLRPC.TL_peerNotifyEventsAll.class); classStore.put(TLRPC.TL_peerNotifyEventsAll.constructor, TLRPC.TL_peerNotifyEventsAll.class);
classStore.put(TLRPC.TL_chatLocated.constructor, TLRPC.TL_chatLocated.class); classStore.put(TLRPC.TL_chatLocated.constructor, TLRPC.TL_chatLocated.class);
classStore.put(TLRPC.TL_decryptedMessageService.constructor, TLRPC.TL_decryptedMessageService.class); classStore.put(TLRPC.TL_decryptedMessageService.constructor, TLRPC.TL_decryptedMessageService.class);
classStore.put(TLRPC.TL_decryptedMessage.constructor, TLRPC.TL_decryptedMessage.class); classStore.put(TLRPC.TL_decryptedMessage.constructor, TLRPC.TL_decryptedMessage.class);
classStore.put(TLRPC.TL_inputPeerNotifyEventsAll.constructor, TLRPC.TL_inputPeerNotifyEventsAll.class); classStore.put(TLRPC.TL_inputPeerNotifyEventsAll.constructor, TLRPC.TL_inputPeerNotifyEventsAll.class);
classStore.put(TLRPC.TL_inputPeerNotifyEventsEmpty.constructor, TLRPC.TL_inputPeerNotifyEventsEmpty.class);
classStore.put(TLRPC.TL_client_DH_inner_data.constructor, TLRPC.TL_client_DH_inner_data.class); classStore.put(TLRPC.TL_client_DH_inner_data.constructor, TLRPC.TL_client_DH_inner_data.class);
classStore.put(TLRPC.TL_video.constructor, TLRPC.TL_video.class); classStore.put(TLRPC.TL_video.constructor, TLRPC.TL_video.class);
classStore.put(TLRPC.TL_videoEmpty.constructor, TLRPC.TL_videoEmpty.class); classStore.put(TLRPC.TL_videoEmpty.constructor, TLRPC.TL_videoEmpty.class);
classStore.put(TLRPC.TL_contactBlocked.constructor, TLRPC.TL_contactBlocked.class); classStore.put(TLRPC.TL_contactBlocked.constructor, TLRPC.TL_contactBlocked.class);
classStore.put(TLRPC.TL_inputDocumentEmpty.constructor, TLRPC.TL_inputDocumentEmpty.class);
classStore.put(TLRPC.TL_inputDocument.constructor, TLRPC.TL_inputDocument.class);
classStore.put(TLRPC.TL_inputAppEvent.constructor, TLRPC.TL_inputAppEvent.class); classStore.put(TLRPC.TL_inputAppEvent.constructor, TLRPC.TL_inputAppEvent.class);
classStore.put(TLRPC.TL_messages_affectedHistory.constructor, TLRPC.TL_messages_affectedHistory.class); classStore.put(TLRPC.TL_messages_affectedHistory.constructor, TLRPC.TL_messages_affectedHistory.class);
classStore.put(TLRPC.TL_inputMediaUploadedPhoto.constructor, TLRPC.TL_inputMediaUploadedPhoto.class); classStore.put(TLRPC.TL_documentEmpty.constructor, TLRPC.TL_documentEmpty.class);
classStore.put(TLRPC.TL_document.constructor, TLRPC.TL_document.class);
classStore.put(TLRPC.TL_inputMediaContact.constructor, TLRPC.TL_inputMediaContact.class);
classStore.put(TLRPC.TL_inputMediaUploadedThumbDocument.constructor, TLRPC.TL_inputMediaUploadedThumbDocument.class);
classStore.put(TLRPC.TL_inputMediaAudio.constructor, TLRPC.TL_inputMediaAudio.class);
classStore.put(TLRPC.TL_inputMediaDocument.constructor, TLRPC.TL_inputMediaDocument.class);
classStore.put(TLRPC.TL_inputMediaVideo.constructor, TLRPC.TL_inputMediaVideo.class); classStore.put(TLRPC.TL_inputMediaVideo.constructor, TLRPC.TL_inputMediaVideo.class);
classStore.put(TLRPC.TL_inputMediaGeoPoint.constructor, TLRPC.TL_inputMediaGeoPoint.class); classStore.put(TLRPC.TL_inputMediaGeoPoint.constructor, TLRPC.TL_inputMediaGeoPoint.class);
classStore.put(TLRPC.TL_inputMediaContact.constructor, TLRPC.TL_inputMediaContact.class); classStore.put(TLRPC.TL_inputMediaEmpty.constructor, TLRPC.TL_inputMediaEmpty.class);
classStore.put(TLRPC.TL_inputMediaUploadedThumbVideo.constructor, TLRPC.TL_inputMediaUploadedThumbVideo.class); classStore.put(TLRPC.TL_inputMediaUploadedThumbVideo.constructor, TLRPC.TL_inputMediaUploadedThumbVideo.class);
classStore.put(TLRPC.TL_inputMediaUploadedPhoto.constructor, TLRPC.TL_inputMediaUploadedPhoto.class);
classStore.put(TLRPC.TL_inputMediaUploadedAudio.constructor, TLRPC.TL_inputMediaUploadedAudio.class);
classStore.put(TLRPC.TL_inputMediaUploadedVideo.constructor, TLRPC.TL_inputMediaUploadedVideo.class); classStore.put(TLRPC.TL_inputMediaUploadedVideo.constructor, TLRPC.TL_inputMediaUploadedVideo.class);
classStore.put(TLRPC.TL_inputMediaUploadedDocument.constructor, TLRPC.TL_inputMediaUploadedDocument.class);
classStore.put(TLRPC.TL_inputMediaPhoto.constructor, TLRPC.TL_inputMediaPhoto.class); classStore.put(TLRPC.TL_inputMediaPhoto.constructor, TLRPC.TL_inputMediaPhoto.class);
classStore.put(TLRPC.TL_inputMediaEmpty.constructor, TLRPC.TL_inputMediaEmpty.class);
classStore.put(TLRPC.TL_geochats_messagesSlice.constructor, TLRPC.TL_geochats_messagesSlice.class); classStore.put(TLRPC.TL_geochats_messagesSlice.constructor, TLRPC.TL_geochats_messagesSlice.class);
classStore.put(TLRPC.TL_geochats_messages.constructor, TLRPC.TL_geochats_messages.class); classStore.put(TLRPC.TL_geochats_messages.constructor, TLRPC.TL_geochats_messages.class);
classStore.put(TLRPC.TL_messages_sentMessage.constructor, TLRPC.TL_messages_sentMessage.class); classStore.put(TLRPC.TL_messages_sentMessage.constructor, TLRPC.TL_messages_sentMessage.class);
classStore.put(TLRPC.TL_messages_sentMessageLink.constructor, TLRPC.TL_messages_sentMessageLink.class); classStore.put(TLRPC.TL_messages_sentMessageLink.constructor, TLRPC.TL_messages_sentMessageLink.class);
classStore.put(TLRPC.TL_encryptedMessageService.constructor, TLRPC.TL_encryptedMessageService.class); classStore.put(TLRPC.TL_encryptedMessageService.constructor, TLRPC.TL_encryptedMessageService.class);
classStore.put(TLRPC.TL_encryptedMessage.constructor, TLRPC.TL_encryptedMessage.class); classStore.put(TLRPC.TL_encryptedMessage.constructor, TLRPC.TL_encryptedMessage.class);
classStore.put(TLRPC.TL_contactSuggested.constructor, TLRPC.TL_contactSuggested.class);
classStore.put(TLRPC.TL_server_DH_params_fail.constructor, TLRPC.TL_server_DH_params_fail.class); classStore.put(TLRPC.TL_server_DH_params_fail.constructor, TLRPC.TL_server_DH_params_fail.class);
classStore.put(TLRPC.TL_server_DH_params_ok.constructor, TLRPC.TL_server_DH_params_ok.class); classStore.put(TLRPC.TL_server_DH_params_ok.constructor, TLRPC.TL_server_DH_params_ok.class);
classStore.put(TLRPC.TL_userStatusEmpty.constructor, TLRPC.TL_userStatusEmpty.class); classStore.put(TLRPC.TL_userStatusEmpty.constructor, TLRPC.TL_userStatusEmpty.class);
...@@ -164,6 +184,7 @@ public class TLClassStore { ...@@ -164,6 +184,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_updateEncryptedMessagesRead.constructor, TLRPC.TL_updateEncryptedMessagesRead.class); classStore.put(TLRPC.TL_updateEncryptedMessagesRead.constructor, TLRPC.TL_updateEncryptedMessagesRead.class);
classStore.put(TLRPC.TL_updateContactLink.constructor, TLRPC.TL_updateContactLink.class); classStore.put(TLRPC.TL_updateContactLink.constructor, TLRPC.TL_updateContactLink.class);
classStore.put(TLRPC.TL_updateReadMessages.constructor, TLRPC.TL_updateReadMessages.class); classStore.put(TLRPC.TL_updateReadMessages.constructor, TLRPC.TL_updateReadMessages.class);
classStore.put(TLRPC.TL_updateChatParticipantDelete.constructor, TLRPC.TL_updateChatParticipantDelete.class);
classStore.put(TLRPC.TL_updateRestoreMessages.constructor, TLRPC.TL_updateRestoreMessages.class); classStore.put(TLRPC.TL_updateRestoreMessages.constructor, TLRPC.TL_updateRestoreMessages.class);
classStore.put(TLRPC.TL_updateUserTyping.constructor, TLRPC.TL_updateUserTyping.class); classStore.put(TLRPC.TL_updateUserTyping.constructor, TLRPC.TL_updateUserTyping.class);
classStore.put(TLRPC.TL_updateChatUserTyping.constructor, TLRPC.TL_updateChatUserTyping.class); classStore.put(TLRPC.TL_updateChatUserTyping.constructor, TLRPC.TL_updateChatUserTyping.class);
...@@ -173,6 +194,7 @@ public class TLClassStore { ...@@ -173,6 +194,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_updateMessageID.constructor, TLRPC.TL_updateMessageID.class); classStore.put(TLRPC.TL_updateMessageID.constructor, TLRPC.TL_updateMessageID.class);
classStore.put(TLRPC.TL_updateDeleteMessages.constructor, TLRPC.TL_updateDeleteMessages.class); classStore.put(TLRPC.TL_updateDeleteMessages.constructor, TLRPC.TL_updateDeleteMessages.class);
classStore.put(TLRPC.TL_updateEncryptedChatTyping.constructor, TLRPC.TL_updateEncryptedChatTyping.class); classStore.put(TLRPC.TL_updateEncryptedChatTyping.constructor, TLRPC.TL_updateEncryptedChatTyping.class);
classStore.put(TLRPC.TL_updateDcOptions.constructor, TLRPC.TL_updateDcOptions.class);
classStore.put(TLRPC.TL_updateChatParticipants.constructor, TLRPC.TL_updateChatParticipants.class); classStore.put(TLRPC.TL_updateChatParticipants.constructor, TLRPC.TL_updateChatParticipants.class);
classStore.put(TLRPC.TL_updateEncryption.constructor, TLRPC.TL_updateEncryption.class); classStore.put(TLRPC.TL_updateEncryption.constructor, TLRPC.TL_updateEncryption.class);
classStore.put(TLRPC.TL_updateActivation.constructor, TLRPC.TL_updateActivation.class); classStore.put(TLRPC.TL_updateActivation.constructor, TLRPC.TL_updateActivation.class);
...@@ -180,10 +202,13 @@ public class TLClassStore { ...@@ -180,10 +202,13 @@ public class TLClassStore {
classStore.put(TLRPC.TL_updateNewGeoChatMessage.constructor, TLRPC.TL_updateNewGeoChatMessage.class); classStore.put(TLRPC.TL_updateNewGeoChatMessage.constructor, TLRPC.TL_updateNewGeoChatMessage.class);
classStore.put(TLRPC.TL_updateUserPhoto.constructor, TLRPC.TL_updateUserPhoto.class); classStore.put(TLRPC.TL_updateUserPhoto.constructor, TLRPC.TL_updateUserPhoto.class);
classStore.put(TLRPC.TL_updateContactRegistered.constructor, TLRPC.TL_updateContactRegistered.class); classStore.put(TLRPC.TL_updateContactRegistered.constructor, TLRPC.TL_updateContactRegistered.class);
classStore.put(TLRPC.TL_updateChatParticipantAdd.constructor, TLRPC.TL_updateChatParticipantAdd.class);
classStore.put(TLRPC.TL_updateUserStatus.constructor, TLRPC.TL_updateUserStatus.class); classStore.put(TLRPC.TL_updateUserStatus.constructor, TLRPC.TL_updateUserStatus.class);
classStore.put(TLRPC.TL_contacts_suggested.constructor, TLRPC.TL_contacts_suggested.class);
classStore.put(TLRPC.TL_rpc_error.constructor, TLRPC.TL_rpc_error.class); classStore.put(TLRPC.TL_rpc_error.constructor, TLRPC.TL_rpc_error.class);
classStore.put(TLRPC.TL_rpc_req_error.constructor, TLRPC.TL_rpc_req_error.class); classStore.put(TLRPC.TL_rpc_req_error.constructor, TLRPC.TL_rpc_req_error.class);
classStore.put(TLRPC.TL_inputEncryptedFile.constructor, TLRPC.TL_inputEncryptedFile.class); classStore.put(TLRPC.TL_inputEncryptedFile.constructor, TLRPC.TL_inputEncryptedFile.class);
classStore.put(TLRPC.TL_inputEncryptedFileBigUploaded.constructor, TLRPC.TL_inputEncryptedFileBigUploaded.class);
classStore.put(TLRPC.TL_inputEncryptedFileEmpty.constructor, TLRPC.TL_inputEncryptedFileEmpty.class); classStore.put(TLRPC.TL_inputEncryptedFileEmpty.constructor, TLRPC.TL_inputEncryptedFileEmpty.class);
classStore.put(TLRPC.TL_inputEncryptedFileUploaded.constructor, TLRPC.TL_inputEncryptedFileUploaded.class); classStore.put(TLRPC.TL_inputEncryptedFileUploaded.constructor, TLRPC.TL_inputEncryptedFileUploaded.class);
classStore.put(TLRPC.TL_decryptedMessageActionSetMessageTTL.constructor, TLRPC.TL_decryptedMessageActionSetMessageTTL.class); classStore.put(TLRPC.TL_decryptedMessageActionSetMessageTTL.constructor, TLRPC.TL_decryptedMessageActionSetMessageTTL.class);
...@@ -204,13 +229,17 @@ public class TLClassStore { ...@@ -204,13 +229,17 @@ public class TLClassStore {
classStore.put(TLRPC.TL_geochats_statedMessage.constructor, TLRPC.TL_geochats_statedMessage.class); classStore.put(TLRPC.TL_geochats_statedMessage.constructor, TLRPC.TL_geochats_statedMessage.class);
classStore.put(TLRPC.TL_contact.constructor, TLRPC.TL_contact.class); classStore.put(TLRPC.TL_contact.constructor, TLRPC.TL_contact.class);
classStore.put(TLRPC.TL_config.constructor, TLRPC.TL_config.class); classStore.put(TLRPC.TL_config.constructor, TLRPC.TL_config.class);
classStore.put(TLRPC.TL_inputAudio.constructor, TLRPC.TL_inputAudio.class);
classStore.put(TLRPC.TL_inputAudioEmpty.constructor, TLRPC.TL_inputAudioEmpty.class);
classStore.put(TLRPC.TL_messages_chats.constructor, TLRPC.TL_messages_chats.class); classStore.put(TLRPC.TL_messages_chats.constructor, TLRPC.TL_messages_chats.class);
classStore.put(TLRPC.TL_contacts_found.constructor, TLRPC.TL_contacts_found.class);
classStore.put(TLRPC.TL_chatParticipants.constructor, TLRPC.TL_chatParticipants.class); classStore.put(TLRPC.TL_chatParticipants.constructor, TLRPC.TL_chatParticipants.class);
classStore.put(TLRPC.TL_chatParticipantsForbidden.constructor, TLRPC.TL_chatParticipantsForbidden.class); classStore.put(TLRPC.TL_chatParticipantsForbidden.constructor, TLRPC.TL_chatParticipantsForbidden.class);
classStore.put(TLRPC.TL_decryptedMessageMediaContact.constructor, TLRPC.TL_decryptedMessageMediaContact.class); classStore.put(TLRPC.TL_decryptedMessageMediaDocument.constructor, TLRPC.TL_decryptedMessageMediaDocument.class);
classStore.put(TLRPC.TL_decryptedMessageMediaVideo.constructor, TLRPC.TL_decryptedMessageMediaVideo.class);
classStore.put(TLRPC.TL_decryptedMessageMediaGeoPoint.constructor, TLRPC.TL_decryptedMessageMediaGeoPoint.class); classStore.put(TLRPC.TL_decryptedMessageMediaGeoPoint.constructor, TLRPC.TL_decryptedMessageMediaGeoPoint.class);
classStore.put(TLRPC.TL_decryptedMessageMediaFile.constructor, TLRPC.TL_decryptedMessageMediaFile.class); classStore.put(TLRPC.TL_decryptedMessageMediaAudio.constructor, TLRPC.TL_decryptedMessageMediaAudio.class);
classStore.put(TLRPC.TL_decryptedMessageMediaVideo.constructor, TLRPC.TL_decryptedMessageMediaVideo.class);
classStore.put(TLRPC.TL_decryptedMessageMediaContact.constructor, TLRPC.TL_decryptedMessageMediaContact.class);
classStore.put(TLRPC.TL_decryptedMessageMediaEmpty.constructor, TLRPC.TL_decryptedMessageMediaEmpty.class); classStore.put(TLRPC.TL_decryptedMessageMediaEmpty.constructor, TLRPC.TL_decryptedMessageMediaEmpty.class);
classStore.put(TLRPC.TL_decryptedMessageMediaPhoto.constructor, TLRPC.TL_decryptedMessageMediaPhoto.class); classStore.put(TLRPC.TL_decryptedMessageMediaPhoto.constructor, TLRPC.TL_decryptedMessageMediaPhoto.class);
classStore.put(TLRPC.TL_chatParticipant.constructor, TLRPC.TL_chatParticipant.class); classStore.put(TLRPC.TL_chatParticipant.constructor, TLRPC.TL_chatParticipant.class);
...@@ -231,25 +260,26 @@ public class TLClassStore { ...@@ -231,25 +260,26 @@ public class TLClassStore {
classStore.put(TLRPC.TL_inputMessagesFilterEmpty.constructor, TLRPC.TL_inputMessagesFilterEmpty.class); classStore.put(TLRPC.TL_inputMessagesFilterEmpty.constructor, TLRPC.TL_inputMessagesFilterEmpty.class);
classStore.put(TLRPC.TL_inputMessagesFilterPhotos.constructor, TLRPC.TL_inputMessagesFilterPhotos.class); classStore.put(TLRPC.TL_inputMessagesFilterPhotos.constructor, TLRPC.TL_inputMessagesFilterPhotos.class);
classStore.put(TLRPC.TL_inputMessagesFilterPhotoVideo.constructor, TLRPC.TL_inputMessagesFilterPhotoVideo.class); classStore.put(TLRPC.TL_inputMessagesFilterPhotoVideo.constructor, TLRPC.TL_inputMessagesFilterPhotoVideo.class);
classStore.put(TLRPC.TL_geochats_located.constructor, TLRPC.TL_geochats_located.class);
classStore.put(TLRPC.TL_msgs_state_info.constructor, TLRPC.TL_msgs_state_info.class); classStore.put(TLRPC.TL_msgs_state_info.constructor, TLRPC.TL_msgs_state_info.class);
classStore.put(TLRPC.TL_upload_file.constructor, TLRPC.TL_upload_file.class); classStore.put(TLRPC.TL_upload_file.constructor, TLRPC.TL_upload_file.class);
classStore.put(TLRPC.TL_dialog.constructor, TLRPC.TL_dialog.class); classStore.put(TLRPC.TL_dialog.constructor, TLRPC.TL_dialog.class);
classStore.put(TLRPC.TL_messages_messageEmpty.constructor, TLRPC.TL_messages_messageEmpty.class);
classStore.put(TLRPC.TL_messages_message.constructor, TLRPC.TL_messages_message.class);
classStore.put(TLRPC.TL_fileLocation.constructor, TLRPC.TL_fileLocation.class); classStore.put(TLRPC.TL_fileLocation.constructor, TLRPC.TL_fileLocation.class);
classStore.put(TLRPC.TL_fileLocationUnavailable.constructor, TLRPC.TL_fileLocationUnavailable.class); classStore.put(TLRPC.TL_fileLocationUnavailable.constructor, TLRPC.TL_fileLocationUnavailable.class);
classStore.put(TLRPC.TL_messages_messageEmpty.constructor, TLRPC.TL_messages_messageEmpty.class);
classStore.put(TLRPC.TL_messages_message.constructor, TLRPC.TL_messages_message.class);
classStore.put(TLRPC.TL_geochats_located.constructor, TLRPC.TL_geochats_located.class);
classStore.put(TLRPC.TL_inputGeoChat.constructor, TLRPC.TL_inputGeoChat.class); classStore.put(TLRPC.TL_inputGeoChat.constructor, TLRPC.TL_inputGeoChat.class);
classStore.put(TLRPC.TL_protoMessage.constructor, TLRPC.TL_protoMessage.class); classStore.put(TLRPC.TL_protoMessage.constructor, TLRPC.TL_protoMessage.class);
classStore.put(TLRPC.TL_photoSize.constructor, TLRPC.TL_photoSize.class); classStore.put(TLRPC.TL_photoSize.constructor, TLRPC.TL_photoSize.class);
classStore.put(TLRPC.TL_photoSizeEmpty.constructor, TLRPC.TL_photoSizeEmpty.class); classStore.put(TLRPC.TL_photoSizeEmpty.constructor, TLRPC.TL_photoSizeEmpty.class);
classStore.put(TLRPC.TL_photoCachedSize.constructor, TLRPC.TL_photoCachedSize.class); classStore.put(TLRPC.TL_photoCachedSize.constructor, TLRPC.TL_photoCachedSize.class);
classStore.put(TLRPC.TL_contactFound.constructor, TLRPC.TL_contactFound.class);
classStore.put(TLRPC.TL_inputFileBig.constructor, TLRPC.TL_inputFileBig.class);
classStore.put(TLRPC.TL_inputFile.constructor, TLRPC.TL_inputFile.class); classStore.put(TLRPC.TL_inputFile.constructor, TLRPC.TL_inputFile.class);
classStore.put(TLRPC.TL_messages_statedMessageLink.constructor, TLRPC.TL_messages_statedMessageLink.class); classStore.put(TLRPC.TL_messages_statedMessageLink.constructor, TLRPC.TL_messages_statedMessageLink.class);
classStore.put(TLRPC.TL_messages_statedMessage.constructor, TLRPC.TL_messages_statedMessage.class); classStore.put(TLRPC.TL_messages_statedMessage.constructor, TLRPC.TL_messages_statedMessage.class);
classStore.put(TLRPC.TL_userFull.constructor, TLRPC.TL_userFull.class); classStore.put(TLRPC.TL_userFull.constructor, TLRPC.TL_userFull.class);
classStore.put(TLRPC.TL_msg_new_detailed_info.constructor, TLRPC.TL_msg_new_detailed_info.class); classStore.put(TLRPC.TL_updates_state.constructor, TLRPC.TL_updates_state.class);
classStore.put(TLRPC.TL_msg_detailed_info.constructor, TLRPC.TL_msg_detailed_info.class);
classStore.put(TLRPC.TL_resPQ.constructor, TLRPC.TL_resPQ.class); classStore.put(TLRPC.TL_resPQ.constructor, TLRPC.TL_resPQ.class);
classStore.put(TLRPC.TL_updateShortChatMessage.constructor, TLRPC.TL_updateShortChatMessage.class); classStore.put(TLRPC.TL_updateShortChatMessage.constructor, TLRPC.TL_updateShortChatMessage.class);
classStore.put(TLRPC.TL_updates.constructor, TLRPC.TL_updates.class); classStore.put(TLRPC.TL_updates.constructor, TLRPC.TL_updates.class);
...@@ -260,7 +290,8 @@ public class TLClassStore { ...@@ -260,7 +290,8 @@ public class TLClassStore {
classStore.put(TLRPC.TL_messages_chat.constructor, TLRPC.TL_messages_chat.class); classStore.put(TLRPC.TL_messages_chat.constructor, TLRPC.TL_messages_chat.class);
classStore.put(TLRPC.TL_wallPaper.constructor, TLRPC.TL_wallPaper.class); classStore.put(TLRPC.TL_wallPaper.constructor, TLRPC.TL_wallPaper.class);
classStore.put(TLRPC.TL_wallPaperSolid.constructor, TLRPC.TL_wallPaperSolid.class); classStore.put(TLRPC.TL_wallPaperSolid.constructor, TLRPC.TL_wallPaperSolid.class);
classStore.put(TLRPC.TL_updates_state.constructor, TLRPC.TL_updates_state.class); classStore.put(TLRPC.TL_msg_new_detailed_info.constructor, TLRPC.TL_msg_new_detailed_info.class);
classStore.put(TLRPC.TL_msg_detailed_info.constructor, TLRPC.TL_msg_detailed_info.class);
classStore.put(TLRPC.TL_inputEncryptedChat.constructor, TLRPC.TL_inputEncryptedChat.class); classStore.put(TLRPC.TL_inputEncryptedChat.constructor, TLRPC.TL_inputEncryptedChat.class);
classStore.put(TLRPC.TL_inputChatPhoto.constructor, TLRPC.TL_inputChatPhoto.class); classStore.put(TLRPC.TL_inputChatPhoto.constructor, TLRPC.TL_inputChatPhoto.class);
classStore.put(TLRPC.TL_inputChatPhotoEmpty.constructor, TLRPC.TL_inputChatPhotoEmpty.class); classStore.put(TLRPC.TL_inputChatPhotoEmpty.constructor, TLRPC.TL_inputChatPhotoEmpty.class);
...@@ -277,6 +308,7 @@ public class TLClassStore { ...@@ -277,6 +308,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_inputPeerSelf.constructor, TLRPC.TL_inputPeerSelf.class); classStore.put(TLRPC.TL_inputPeerSelf.constructor, TLRPC.TL_inputPeerSelf.class);
classStore.put(TLRPC.TL_inputPeerForeign.constructor, TLRPC.TL_inputPeerForeign.class); classStore.put(TLRPC.TL_inputPeerForeign.constructor, TLRPC.TL_inputPeerForeign.class);
classStore.put(TLRPC.TL_dcOption.constructor, TLRPC.TL_dcOption.class); classStore.put(TLRPC.TL_dcOption.constructor, TLRPC.TL_dcOption.class);
classStore.put(TLRPC.TL_decryptedMessageLayer.constructor, TLRPC.TL_decryptedMessageLayer.class);
classStore.put(TLRPC.TL_inputPhotoCropAuto.constructor, TLRPC.TL_inputPhotoCropAuto.class); classStore.put(TLRPC.TL_inputPhotoCropAuto.constructor, TLRPC.TL_inputPhotoCropAuto.class);
classStore.put(TLRPC.TL_inputPhotoCrop.constructor, TLRPC.TL_inputPhotoCrop.class); classStore.put(TLRPC.TL_inputPhotoCrop.constructor, TLRPC.TL_inputPhotoCrop.class);
classStore.put(TLRPC.TL_messages_dialogs.constructor, TLRPC.TL_messages_dialogs.class); classStore.put(TLRPC.TL_messages_dialogs.constructor, TLRPC.TL_messages_dialogs.class);
...@@ -295,6 +327,7 @@ public class TLClassStore { ...@@ -295,6 +327,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_auth_signUp.constructor, TLRPC.TL_auth_signUp.class); classStore.put(TLRPC.TL_auth_signUp.constructor, TLRPC.TL_auth_signUp.class);
classStore.put(TLRPC.TL_auth_signIn.constructor, TLRPC.TL_auth_signIn.class); classStore.put(TLRPC.TL_auth_signIn.constructor, TLRPC.TL_auth_signIn.class);
classStore.put(TLRPC.TL_auth_logOut.constructor, TLRPC.TL_auth_logOut.class); classStore.put(TLRPC.TL_auth_logOut.constructor, TLRPC.TL_auth_logOut.class);
classStore.put(TLRPC.TL_auth_resetAuthorizations.constructor, TLRPC.TL_auth_resetAuthorizations.class);
classStore.put(TLRPC.TL_auth_sendInvites.constructor, TLRPC.TL_auth_sendInvites.class); classStore.put(TLRPC.TL_auth_sendInvites.constructor, TLRPC.TL_auth_sendInvites.class);
classStore.put(TLRPC.TL_auth_exportAuthorization.constructor, TLRPC.TL_auth_exportAuthorization.class); classStore.put(TLRPC.TL_auth_exportAuthorization.constructor, TLRPC.TL_auth_exportAuthorization.class);
classStore.put(TLRPC.TL_auth_importAuthorization.constructor, TLRPC.TL_auth_importAuthorization.class); classStore.put(TLRPC.TL_auth_importAuthorization.constructor, TLRPC.TL_auth_importAuthorization.class);
...@@ -311,6 +344,8 @@ public class TLClassStore { ...@@ -311,6 +344,8 @@ public class TLClassStore {
classStore.put(TLRPC.TL_contacts_getStatuses.constructor, TLRPC.TL_contacts_getStatuses.class); classStore.put(TLRPC.TL_contacts_getStatuses.constructor, TLRPC.TL_contacts_getStatuses.class);
classStore.put(TLRPC.TL_contacts_getContacts.constructor, TLRPC.TL_contacts_getContacts.class); classStore.put(TLRPC.TL_contacts_getContacts.constructor, TLRPC.TL_contacts_getContacts.class);
classStore.put(TLRPC.TL_contacts_importContacts.constructor, TLRPC.TL_contacts_importContacts.class); classStore.put(TLRPC.TL_contacts_importContacts.constructor, TLRPC.TL_contacts_importContacts.class);
classStore.put(TLRPC.TL_contacts_search.constructor, TLRPC.TL_contacts_search.class);
classStore.put(TLRPC.TL_contacts_getSuggested.constructor, TLRPC.TL_contacts_getSuggested.class);
classStore.put(TLRPC.TL_contacts_deleteContact.constructor, TLRPC.TL_contacts_deleteContact.class); classStore.put(TLRPC.TL_contacts_deleteContact.constructor, TLRPC.TL_contacts_deleteContact.class);
classStore.put(TLRPC.TL_contacts_deleteContacts.constructor, TLRPC.TL_contacts_deleteContacts.class); classStore.put(TLRPC.TL_contacts_deleteContacts.constructor, TLRPC.TL_contacts_deleteContacts.class);
classStore.put(TLRPC.TL_contacts_block.constructor, TLRPC.TL_contacts_block.class); classStore.put(TLRPC.TL_contacts_block.constructor, TLRPC.TL_contacts_block.class);
...@@ -337,12 +372,14 @@ public class TLClassStore { ...@@ -337,12 +372,14 @@ public class TLClassStore {
classStore.put(TLRPC.TL_messages_deleteChatUser.constructor, TLRPC.TL_messages_deleteChatUser.class); classStore.put(TLRPC.TL_messages_deleteChatUser.constructor, TLRPC.TL_messages_deleteChatUser.class);
classStore.put(TLRPC.TL_messages_createChat.constructor, TLRPC.TL_messages_createChat.class); classStore.put(TLRPC.TL_messages_createChat.constructor, TLRPC.TL_messages_createChat.class);
classStore.put(TLRPC.TL_updates_getState.constructor, TLRPC.TL_updates_getState.class); classStore.put(TLRPC.TL_updates_getState.constructor, TLRPC.TL_updates_getState.class);
classStore.put(TLRPC.TL_updates_getDifference.constructor, TLRPC.TL_updates_getDifference.class);
classStore.put(TLRPC.TL_photos_updateProfilePhoto.constructor, TLRPC.TL_photos_updateProfilePhoto.class); classStore.put(TLRPC.TL_photos_updateProfilePhoto.constructor, TLRPC.TL_photos_updateProfilePhoto.class);
classStore.put(TLRPC.TL_photos_uploadProfilePhoto.constructor, TLRPC.TL_photos_uploadProfilePhoto.class); classStore.put(TLRPC.TL_photos_uploadProfilePhoto.constructor, TLRPC.TL_photos_uploadProfilePhoto.class);
classStore.put(TLRPC.TL_upload_saveFilePart.constructor, TLRPC.TL_upload_saveFilePart.class); classStore.put(TLRPC.TL_upload_saveFilePart.constructor, TLRPC.TL_upload_saveFilePart.class);
classStore.put(TLRPC.TL_upload_getFile.constructor, TLRPC.TL_upload_getFile.class); classStore.put(TLRPC.TL_upload_getFile.constructor, TLRPC.TL_upload_getFile.class);
classStore.put(TLRPC.TL_help_getConfig.constructor, TLRPC.TL_help_getConfig.class); classStore.put(TLRPC.TL_help_getConfig.constructor, TLRPC.TL_help_getConfig.class);
classStore.put(TLRPC.TL_help_getNearestDc.constructor, TLRPC.TL_help_getNearestDc.class); classStore.put(TLRPC.TL_help_getNearestDc.constructor, TLRPC.TL_help_getNearestDc.class);
classStore.put(TLRPC.TL_help_getAppUpdate.constructor, TLRPC.TL_help_getAppUpdate.class);
classStore.put(TLRPC.TL_help_saveAppLog.constructor, TLRPC.TL_help_saveAppLog.class); classStore.put(TLRPC.TL_help_saveAppLog.constructor, TLRPC.TL_help_saveAppLog.class);
classStore.put(TLRPC.TL_help_getInviteText.constructor, TLRPC.TL_help_getInviteText.class); classStore.put(TLRPC.TL_help_getInviteText.constructor, TLRPC.TL_help_getInviteText.class);
classStore.put(TLRPC.TL_photos_getUserPhotos.constructor, TLRPC.TL_photos_getUserPhotos.class); classStore.put(TLRPC.TL_photos_getUserPhotos.constructor, TLRPC.TL_photos_getUserPhotos.class);
...@@ -360,7 +397,6 @@ public class TLClassStore { ...@@ -360,7 +397,6 @@ public class TLClassStore {
classStore.put(TLRPC.TL_geochats_sendMessage.constructor, TLRPC.TL_geochats_sendMessage.class); classStore.put(TLRPC.TL_geochats_sendMessage.constructor, TLRPC.TL_geochats_sendMessage.class);
classStore.put(TLRPC.TL_geochats_sendMedia.constructor, TLRPC.TL_geochats_sendMedia.class); classStore.put(TLRPC.TL_geochats_sendMedia.constructor, TLRPC.TL_geochats_sendMedia.class);
classStore.put(TLRPC.TL_geochats_createGeoChat.constructor, TLRPC.TL_geochats_createGeoChat.class); classStore.put(TLRPC.TL_geochats_createGeoChat.constructor, TLRPC.TL_geochats_createGeoChat.class);
classStore.put(TLRPC.TL_updates_getDifference.constructor, TLRPC.TL_updates_getDifference.class);
classStore.put(TLRPC.TL_messages_getDhConfig.constructor, TLRPC.TL_messages_getDhConfig.class); classStore.put(TLRPC.TL_messages_getDhConfig.constructor, TLRPC.TL_messages_getDhConfig.class);
classStore.put(TLRPC.TL_messages_requestEncryption.constructor, TLRPC.TL_messages_requestEncryption.class); classStore.put(TLRPC.TL_messages_requestEncryption.constructor, TLRPC.TL_messages_requestEncryption.class);
classStore.put(TLRPC.TL_messages_acceptEncryption.constructor, TLRPC.TL_messages_acceptEncryption.class); classStore.put(TLRPC.TL_messages_acceptEncryption.constructor, TLRPC.TL_messages_acceptEncryption.class);
...@@ -372,20 +408,20 @@ public class TLClassStore { ...@@ -372,20 +408,20 @@ public class TLClassStore {
classStore.put(TLRPC.TL_messages_sendEncryptedService.constructor, TLRPC.TL_messages_sendEncryptedService.class); classStore.put(TLRPC.TL_messages_sendEncryptedService.constructor, TLRPC.TL_messages_sendEncryptedService.class);
classStore.put(TLRPC.TL_messages_receivedQueue.constructor, TLRPC.TL_messages_receivedQueue.class); classStore.put(TLRPC.TL_messages_receivedQueue.constructor, TLRPC.TL_messages_receivedQueue.class);
classStore.put(TLRPC.TL_upload_saveBigFilePart.constructor, TLRPC.TL_upload_saveBigFilePart.class); classStore.put(TLRPC.TL_upload_saveBigFilePart.constructor, TLRPC.TL_upload_saveBigFilePart.class);
classStore.put(TLRPC.TL_inputEncryptedFileBigUploaded.constructor, TLRPC.TL_inputEncryptedFileBigUploaded.class);
classStore.put(TLRPC.TL_inputFileBig.constructor, TLRPC.TL_inputFileBig.class);
classStore.put(TLRPC.TL_messageMediaUnsupported.constructor, TLRPC.TL_messageMediaUnsupported.class);
classStore.put(TLRPC.TL_msg_container.constructor, TLRPC.TL_msg_container.class); classStore.put(TLRPC.TL_msg_container.constructor, TLRPC.TL_msg_container.class);
classStore.put(TLRPC.TL_fileEncryptedLocation.constructor, TLRPC.TL_fileEncryptedLocation.class); classStore.put(TLRPC.TL_fileEncryptedLocation.constructor, TLRPC.TL_fileEncryptedLocation.class);
classStore.put(TLRPC.TL_messageActionTTLChange.constructor, TLRPC.TL_messageActionTTLChange.class); classStore.put(TLRPC.TL_messageActionTTLChange.constructor, TLRPC.TL_messageActionTTLChange.class);
classStore.put(TLRPC.TL_videoEncrypted.constructor, TLRPC.TL_videoEncrypted.class); classStore.put(TLRPC.TL_videoEncrypted.constructor, TLRPC.TL_videoEncrypted.class);
classStore.put(TLRPC.TL_documentEncrypted.constructor, TLRPC.TL_documentEncrypted.class);
classStore.put(TLRPC.TL_gzip_packed.constructor, TLRPC.TL_gzip_packed.class); classStore.put(TLRPC.TL_gzip_packed.constructor, TLRPC.TL_gzip_packed.class);
classStore.put(TLRPC.Vector.constructor, TLRPC.Vector.class); classStore.put(TLRPC.Vector.constructor, TLRPC.Vector.class);
classStore.put(TLRPC.TL_userProfilePhotoOld.constructor, TLRPC.TL_userProfilePhotoOld.class); classStore.put(TLRPC.TL_userProfilePhotoOld.constructor, TLRPC.TL_userProfilePhotoOld.class);
classStore.put(TLRPC.TL_messageActionUserUpdatedPhoto.constructor, TLRPC.TL_messageActionUserUpdatedPhoto.class); classStore.put(TLRPC.TL_messageActionUserUpdatedPhoto.constructor, TLRPC.TL_messageActionUserUpdatedPhoto.class);
classStore.put(TLRPC.TL_messageActionUserJoined.constructor, TLRPC.TL_messageActionUserJoined.class); classStore.put(TLRPC.TL_messageActionUserJoined.constructor, TLRPC.TL_messageActionUserJoined.class);
classStore.put(TLRPC.TL_messageActionLoginUnknownLocation.constructor, TLRPC.TL_messageActionLoginUnknownLocation.class); classStore.put(TLRPC.TL_messageActionLoginUnknownLocation.constructor, TLRPC.TL_messageActionLoginUnknownLocation.class);
classStore.put(TLRPC.TL_encryptedChat_old.constructor, TLRPC.TL_encryptedChat_old.class);
classStore.put(TLRPC.TL_encryptedChatRequested_old.constructor, TLRPC.TL_encryptedChatRequested_old.class);
} }
static TLClassStore store = null; static TLClassStore store = null;
......
...@@ -422,6 +422,39 @@ public class TLRPC { ...@@ -422,6 +422,39 @@ public class TLRPC {
} }
} }
public static class Peer extends TLObject {
public int user_id;
public int chat_id;
}
public static class TL_peerUser extends Peer {
public static int constructor = 0x9db1bc6d;
public void readParams(SerializedData stream) {
user_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
}
}
public static class TL_peerChat extends Peer {
public static int constructor = 0xbad0e5bb;
public void readParams(SerializedData stream) {
chat_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(chat_id);
}
}
public static class EncryptedFile extends TLObject { public static class EncryptedFile extends TLObject {
public long id; public long id;
public long access_hash; public long access_hash;
...@@ -461,39 +494,6 @@ public class TLRPC { ...@@ -461,39 +494,6 @@ public class TLRPC {
} }
} }
public static class Peer extends TLObject {
public int user_id;
public int chat_id;
}
public static class TL_peerUser extends Peer {
public static int constructor = 0x9db1bc6d;
public void readParams(SerializedData stream) {
user_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
}
}
public static class TL_peerChat extends Peer {
public static int constructor = 0xbad0e5bb;
public void readParams(SerializedData stream) {
chat_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(chat_id);
}
}
public static class DestroySessionRes extends TLObject { public static class DestroySessionRes extends TLObject {
public long session_id; public long session_id;
} }
...@@ -527,21 +527,35 @@ public class TLRPC { ...@@ -527,21 +527,35 @@ public class TLRPC {
} }
public static class updates_Difference extends TLObject { public static class updates_Difference extends TLObject {
public int date;
public int seq;
public ArrayList<Message> new_messages = new ArrayList<Message>(); public ArrayList<Message> new_messages = new ArrayList<Message>();
public ArrayList<EncryptedMessage> new_encrypted_messages = new ArrayList<EncryptedMessage>(); public ArrayList<EncryptedMessage> new_encrypted_messages = new ArrayList<EncryptedMessage>();
public ArrayList<Update> other_updates = new ArrayList<Update>(); public ArrayList<Update> other_updates = new ArrayList<Update>();
public ArrayList<Chat> chats = new ArrayList<Chat>(); public ArrayList<Chat> chats = new ArrayList<Chat>();
public ArrayList<User> users = new ArrayList<User>(); public ArrayList<User> users = new ArrayList<User>();
public TL_updates_state state;
public int pts;
public int date;
public int qts;
public TL_updates_state intermediate_state; public TL_updates_state intermediate_state;
public int seq; public TL_updates_state state;
} }
public static class TL_updates_difference extends updates_Difference { public static class TL_updates_differenceEmpty extends updates_Difference {
public static int constructor = 0xf49ca0; public static int constructor = 0x5d75a138;
public void readParams(SerializedData stream) {
date = stream.readInt32();
seq = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(date);
stream.writeInt32(seq);
}
}
public static class TL_updates_differenceSlice extends updates_Difference {
public static int constructor = 0xa8fb1981;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
...@@ -570,7 +584,7 @@ public class TLRPC { ...@@ -570,7 +584,7 @@ public class TLRPC {
for (int a = 0; a < count; a++) { for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32())); users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
} }
state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); intermediate_state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
...@@ -605,12 +619,12 @@ public class TLRPC { ...@@ -605,12 +619,12 @@ public class TLRPC {
for (int a = 0; a < count; a++) { for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream); users.get(a).serializeToStream(stream);
} }
state.serializeToStream(stream); intermediate_state.serializeToStream(stream);
} }
} }
public static class TL_updates_differenceSlice extends updates_Difference { public static class TL_updates_difference extends updates_Difference {
public static int constructor = 0xa8fb1981; public static int constructor = 0xf49ca0;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
...@@ -639,7 +653,7 @@ public class TLRPC { ...@@ -639,7 +653,7 @@ public class TLRPC {
for (int a = 0; a < count; a++) { for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32())); users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
} }
intermediate_state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); state = (TL_updates_state)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
...@@ -674,23 +688,7 @@ public class TLRPC { ...@@ -674,23 +688,7 @@ public class TLRPC {
for (int a = 0; a < count; a++) { for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream); users.get(a).serializeToStream(stream);
} }
intermediate_state.serializeToStream(stream); state.serializeToStream(stream);
}
}
public static class TL_updates_differenceEmpty extends updates_Difference {
public static int constructor = 0x5d75a138;
public void readParams(SerializedData stream) {
date = stream.readInt32();
seq = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(date);
stream.writeInt32(seq);
} }
} }
...@@ -724,6 +722,42 @@ public class TLRPC { ...@@ -724,6 +722,42 @@ public class TLRPC {
} }
} }
public static class help_AppUpdate extends TLObject {
public int id;
public boolean critical;
public String url;
public String text;
}
public static class TL_help_appUpdate extends help_AppUpdate {
public static int constructor = 0x8987f311;
public void readParams(SerializedData stream) {
id = stream.readInt32();
critical = stream.readBool();
url = stream.readString();
text = stream.readString();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeBool(critical);
stream.writeString(url);
stream.writeString(text);
}
}
public static class TL_help_noAppUpdate extends help_AppUpdate {
public static int constructor = 0xc45a6536;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_messageEmpty extends Message { public static class TL_messageEmpty extends Message {
public static int constructor = 0x83e5de54; public static int constructor = 0x83e5de54;
...@@ -808,13 +842,15 @@ public class TLRPC { ...@@ -808,13 +842,15 @@ public class TLRPC {
public static class MessageMedia extends TLObject { public static class MessageMedia extends TLObject {
public Video video; public Video video;
public GeoPoint geo;
public Photo photo; public Photo photo;
public Document document;
public GeoPoint geo;
public Audio audio;
public String phone_number; public String phone_number;
public String first_name; public String first_name;
public String last_name; public String last_name;
public byte[] bytes;
public int user_id; public int user_id;
public byte[] bytes;
} }
public static class TL_messageMediaVideo extends MessageMedia { public static class TL_messageMediaVideo extends MessageMedia {
...@@ -831,31 +867,45 @@ public class TLRPC { ...@@ -831,31 +867,45 @@ public class TLRPC {
} }
} }
public static class TL_messageMediaGeo extends MessageMedia { public static class TL_messageMediaPhoto extends MessageMedia {
public static int constructor = 0x56e0d474; public static int constructor = 0xc8c45a2a;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
geo = (GeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
geo.serializeToStream(stream); photo.serializeToStream(stream);
} }
} }
public static class TL_messageMediaPhoto extends MessageMedia { public static class TL_messageMediaDocument extends MessageMedia {
public static int constructor = 0xc8c45a2a; public static int constructor = 0x2fda2204;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); document = (Document)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
photo.serializeToStream(stream); document.serializeToStream(stream);
}
}
public static class TL_messageMediaGeo extends MessageMedia {
public static int constructor = 0x56e0d474;
public void readParams(SerializedData stream) {
geo = (GeoPoint)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
geo.serializeToStream(stream);
} }
} }
...@@ -868,6 +918,20 @@ public class TLRPC { ...@@ -868,6 +918,20 @@ public class TLRPC {
} }
} }
public static class TL_messageMediaAudio extends MessageMedia {
public static int constructor = 0xc6b68300;
public void readParams(SerializedData stream) {
audio = (Audio)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
audio.serializeToStream(stream);
}
}
public static class TL_messageMediaContact extends MessageMedia { public static class TL_messageMediaContact extends MessageMedia {
public static int constructor = 0x5e7d2f39; public static int constructor = 0x5e7d2f39;
...@@ -891,6 +955,7 @@ public class TLRPC { ...@@ -891,6 +955,7 @@ public class TLRPC {
public static class TL_messageMediaUnsupported extends MessageMedia { public static class TL_messageMediaUnsupported extends MessageMedia {
public static int constructor = 0x29632a36; public static int constructor = 0x29632a36;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
bytes = stream.readByteArray(); bytes = stream.readByteArray();
} }
...@@ -1162,6 +1227,56 @@ public class TLRPC { ...@@ -1162,6 +1227,56 @@ public class TLRPC {
} }
} }
public static class Audio extends TLObject {
public long id;
public long access_hash;
public int user_id;
public int date;
public int duration;
public int size;
public int dc_id;
}
public static class TL_audioEmpty extends Audio {
public static int constructor = 0x586988d8;
public void readParams(SerializedData stream) {
id = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
}
}
public static class TL_audio extends Audio {
public static int constructor = 0x427425e7;
public void readParams(SerializedData stream) {
id = stream.readInt64();
access_hash = stream.readInt64();
user_id = stream.readInt32();
date = stream.readInt32();
duration = stream.readInt32();
size = stream.readInt32();
dc_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
stream.writeInt32(user_id);
stream.writeInt32(date);
stream.writeInt32(duration);
stream.writeInt32(size);
stream.writeInt32(dc_id);
}
}
public static class TL_destroy_sessions_res extends TLObject { public static class TL_destroy_sessions_res extends TLObject {
public static int constructor = 0xfb95abcd; public static int constructor = 0xfb95abcd;
...@@ -1724,8 +1839,8 @@ public class TLRPC { ...@@ -1724,8 +1839,8 @@ public class TLRPC {
public long secret; public long secret;
} }
public static class TL_inputEncryptedFileLocation extends InputFileLocation { public static class TL_inputAudioFileLocation extends InputFileLocation {
public static int constructor = 0xf5235d55; public static int constructor = 0x74dc404d;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
...@@ -1740,21 +1855,19 @@ public class TLRPC { ...@@ -1740,21 +1855,19 @@ public class TLRPC {
} }
} }
public static class TL_inputFileLocation extends InputFileLocation { public static class TL_inputEncryptedFileLocation extends InputFileLocation {
public static int constructor = 0x14637196; public static int constructor = 0xf5235d55;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
volume_id = stream.readInt64(); id = stream.readInt64();
local_id = stream.readInt32(); access_hash = stream.readInt64();
secret = stream.readInt64();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt64(volume_id); stream.writeInt64(id);
stream.writeInt32(local_id); stream.writeInt64(access_hash);
stream.writeInt64(secret);
} }
} }
...@@ -1774,16 +1887,50 @@ public class TLRPC { ...@@ -1774,16 +1887,50 @@ public class TLRPC {
} }
} }
public static class TL_photos_photo extends TLObject { public static class TL_inputDocumentFileLocation extends InputFileLocation {
public static int constructor = 0x20212ca8; public static int constructor = 0x4e45abe9;
public Photo photo;
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); id = stream.readInt64();
stream.readInt32(); access_hash = stream.readInt64();
int count = stream.readInt32(); }
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
}
}
public static class TL_inputFileLocation extends InputFileLocation {
public static int constructor = 0x14637196;
public void readParams(SerializedData stream) {
volume_id = stream.readInt64();
local_id = stream.readInt32();
secret = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(volume_id);
stream.writeInt32(local_id);
stream.writeInt64(secret);
}
}
public static class TL_photos_photo extends TLObject {
public static int constructor = 0x20212ca8;
public Photo photo;
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) {
photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
stream.readInt32();
int count = stream.readInt32();
for (int a = 0; a < count; a++) { for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32())); users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
} }
...@@ -2025,6 +2172,7 @@ public class TLRPC { ...@@ -2025,6 +2172,7 @@ public class TLRPC {
public static class TL_messageActionChatEditPhoto extends MessageAction { public static class TL_messageActionChatEditPhoto extends MessageAction {
public static int constructor = 0x7fcb13a8; public static int constructor = 0x7fcb13a8;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); photo = (Photo)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
...@@ -2243,7 +2391,19 @@ public class TLRPC { ...@@ -2243,7 +2391,19 @@ public class TLRPC {
} }
} }
public static class TL_peerNotifyEventsAll extends TLObject { public static class PeerNotifyEvents extends TLObject {
}
public static class TL_peerNotifyEventsEmpty extends PeerNotifyEvents {
public static int constructor = 0xadd53cb3;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_peerNotifyEventsAll extends PeerNotifyEvents {
public static int constructor = 0x6d1ded88; public static int constructor = 0x6d1ded88;
...@@ -2296,21 +2456,6 @@ public class TLRPC { ...@@ -2296,21 +2456,6 @@ public class TLRPC {
} }
} }
public static class TL_decryptedMessageActionSetMessageTTL extends TLObject {
public static int constructor = 0xa1733aec;
public int ttl_seconds;
public void readParams(SerializedData stream) {
ttl_seconds = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(ttl_seconds);
}
}
public static class TL_decryptedMessage extends DecryptedMessage { public static class TL_decryptedMessage extends DecryptedMessage {
public static int constructor = 0x1f814f1f; public static int constructor = 0x1f814f1f;
...@@ -2331,7 +2476,10 @@ public class TLRPC { ...@@ -2331,7 +2476,10 @@ public class TLRPC {
} }
} }
public static class TL_inputPeerNotifyEventsAll extends TLObject { public static class InputPeerNotifyEvents extends TLObject {
}
public static class TL_inputPeerNotifyEventsAll extends InputPeerNotifyEvents {
public static int constructor = 0xe86a2c74; public static int constructor = 0xe86a2c74;
...@@ -2340,6 +2488,15 @@ public class TLRPC { ...@@ -2340,6 +2488,15 @@ public class TLRPC {
} }
} }
public static class TL_inputPeerNotifyEventsEmpty extends InputPeerNotifyEvents {
public static int constructor = 0xf03064d8;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_client_DH_inner_data extends TLObject { public static class TL_client_DH_inner_data extends TLObject {
public static int constructor = 0x6643b654; public static int constructor = 0x6643b654;
...@@ -2430,6 +2587,36 @@ public class TLRPC { ...@@ -2430,6 +2587,36 @@ public class TLRPC {
} }
} }
public static class InputDocument extends TLObject {
public long id;
public long access_hash;
}
public static class TL_inputDocumentEmpty extends InputDocument {
public static int constructor = 0x72f0eaae;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_inputDocument extends InputDocument {
public static int constructor = 0x18798952;
public void readParams(SerializedData stream) {
id = stream.readInt64();
access_hash = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
}
}
public static class TL_inputAppEvent extends TLObject { public static class TL_inputAppEvent extends TLObject {
public static int constructor = 0x770656a8; public static int constructor = 0x770656a8;
...@@ -2475,29 +2662,129 @@ public class TLRPC { ...@@ -2475,29 +2662,129 @@ public class TLRPC {
} }
} }
public static class TL_documentEmpty extends Document {
public static int constructor = 0x36f8c871;
public void readParams(SerializedData stream) {
id = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
}
}
public static class TL_document extends Document {
public static int constructor = 0x9efc6326;
public void readParams(SerializedData stream) {
id = stream.readInt64();
access_hash = stream.readInt64();
user_id = stream.readInt32();
date = stream.readInt32();
file_name = stream.readString();
mime_type = stream.readString();
size = stream.readInt32();
thumb = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
dc_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
stream.writeInt32(user_id);
stream.writeInt32(date);
stream.writeString(file_name);
stream.writeString(mime_type);
stream.writeInt32(size);
thumb.serializeToStream(stream);
stream.writeInt32(dc_id);
}
}
public static class InputMedia extends TLObject { public static class InputMedia extends TLObject {
public InputFile file;
public InputGeoPoint geo_point;
public String phone_number; public String phone_number;
public String first_name; public String first_name;
public String last_name; public String last_name;
public InputFile file;
public InputFile thumb; public InputFile thumb;
public String file_name;
public String mime_type;
public InputGeoPoint geo_point;
public int duration; public int duration;
public int w; public int w;
public int h; public int h;
} }
public static class TL_inputMediaUploadedPhoto extends InputMedia { public static class TL_inputMediaContact extends InputMedia {
public static int constructor = 0x2dc53a7d; public static int constructor = 0xa6e45987;
public void readParams(SerializedData stream) {
phone_number = stream.readString();
first_name = stream.readString();
last_name = stream.readString();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(phone_number);
stream.writeString(first_name);
stream.writeString(last_name);
}
}
public static class TL_inputMediaUploadedThumbDocument extends InputMedia {
public static int constructor = 0x3e46de5d;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
thumb = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
file_name = stream.readString();
mime_type = stream.readString();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
file.serializeToStream(stream); file.serializeToStream(stream);
thumb.serializeToStream(stream);
stream.writeString(file_name);
stream.writeString(mime_type);
}
}
public static class TL_inputMediaAudio extends InputMedia {
public static int constructor = 0x89938781;
public InputAudio id;
public void readParams(SerializedData stream) {
id = (InputAudio)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
id.serializeToStream(stream);
}
}
public static class TL_inputMediaDocument extends InputMedia {
public static int constructor = 0xd184e841;
public InputDocument id;
public void readParams(SerializedData stream) {
id = (InputDocument)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
id.serializeToStream(stream);
} }
} }
...@@ -2530,21 +2817,12 @@ public class TLRPC { ...@@ -2530,21 +2817,12 @@ public class TLRPC {
} }
} }
public static class TL_inputMediaContact extends InputMedia { public static class TL_inputMediaEmpty extends InputMedia {
public static int constructor = 0xa6e45987; public static int constructor = 0x9664f57f;
public void readParams(SerializedData stream) {
phone_number = stream.readString();
first_name = stream.readString();
last_name = stream.readString();
}
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeString(phone_number);
stream.writeString(first_name);
stream.writeString(last_name);
} }
} }
...@@ -2570,6 +2848,36 @@ public class TLRPC { ...@@ -2570,6 +2848,36 @@ public class TLRPC {
} }
} }
public static class TL_inputMediaUploadedPhoto extends InputMedia {
public static int constructor = 0x2dc53a7d;
public void readParams(SerializedData stream) {
file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
file.serializeToStream(stream);
}
}
public static class TL_inputMediaUploadedAudio extends InputMedia {
public static int constructor = 0x61a6d436;
public void readParams(SerializedData stream) {
file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
duration = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
file.serializeToStream(stream);
stream.writeInt32(duration);
}
}
public static class TL_inputMediaUploadedVideo extends InputMedia { public static class TL_inputMediaUploadedVideo extends InputMedia {
public static int constructor = 0x4847d92a; public static int constructor = 0x4847d92a;
...@@ -2590,27 +2898,36 @@ public class TLRPC { ...@@ -2590,27 +2898,36 @@ public class TLRPC {
} }
} }
public static class TL_inputMediaPhoto extends InputMedia { public static class TL_inputMediaUploadedDocument extends InputMedia {
public static int constructor = 0x8f2ab2ec; public static int constructor = 0x34e794bd;
public InputPhoto id;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
id = (InputPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()); file = (InputFile)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
file_name = stream.readString();
mime_type = stream.readString();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
id.serializeToStream(stream); file.serializeToStream(stream);
stream.writeString(file_name);
stream.writeString(mime_type);
} }
} }
public static class TL_inputMediaEmpty extends InputMedia { public static class TL_inputMediaPhoto extends InputMedia {
public static int constructor = 0x9664f57f; public static int constructor = 0x8f2ab2ec;
public InputPhoto id;
public void readParams(SerializedData stream) {
id = (InputPhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
id.serializeToStream(stream);
} }
} }
...@@ -2822,6 +3139,24 @@ public class TLRPC { ...@@ -2822,6 +3139,24 @@ public class TLRPC {
} }
} }
public static class TL_contactSuggested extends TLObject {
public static int constructor = 0x3de191a1;
public int user_id;
public int mutual_contacts;
public void readParams(SerializedData stream) {
user_id = stream.readInt32();
mutual_contacts = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
stream.writeInt32(mutual_contacts);
}
}
public static class Server_DH_Params extends TLObject { public static class Server_DH_Params extends TLObject {
public byte[] nonce; public byte[] nonce;
public byte[] server_nonce; public byte[] server_nonce;
...@@ -2982,24 +3317,27 @@ public class TLRPC { ...@@ -2982,24 +3317,27 @@ public class TLRPC {
public static class Update extends TLObject { public static class Update extends TLObject {
public int chat_id; public int chat_id;
public int max_date; public int max_date;
public int date;
public int user_id; public int user_id;
public contacts_MyLink my_link; public contacts_MyLink my_link;
public contacts_ForeignLink foreign_link; public contacts_ForeignLink foreign_link;
public ArrayList<Integer> messages = new ArrayList<Integer>(); public ArrayList<Integer> messages = new ArrayList<Integer>();
public int pts; public int pts;
public int version;
public String first_name; public String first_name;
public String last_name; public String last_name;
public int qts; public int qts;
public int id; public int id;
public long random_id; public long random_id;
public ArrayList<TL_dcOption> dc_options = new ArrayList<TL_dcOption>();
public ChatParticipants participants; public ChatParticipants participants;
public EncryptedChat chat; public EncryptedChat chat;
public int date;
public long auth_key_id; public long auth_key_id;
public String device; public String device;
public String location; public String location;
public UserProfilePhoto photo; public UserProfilePhoto photo;
public boolean previous; public boolean previous;
public int inviter_id;
public UserStatus status; public UserStatus status;
} }
...@@ -3064,6 +3402,24 @@ public class TLRPC { ...@@ -3064,6 +3402,24 @@ public class TLRPC {
} }
} }
public static class TL_updateChatParticipantDelete extends Update {
public static int constructor = 0x6e5f8c22;
public void readParams(SerializedData stream) {
chat_id = stream.readInt32();
user_id = stream.readInt32();
version = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(chat_id);
stream.writeInt32(user_id);
stream.writeInt32(version);
}
}
public static class TL_updateRestoreMessages extends Update { public static class TL_updateRestoreMessages extends Update {
public static int constructor = 0xd15de04d; public static int constructor = 0xd15de04d;
...@@ -3226,6 +3582,29 @@ public class TLRPC { ...@@ -3226,6 +3582,29 @@ public class TLRPC {
} }
} }
public static class TL_updateDcOptions extends Update {
public static int constructor = 0x8e5e9873;
public void readParams(SerializedData stream) {
stream.readInt32();
int count = stream.readInt32();
for (int a = 0; a < count; a++) {
dc_options.add((TL_dcOption)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
int count = dc_options.size();
stream.writeInt32(count);
for (TL_dcOption dc_option : dc_options) {
dc_option.serializeToStream(stream);
}
}
}
public static class TL_updateChatParticipants extends Update { public static class TL_updateChatParticipants extends Update {
public static int constructor = 0x7761198; public static int constructor = 0x7761198;
...@@ -3341,6 +3720,26 @@ public class TLRPC { ...@@ -3341,6 +3720,26 @@ public class TLRPC {
} }
} }
public static class TL_updateChatParticipantAdd extends Update {
public static int constructor = 0x3a0eeb22;
public void readParams(SerializedData stream) {
chat_id = stream.readInt32();
user_id = stream.readInt32();
inviter_id = stream.readInt32();
version = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(chat_id);
stream.writeInt32(user_id);
stream.writeInt32(inviter_id);
stream.writeInt32(version);
}
}
public static class TL_updateUserStatus extends Update { public static class TL_updateUserStatus extends Update {
public static int constructor = 0x1bfbd823; public static int constructor = 0x1bfbd823;
...@@ -3357,6 +3756,42 @@ public class TLRPC { ...@@ -3357,6 +3756,42 @@ public class TLRPC {
} }
} }
public static class TL_contacts_suggested extends TLObject {
public static int constructor = 0x5649dcc5;
public ArrayList<TL_contactSuggested> results = new ArrayList<TL_contactSuggested>();
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) {
stream.readInt32();
int count = stream.readInt32();
for (int a = 0; a < count; a++) {
results.add((TL_contactSuggested)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
int count = results.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
results.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = users.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream);
}
}
}
public static class RpcError extends TLObject { public static class RpcError extends TLObject {
public int error_code; public int error_code;
public String error_message; public String error_message;
...@@ -3401,8 +3836,8 @@ public class TLRPC { ...@@ -3401,8 +3836,8 @@ public class TLRPC {
public long id; public long id;
public long access_hash; public long access_hash;
public int parts; public int parts;
public String md5_checksum;
public int key_fingerprint; public int key_fingerprint;
public String md5_checksum;
} }
public static class TL_inputEncryptedFile extends InputEncryptedFile { public static class TL_inputEncryptedFile extends InputEncryptedFile {
...@@ -3468,31 +3903,18 @@ public class TLRPC { ...@@ -3468,31 +3903,18 @@ public class TLRPC {
} }
} }
public static class TL_upload_saveBigFilePart extends TLObject { public static class TL_decryptedMessageActionSetMessageTTL extends TLObject {
public static int constructor = 0xde7b673d; public static int constructor = 0xa1733aec;
public long file_id;
public int file_part;
public int file_total_parts;
public byte[] bytes;
public Class responseClass () { public int ttl_seconds;
return Bool.class;
}
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
file_id = stream.readInt64(); ttl_seconds = stream.readInt32();
file_part = stream.readInt32();
file_total_parts = stream.readInt32();
bytes = stream.readByteArray();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt64(file_id); stream.writeInt32(ttl_seconds);
stream.writeInt32(file_part);
stream.writeInt32(file_total_parts);
stream.writeByteArray(bytes);
} }
} }
...@@ -3726,7 +4148,7 @@ public class TLRPC { ...@@ -3726,7 +4148,7 @@ public class TLRPC {
} }
public static class TL_encryptedChat extends EncryptedChat { public static class TL_encryptedChat extends EncryptedChat {
public static int constructor = 0x6601d14f; public static int constructor = 0xfa56ce36;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
...@@ -3736,7 +4158,6 @@ public class TLRPC { ...@@ -3736,7 +4158,6 @@ public class TLRPC {
admin_id = stream.readInt32(); admin_id = stream.readInt32();
participant_id = stream.readInt32(); participant_id = stream.readInt32();
g_a_or_b = stream.readByteArray(); g_a_or_b = stream.readByteArray();
nonce = stream.readByteArray();
key_fingerprint = stream.readInt64(); key_fingerprint = stream.readInt64();
} }
...@@ -3748,13 +4169,12 @@ public class TLRPC { ...@@ -3748,13 +4169,12 @@ public class TLRPC {
stream.writeInt32(admin_id); stream.writeInt32(admin_id);
stream.writeInt32(participant_id); stream.writeInt32(participant_id);
stream.writeByteArray(g_a_or_b); stream.writeByteArray(g_a_or_b);
stream.writeByteArray(nonce);
stream.writeInt64(key_fingerprint); stream.writeInt64(key_fingerprint);
} }
} }
public static class TL_encryptedChatRequested extends EncryptedChat { public static class TL_encryptedChatRequested extends EncryptedChat {
public static int constructor = 0xfda9a7b7; public static int constructor = 0xc878527e;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
...@@ -3764,7 +4184,6 @@ public class TLRPC { ...@@ -3764,7 +4184,6 @@ public class TLRPC {
admin_id = stream.readInt32(); admin_id = stream.readInt32();
participant_id = stream.readInt32(); participant_id = stream.readInt32();
g_a = stream.readByteArray(); g_a = stream.readByteArray();
nonce = stream.readByteArray();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
...@@ -3775,7 +4194,6 @@ public class TLRPC { ...@@ -3775,7 +4194,6 @@ public class TLRPC {
stream.writeInt32(admin_id); stream.writeInt32(admin_id);
stream.writeInt32(participant_id); stream.writeInt32(participant_id);
stream.writeByteArray(g_a); stream.writeByteArray(g_a);
stream.writeByteArray(nonce);
} }
} }
...@@ -3875,6 +4293,36 @@ public class TLRPC { ...@@ -3875,6 +4293,36 @@ public class TLRPC {
} }
} }
public static class InputAudio extends TLObject {
public long id;
public long access_hash;
}
public static class TL_inputAudio extends InputAudio {
public static int constructor = 0x77d440ff;
public void readParams(SerializedData stream) {
id = stream.readInt64();
access_hash = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
}
}
public static class TL_inputAudioEmpty extends InputAudio {
public static int constructor = 0xd95adc84;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_messages_chats extends TLObject { public static class TL_messages_chats extends TLObject {
public static int constructor = 0x8150cbd8; public static int constructor = 0x8150cbd8;
...@@ -3911,6 +4359,42 @@ public class TLRPC { ...@@ -3911,6 +4359,42 @@ public class TLRPC {
} }
} }
public static class TL_contacts_found extends TLObject {
public static int constructor = 0x566000e;
public ArrayList<TL_contactFound> results = new ArrayList<TL_contactFound>();
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) {
stream.readInt32();
int count = stream.readInt32();
for (int a = 0; a < count; a++) {
results.add((TL_contactFound)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
int count = results.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
results.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = users.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream);
}
}
}
public static class ChatParticipants extends TLObject { public static class ChatParticipants extends TLObject {
public int chat_id; public int chat_id;
public int admin_id; public int admin_id;
...@@ -3962,55 +4446,35 @@ public class TLRPC { ...@@ -3962,55 +4446,35 @@ public class TLRPC {
} }
public static class DecryptedMessageMedia extends TLObject { public static class DecryptedMessageMedia extends TLObject {
public String phone_number;
public String first_name;
public String last_name;
public int user_id;
public byte[] thumb; public byte[] thumb;
public int thumb_w; public int thumb_w;
public int thumb_h; public int thumb_h;
public int duration; public String file_name;
public int w; public String mime_type;
public int h;
public int size; public int size;
public byte[] key; public byte[] key;
public byte[] iv; public byte[] iv;
public double lat; public double lat;
public double _long; public double _long;
public String filename; public int duration;
} public int w;
public int h;
public static class TL_decryptedMessageMediaContact extends DecryptedMessageMedia { public String phone_number;
public static int constructor = 0x588a0a97; public String first_name;
public String last_name;
public int user_id;
public void readParams(SerializedData stream) {
phone_number = stream.readString();
first_name = stream.readString();
last_name = stream.readString();
user_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(phone_number);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeInt32(user_id);
}
} }
public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia { public static class TL_decryptedMessageMediaDocument extends DecryptedMessageMedia {
public static int constructor = 0x4cee6ef3; public static int constructor = 0xb095434b;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
thumb = stream.readByteArray(); thumb = stream.readByteArray();
thumb_w = stream.readInt32(); thumb_w = stream.readInt32();
thumb_h = stream.readInt32(); thumb_h = stream.readInt32();
duration = stream.readInt32(); file_name = stream.readString();
w = stream.readInt32(); mime_type = stream.readString();
h = stream.readInt32();
size = stream.readInt32(); size = stream.readInt32();
key = stream.readByteArray(); key = stream.readByteArray();
iv = stream.readByteArray(); iv = stream.readByteArray();
...@@ -4021,9 +4485,8 @@ public class TLRPC { ...@@ -4021,9 +4485,8 @@ public class TLRPC {
stream.writeByteArray(thumb); stream.writeByteArray(thumb);
stream.writeInt32(thumb_w); stream.writeInt32(thumb_w);
stream.writeInt32(thumb_h); stream.writeInt32(thumb_h);
stream.writeInt32(duration); stream.writeString(file_name);
stream.writeInt32(w); stream.writeString(mime_type);
stream.writeInt32(h);
stream.writeInt32(size); stream.writeInt32(size);
stream.writeByteArray(key); stream.writeByteArray(key);
stream.writeByteArray(iv); stream.writeByteArray(iv);
...@@ -4046,47 +4509,35 @@ public class TLRPC { ...@@ -4046,47 +4509,35 @@ public class TLRPC {
} }
} }
public static class TL_decryptedMessageMediaFile extends DecryptedMessageMedia { public static class TL_decryptedMessageMediaAudio extends DecryptedMessageMedia {
public static int constructor = 0xc0bb4455; public static int constructor = 0x6080758f;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
filename = stream.readString(); duration = stream.readInt32();
thumb = stream.readByteArray(); size = stream.readInt32();
thumb_w = stream.readInt32();
thumb_h = stream.readInt32();
key = stream.readByteArray(); key = stream.readByteArray();
iv = stream.readByteArray(); iv = stream.readByteArray();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeString(filename); stream.writeInt32(duration);
stream.writeByteArray(thumb); stream.writeInt32(size);
stream.writeInt32(thumb_w);
stream.writeInt32(thumb_h);
stream.writeByteArray(key); stream.writeByteArray(key);
stream.writeByteArray(iv); stream.writeByteArray(iv);
} }
} }
public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia { public static class TL_decryptedMessageMediaVideo extends DecryptedMessageMedia {
public static int constructor = 0x89f5c4a; public static int constructor = 0x4cee6ef3;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia {
public static int constructor = 0x32798a8c;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
thumb = stream.readByteArray(); thumb = stream.readByteArray();
thumb_w = stream.readInt32(); thumb_w = stream.readInt32();
thumb_h = stream.readInt32(); thumb_h = stream.readInt32();
duration = stream.readInt32();
w = stream.readInt32(); w = stream.readInt32();
h = stream.readInt32(); h = stream.readInt32();
size = stream.readInt32(); size = stream.readInt32();
...@@ -4099,6 +4550,7 @@ public class TLRPC { ...@@ -4099,6 +4550,7 @@ public class TLRPC {
stream.writeByteArray(thumb); stream.writeByteArray(thumb);
stream.writeInt32(thumb_w); stream.writeInt32(thumb_w);
stream.writeInt32(thumb_h); stream.writeInt32(thumb_h);
stream.writeInt32(duration);
stream.writeInt32(w); stream.writeInt32(w);
stream.writeInt32(h); stream.writeInt32(h);
stream.writeInt32(size); stream.writeInt32(size);
...@@ -4107,23 +4559,80 @@ public class TLRPC { ...@@ -4107,23 +4559,80 @@ public class TLRPC {
} }
} }
public static class TL_chatParticipant extends TLObject { public static class TL_decryptedMessageMediaContact extends DecryptedMessageMedia {
public static int constructor = 0xc8d7493e; public static int constructor = 0x588a0a97;
public int user_id;
public int inviter_id;
public int date;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
phone_number = stream.readString();
first_name = stream.readString();
last_name = stream.readString();
user_id = stream.readInt32(); user_id = stream.readInt32();
inviter_id = stream.readInt32();
date = stream.readInt32();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeString(phone_number);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeInt32(user_id); stream.writeInt32(user_id);
stream.writeInt32(inviter_id); }
}
public static class TL_decryptedMessageMediaEmpty extends DecryptedMessageMedia {
public static int constructor = 0x89f5c4a;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_decryptedMessageMediaPhoto extends DecryptedMessageMedia {
public static int constructor = 0x32798a8c;
public void readParams(SerializedData stream) {
thumb = stream.readByteArray();
thumb_w = stream.readInt32();
thumb_h = stream.readInt32();
w = stream.readInt32();
h = stream.readInt32();
size = stream.readInt32();
key = stream.readByteArray();
iv = stream.readByteArray();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeByteArray(thumb);
stream.writeInt32(thumb_w);
stream.writeInt32(thumb_h);
stream.writeInt32(w);
stream.writeInt32(h);
stream.writeInt32(size);
stream.writeByteArray(key);
stream.writeByteArray(iv);
}
}
public static class TL_chatParticipant extends TLObject {
public static int constructor = 0xc8d7493e;
public int user_id;
public int inviter_id;
public int date;
public void readParams(SerializedData stream) {
user_id = stream.readInt32();
inviter_id = stream.readInt32();
date = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
stream.writeInt32(inviter_id);
stream.writeInt32(date); stream.writeInt32(date);
} }
} }
...@@ -4194,7 +4703,6 @@ public class TLRPC { ...@@ -4194,7 +4703,6 @@ public class TLRPC {
stream.writeInt32(version); stream.writeInt32(version);
} }
} }
public static class TL_chat extends Chat { public static class TL_chat extends Chat {
public static int constructor = 0x6e9c9bc7; public static int constructor = 0x6e9c9bc7;
...@@ -4344,66 +4852,6 @@ public class TLRPC { ...@@ -4344,66 +4852,6 @@ public class TLRPC {
} }
} }
public static class TL_geochats_located extends TLObject {
public static int constructor = 0x48feb267;
public ArrayList<TL_chatLocated> results = new ArrayList<TL_chatLocated>();
public ArrayList<GeoChatMessage> messages = new ArrayList<GeoChatMessage>();
public ArrayList<Chat> chats = new ArrayList<Chat>();
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) {
stream.readInt32();
int count = stream.readInt32();
for (int a = 0; a < count; a++) {
results.add((TL_chatLocated)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
messages.add((GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(0x1cb5c415);
int count = results.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
results.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = messages.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
messages.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = chats.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
chats.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = users.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream);
}
}
}
public static class TL_msgs_state_info extends TLObject { public static class TL_msgs_state_info extends TLObject {
public static int constructor = 0x04deb57d; public static int constructor = 0x04deb57d;
...@@ -4443,6 +4891,44 @@ public class TLRPC { ...@@ -4443,6 +4891,44 @@ public class TLRPC {
} }
} }
public static class TL_fileLocation extends FileLocation {
public static int constructor = 0x53d69076;
public void readParams(SerializedData stream) {
dc_id = stream.readInt32();
volume_id = stream.readInt64();
local_id = stream.readInt32();
secret = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(dc_id);
stream.writeInt64(volume_id);
stream.writeInt32(local_id);
stream.writeInt64(secret);
}
}
public static class TL_fileLocationUnavailable extends FileLocation {
public static int constructor = 0x7c596b46;
public void readParams(SerializedData stream) {
volume_id = stream.readInt64();
local_id = stream.readInt32();
secret = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(volume_id);
stream.writeInt32(local_id);
stream.writeInt64(secret);
}
}
public static class messages_Message extends TLObject { public static class messages_Message extends TLObject {
public Message message; public Message message;
public ArrayList<Chat> chats = new ArrayList<Chat>(); public ArrayList<Chat> chats = new ArrayList<Chat>();
...@@ -4494,41 +4980,63 @@ public class TLRPC { ...@@ -4494,41 +4980,63 @@ public class TLRPC {
} }
} }
public static class TL_fileLocation extends FileLocation { public static class TL_geochats_located extends TLObject {
public static int constructor = 0x53d69076; public static int constructor = 0x48feb267;
public void readParams(SerializedData stream) {
dc_id = stream.readInt32();
volume_id = stream.readInt64();
local_id = stream.readInt32();
secret = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(dc_id);
stream.writeInt64(volume_id);
stream.writeInt32(local_id);
stream.writeInt64(secret);
}
}
public static class TL_fileLocationUnavailable extends FileLocation {
public static int constructor = 0x7c596b46;
public ArrayList<TL_chatLocated> results = new ArrayList<TL_chatLocated>();
public ArrayList<GeoChatMessage> messages = new ArrayList<GeoChatMessage>();
public ArrayList<Chat> chats = new ArrayList<Chat>();
public ArrayList<User> users = new ArrayList<User>();
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
volume_id = stream.readInt64(); stream.readInt32();
local_id = stream.readInt32(); int count = stream.readInt32();
secret = stream.readInt64(); for (int a = 0; a < count; a++) {
results.add((TL_chatLocated)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
messages.add((GeoChatMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
chats.add((Chat)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
stream.readInt32();
count = stream.readInt32();
for (int a = 0; a < count; a++) {
users.add((User)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32()));
}
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt64(volume_id); stream.writeInt32(0x1cb5c415);
stream.writeInt32(local_id); int count = results.size();
stream.writeInt64(secret); stream.writeInt32(count);
for (int a = 0; a < count; a++) {
results.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = messages.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
messages.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = chats.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
chats.get(a).serializeToStream(stream);
}
stream.writeInt32(0x1cb5c415);
count = users.size();
stream.writeInt32(count);
for (int a = 0; a < count; a++) {
users.get(a).serializeToStream(stream);
}
} }
} }
...@@ -4641,6 +5149,21 @@ public class TLRPC { ...@@ -4641,6 +5149,21 @@ public class TLRPC {
} }
} }
public static class TL_contactFound extends TLObject {
public static int constructor = 0xea879f95;
public int user_id;
public void readParams(SerializedData stream) {
user_id = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(user_id);
}
}
public static class InputFile extends TLObject { public static class InputFile extends TLObject {
public long id; public long id;
public int parts; public int parts;
...@@ -4648,14 +5171,14 @@ public class TLRPC { ...@@ -4648,14 +5171,14 @@ public class TLRPC {
public String md5_checksum; public String md5_checksum;
} }
public static class TL_inputFile extends InputFile { public static class TL_inputFileBig extends InputFile {
public static int constructor = 0xf52ff27f; public static int constructor = 0xfa4f0bb5;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
id = stream.readInt64(); id = stream.readInt64();
parts = stream.readInt32(); parts = stream.readInt32();
name = stream.readString(); name = stream.readString();
md5_checksum = stream.readString();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
...@@ -4663,18 +5186,18 @@ public class TLRPC { ...@@ -4663,18 +5186,18 @@ public class TLRPC {
stream.writeInt64(id); stream.writeInt64(id);
stream.writeInt32(parts); stream.writeInt32(parts);
stream.writeString(name); stream.writeString(name);
stream.writeString(md5_checksum);
} }
} }
public static class TL_inputFileBig extends InputFile { public static class TL_inputFile extends InputFile {
public static int constructor = 0xfa4f0bb5; public static int constructor = 0xf52ff27f;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
id = stream.readInt64(); id = stream.readInt64();
parts = stream.readInt32(); parts = stream.readInt32();
name = stream.readString(); name = stream.readString();
md5_checksum = stream.readString();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
...@@ -4682,6 +5205,7 @@ public class TLRPC { ...@@ -4682,6 +5205,7 @@ public class TLRPC {
stream.writeInt64(id); stream.writeInt64(id);
stream.writeInt32(parts); stream.writeInt32(parts);
stream.writeString(name); stream.writeString(name);
stream.writeString(md5_checksum);
} }
} }
...@@ -4818,48 +5342,30 @@ public class TLRPC { ...@@ -4818,48 +5342,30 @@ public class TLRPC {
} }
} }
public static class MsgDetailedInfo extends TLObject { public static class TL_updates_state extends TLObject {
public long answer_msg_id; public static int constructor = 0xa56c2a3e;
public int bytes;
public int status;
public long msg_id;
}
public static class TL_msg_new_detailed_info extends MsgDetailedInfo {
public static int constructor = 0x809db6df;
public void readParams(SerializedData stream) {
answer_msg_id = stream.readInt64();
bytes = stream.readInt32();
status = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(answer_msg_id);
stream.writeInt32(bytes);
stream.writeInt32(status);
}
}
public static class TL_msg_detailed_info extends MsgDetailedInfo {
public static int constructor = 0x276d3ec6;
public int pts;
public int qts;
public int date;
public int seq;
public int unread_count;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
msg_id = stream.readInt64(); pts = stream.readInt32();
answer_msg_id = stream.readInt64(); qts = stream.readInt32();
bytes = stream.readInt32(); date = stream.readInt32();
status = stream.readInt32(); seq = stream.readInt32();
unread_count = stream.readInt32();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt64(msg_id); stream.writeInt32(pts);
stream.writeInt64(answer_msg_id); stream.writeInt32(qts);
stream.writeInt32(bytes); stream.writeInt32(date);
stream.writeInt32(status); stream.writeInt32(seq);
stream.writeInt32(unread_count);
} }
} }
...@@ -5170,30 +5676,48 @@ public class TLRPC { ...@@ -5170,30 +5676,48 @@ public class TLRPC {
} }
} }
public static class TL_updates_state extends TLObject { public static class MsgDetailedInfo extends TLObject {
public static int constructor = 0xa56c2a3e; public long answer_msg_id;
public int bytes;
public int status;
public long msg_id;
}
public static class TL_msg_new_detailed_info extends MsgDetailedInfo {
public static int constructor = 0x809db6df;
public int pts;
public int qts;
public int date;
public int seq;
public int unread_count;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
pts = stream.readInt32(); answer_msg_id = stream.readInt64();
qts = stream.readInt32(); bytes = stream.readInt32();
date = stream.readInt32(); status = stream.readInt32();
seq = stream.readInt32();
unread_count = stream.readInt32();
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt32(pts); stream.writeInt64(answer_msg_id);
stream.writeInt32(qts); stream.writeInt32(bytes);
stream.writeInt32(date); stream.writeInt32(status);
stream.writeInt32(seq); }
stream.writeInt32(unread_count); }
public static class TL_msg_detailed_info extends MsgDetailedInfo {
public static int constructor = 0x276d3ec6;
public void readParams(SerializedData stream) {
msg_id = stream.readInt64();
answer_msg_id = stream.readInt64();
bytes = stream.readInt32();
status = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(msg_id);
stream.writeInt64(answer_msg_id);
stream.writeInt32(bytes);
stream.writeInt32(status);
} }
} }
...@@ -5438,18 +5962,36 @@ public class TLRPC { ...@@ -5438,18 +5962,36 @@ public class TLRPC {
public int port; public int port;
public void readParams(SerializedData stream) { public void readParams(SerializedData stream) {
id = stream.readInt32(); id = stream.readInt32();
hostname = stream.readString(); hostname = stream.readString();
ip_address = stream.readString(); ip_address = stream.readString();
port = stream.readInt32(); port = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(hostname);
stream.writeString(ip_address);
stream.writeInt32(port);
}
}
public static class TL_decryptedMessageLayer extends TLObject {
public static int constructor = 0x99a438cf;
public int layer;
public DecryptedMessage message;
public void readParams(SerializedData stream) {
layer = stream.readInt32();
message = (DecryptedMessage)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
} }
public void serializeToStream(SerializedData stream) { public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor); stream.writeInt32(constructor);
stream.writeInt32(id); stream.writeInt32(layer);
stream.writeString(hostname); message.serializeToStream(stream);
stream.writeString(ip_address);
stream.writeInt32(port);
} }
} }
...@@ -5827,6 +6369,19 @@ public class TLRPC { ...@@ -5827,6 +6369,19 @@ public class TLRPC {
} }
} }
public static class TL_auth_resetAuthorizations extends TLObject {
public static int constructor = 0x9fab0d1a;
public Class responseClass () {
return Bool.class;
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
}
}
public static class TL_auth_sendInvites extends TLObject { public static class TL_auth_sendInvites extends TLObject {
public static int constructor = 0x771c1d97; public static int constructor = 0x771c1d97;
...@@ -6155,6 +6710,47 @@ public class TLRPC { ...@@ -6155,6 +6710,47 @@ public class TLRPC {
} }
} }
public static class TL_contacts_search extends TLObject {
public static int constructor = 0x11f812d8;
public String q;
public int limit;
public Class responseClass () {
return TL_contacts_found.class;
}
public void readParams(SerializedData stream) {
q = stream.readString();
limit = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(q);
stream.writeInt32(limit);
}
}
public static class TL_contacts_getSuggested extends TLObject {
public static int constructor = 0xcd773428;
public int limit;
public Class responseClass () {
return TL_contacts_suggested.class;
}
public void readParams(SerializedData stream) {
limit = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(limit);
}
}
public static class TL_contacts_deleteContact extends TLObject { public static class TL_contacts_deleteContact extends TLObject {
public static int constructor = 0x8e953744; public static int constructor = 0x8e953744;
...@@ -6715,6 +7311,31 @@ public class TLRPC { ...@@ -6715,6 +7311,31 @@ public class TLRPC {
} }
} }
public static class TL_updates_getDifference extends TLObject {
public static int constructor = 0xa041495;
public int pts;
public int date;
public int qts;
public Class responseClass () {
return updates_Difference.class;
}
public void readParams(SerializedData stream) {
pts = stream.readInt32();
date = stream.readInt32();
qts = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(pts);
stream.writeInt32(date);
stream.writeInt32(qts);
}
}
public static class TL_photos_updateProfilePhoto extends TLObject { public static class TL_photos_updateProfilePhoto extends TLObject {
public static int constructor = 0xeef579a0; public static int constructor = 0xeef579a0;
...@@ -6841,6 +7462,34 @@ public class TLRPC { ...@@ -6841,6 +7462,34 @@ public class TLRPC {
} }
} }
public static class TL_help_getAppUpdate extends TLObject {
public static int constructor = 0xc812ac7e;
public String device_model;
public String system_version;
public String app_version;
public String lang_code;
public Class responseClass () {
return help_AppUpdate.class;
}
public void readParams(SerializedData stream) {
device_model = stream.readString();
system_version = stream.readString();
app_version = stream.readString();
lang_code = stream.readString();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(device_model);
stream.writeString(system_version);
stream.writeString(app_version);
stream.writeString(lang_code);
}
}
public static class TL_help_saveAppLog extends TLObject { public static class TL_help_saveAppLog extends TLObject {
public static int constructor = 0x6f02f748; public static int constructor = 0x6f02f748;
...@@ -7275,31 +7924,6 @@ public class TLRPC { ...@@ -7275,31 +7924,6 @@ public class TLRPC {
} }
} }
public static class TL_updates_getDifference extends TLObject {
public static int constructor = 0xa041495;
public int pts;
public int date;
public int qts;
public Class responseClass () {
return updates_Difference.class;
}
public void readParams(SerializedData stream) {
pts = stream.readInt32();
date = stream.readInt32();
qts = stream.readInt32();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(pts);
stream.writeInt32(date);
stream.writeInt32(qts);
}
}
public static class TL_messages_getDhConfig extends TLObject { public static class TL_messages_getDhConfig extends TLObject {
public static int constructor = 0x26cf8950; public static int constructor = 0x26cf8950;
...@@ -7513,6 +8137,34 @@ public class TLRPC { ...@@ -7513,6 +8137,34 @@ public class TLRPC {
} }
} }
public static class TL_upload_saveBigFilePart extends TLObject {
public static int constructor = 0xde7b673d;
public long file_id;
public int file_part;
public int file_total_parts;
public byte[] bytes;
public Class responseClass () {
return Bool.class;
}
public void readParams(SerializedData stream) {
file_id = stream.readInt64();
file_part = stream.readInt32();
file_total_parts = stream.readInt32();
bytes = stream.readByteArray();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(file_id);
stream.writeInt32(file_part);
stream.writeInt32(file_total_parts);
stream.writeByteArray(bytes);
}
}
//manually created //manually created
public static class TL_messages_receivedQueue extends TLObject { public static class TL_messages_receivedQueue extends TLObject {
...@@ -8051,7 +8703,6 @@ public class TLRPC { ...@@ -8051,7 +8703,6 @@ public class TLRPC {
public int admin_id; public int admin_id;
public int participant_id; public int participant_id;
public byte[] g_a_or_b; public byte[] g_a_or_b;
public byte[] nonce;
public long key_fingerprint; public long key_fingerprint;
public byte[] g_a; public byte[] g_a;
public byte[] a_or_b; public byte[] a_or_b;
...@@ -8110,6 +8761,21 @@ public class TLRPC { ...@@ -8110,6 +8761,21 @@ public class TLRPC {
public byte[] iv; public byte[] iv;
} }
public static class Document extends TLObject {
public long id;
public long access_hash;
public int user_id;
public int date;
public String file_name;
public String mime_type;
public int size;
public PhotoSize thumb;
public int dc_id;
public String path;
public byte[] key;
public byte[] iv;
}
public static class MessageAction extends TLObject { public static class MessageAction extends TLObject {
public Photo photo; public Photo photo;
public UserProfilePhoto newUserPhoto; public UserProfilePhoto newUserPhoto;
...@@ -8133,6 +8799,40 @@ public class TLRPC { ...@@ -8133,6 +8799,40 @@ public class TLRPC {
} }
} }
public static class TL_documentEncrypted extends Document {
public static int constructor = 0x55555556;
public void readParams(SerializedData stream) {
id = stream.readInt64();
access_hash = stream.readInt64();
user_id = stream.readInt32();
date = stream.readInt32();
file_name = stream.readString();
mime_type = stream.readString();
size = stream.readInt32();
thumb = (PhotoSize)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
dc_id = stream.readInt32();
key = stream.readByteArray();
iv = stream.readByteArray();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt64(id);
stream.writeInt64(access_hash);
stream.writeInt32(user_id);
stream.writeInt32(date);
stream.writeString(file_name);
stream.writeString(mime_type);
stream.writeInt32(size);
thumb.serializeToStream(stream);
stream.writeInt32(dc_id);
stream.writeByteArray(key);
stream.writeByteArray(iv);
}
}
public static class TL_videoEncrypted extends Video { public static class TL_videoEncrypted extends Video {
public static int constructor = 0x55555553; public static int constructor = 0x55555553;
...@@ -8211,19 +8911,8 @@ public class TLRPC { ...@@ -8211,19 +8911,8 @@ public class TLRPC {
} }
} }
public static class invokeWithLayer8 extends TLObject { public static class invokeWithLayer11 extends TLObject {
public static int constructor = 0xe9abd9fd; public static int constructor = 0xa6b88fdf;
public TLObject query;
public void serializeToStream(SerializedData stream) {
stream.writeInt32(constructor);
query.serializeToStream(stream);
}
}
public static class invokeWithLayer9 extends TLObject {
public static int constructor = 0x76715a63;
public TLObject query; public TLObject query;
...@@ -8271,4 +8960,56 @@ public class TLRPC { ...@@ -8271,4 +8960,56 @@ public class TLRPC {
message.serializeToStream(stream); message.serializeToStream(stream);
} }
} }
public static class TL_encryptedChat_old extends EncryptedChat {
public static int constructor = 0x6601d14f;
public void readParams(SerializedData stream) {
id = stream.readInt32();
access_hash = stream.readInt64();
date = stream.readInt32();
admin_id = stream.readInt32();
participant_id = stream.readInt32();
g_a_or_b = stream.readByteArray();
stream.readByteArray();
key_fingerprint = stream.readInt64();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(TL_encryptedChat.constructor);
stream.writeInt32(id);
stream.writeInt64(access_hash);
stream.writeInt32(date);
stream.writeInt32(admin_id);
stream.writeInt32(participant_id);
stream.writeByteArray(g_a_or_b);
stream.writeInt64(key_fingerprint);
}
}
public static class TL_encryptedChatRequested_old extends EncryptedChat {
public static int constructor = 0xfda9a7b7;
public void readParams(SerializedData stream) {
id = stream.readInt32();
access_hash = stream.readInt64();
date = stream.readInt32();
admin_id = stream.readInt32();
participant_id = stream.readInt32();
g_a = stream.readByteArray();
stream.readByteArray();
}
public void serializeToStream(SerializedData stream) {
stream.writeInt32(TL_encryptedChatRequested.constructor);
stream.writeInt32(id);
stream.writeInt64(access_hash);
stream.writeInt32(date);
stream.writeInt32(admin_id);
stream.writeInt32(participant_id);
stream.writeByteArray(g_a);
}
}
} }
...@@ -10,8 +10,10 @@ package org.telegram.messenger; ...@@ -10,8 +10,10 @@ package org.telegram.messenger;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.NetworkInfo; import android.net.NetworkInfo;
import android.os.Build;
import android.util.Base64; import android.util.Base64;
import org.telegram.TL.TLClassStore; import org.telegram.TL.TLClassStore;
...@@ -23,6 +25,7 @@ import java.io.File; ...@@ -23,6 +25,7 @@ import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
...@@ -30,6 +33,11 @@ import java.util.regex.Matcher; ...@@ -30,6 +33,11 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.TcpConnectionDelegate { public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.TcpConnectionDelegate {
public static boolean DEBUG_VERSION = false;
public static int APP_ID = 2458;
public static String APP_HASH = "5bce48dc7d331e62c955669eb7233217";
public static String HOCKEY_APP_HASH = "your-hockeyapp-api-key-here";
private HashMap<Integer, Datacenter> datacenters = new HashMap<Integer, Datacenter>(); private HashMap<Integer, Datacenter> datacenters = new HashMap<Integer, Datacenter>();
private HashMap<Long, ArrayList<Long>> processedMessageIdsSet = new HashMap<Long, ArrayList<Long>>(); private HashMap<Long, ArrayList<Long>> processedMessageIdsSet = new HashMap<Long, ArrayList<Long>>();
private HashMap<Long, Integer> nextSeqNoInSession = new HashMap<Long, Integer>(); private HashMap<Long, Integer> nextSeqNoInSession = new HashMap<Long, Integer>();
...@@ -62,6 +70,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -62,6 +70,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
private boolean updatingDcSettings = false; private boolean updatingDcSettings = false;
private int updatingDcStartTime = 0; private int updatingDcStartTime = 0;
private int lastDcUpdateTime = 0; private int lastDcUpdateTime = 0;
private int currentAppVersion = 0;
public static ConnectionsManager Instance = new ConnectionsManager(); public static ConnectionsManager Instance = new ConnectionsManager();
...@@ -73,6 +82,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -73,6 +82,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
private int nextSleepTimeout = 60000; private int nextSleepTimeout = 60000;
public ConnectionsManager() { public ConnectionsManager() {
currentAppVersion = ApplicationLoader.getAppVersion();
lastOutgoingMessageId = 0; lastOutgoingMessageId = 0;
movingToDatacenterId = DEFAULT_DATACENTER_ID; movingToDatacenterId = DEFAULT_DATACENTER_ID;
loadSession(); loadSession();
...@@ -622,9 +632,36 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -622,9 +632,36 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
return performRpc(rpc, completionBlock, progressBlock, null, requiresCompletion, requestClass, datacenterId); return performRpc(rpc, completionBlock, progressBlock, null, requiresCompletion, requestClass, datacenterId);
} }
TLObject wrapInLayer(TLObject object) { TLObject wrapInLayer(TLObject object, int datacenterId, RPCRequest request) {
if (object.layer() > 0) { if (object.layer() > 0) {
TLRPC.invokeWithLayer8 invoke = new TLRPC.invokeWithLayer8(); Datacenter datacenter = datacenterWithId(datacenterId);
if (datacenter.lastInitVersion != currentAppVersion) {
request.initRequest = true;
TLRPC.initConnection invoke = new TLRPC.initConnection();
invoke.query = object;
invoke.api_id = APP_ID;
try {
invoke.lang_code = Locale.getDefault().getCountry();
invoke.device_model = Build.MANUFACTURER + Build.MODEL;
if (invoke.device_model == null) {
invoke.device_model = "Android unknown";
}
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
invoke.app_version = pInfo.versionName;
if (invoke.app_version == null) {
invoke.app_version = "App version unknown";
}
invoke.system_version = "SDK " + Build.VERSION.SDK_INT;
} catch (Exception e) {
FileLog.e("tmessages", e);
invoke.lang_code = "en";
invoke.device_model = "Android unknown";
invoke.app_version = "App version unknown";
invoke.system_version = "SDK " + Build.VERSION.SDK_INT;
}
object = invoke;
}
TLRPC.invokeWithLayer11 invoke = new TLRPC.invokeWithLayer11();
invoke.query = object; invoke.query = object;
FileLog.d("wrap in layer", "" + object); FileLog.d("wrap in layer", "" + object);
return invoke; return invoke;
...@@ -647,7 +684,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -647,7 +684,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
request.runningDatacenterId = datacenterId; request.runningDatacenterId = datacenterId;
request.rawRequest = rpc; request.rawRequest = rpc;
request.rpcRequest = wrapInLayer(rpc); request.rpcRequest = wrapInLayer(rpc, datacenterId, request);
request.completionBlock = completionBlock; request.completionBlock = completionBlock;
request.progressBlock = progressBlock; request.progressBlock = progressBlock;
request.quickAckBlock = quickAckBlock; request.quickAckBlock = quickAckBlock;
...@@ -1791,12 +1828,14 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -1791,12 +1828,14 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
found = true; found = true;
boolean discardResponse = false; boolean discardResponse = false;
boolean isError = false;
if (request.completionBlock != null) { if (request.completionBlock != null) {
TLRPC.TL_error implicitError = null; TLRPC.TL_error implicitError = null;
if (resultContainer.result instanceof TLRPC.TL_gzip_packed) { if (resultContainer.result instanceof TLRPC.TL_gzip_packed) {
TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed)resultContainer.result; TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed)resultContainer.result;
TLObject uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest); TLObject uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest);
if (uncomressed == null) { if (uncomressed == null) {
System.gc();
uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest); uncomressed = Utilities.decompress(packet.packed_data, request.rawRequest);
} }
if (uncomressed == null) { if (uncomressed == null) {
...@@ -1871,6 +1910,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -1871,6 +1910,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (!discardResponse) { if (!discardResponse) {
if (implicitError != null || resultContainer.result instanceof TLRPC.TL_error) { if (implicitError != null || resultContainer.result instanceof TLRPC.TL_error) {
isError = true;
request.completionBlock.run(null, implicitError != null ? implicitError : (TLRPC.TL_error) resultContainer.result); request.completionBlock.run(null, implicitError != null ? implicitError : (TLRPC.TL_error) resultContainer.result);
} else { } else {
request.completionBlock.run(resultContainer.result, null); request.completionBlock.run(resultContainer.result, null);
...@@ -1878,6 +1918,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -1878,6 +1918,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
if (implicitError != null && implicitError.code == 401) { if (implicitError != null && implicitError.code == 401) {
isError = true;
if (datacenter.datacenterId == currentDatacenterId || datacenter.datacenterId == movingToDatacenterId) { if (datacenter.datacenterId == currentDatacenterId || datacenter.datacenterId == movingToDatacenterId) {
if ((request.flags & RPCRequest.RPCRequestClassGeneric) != 0) { if ((request.flags & RPCRequest.RPCRequestClassGeneric) != 0) {
Utilities.RunOnUIThread(new Runnable() { Utilities.RunOnUIThread(new Runnable() {
...@@ -1901,6 +1942,15 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -1901,6 +1942,15 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
if (!discardResponse) { if (!discardResponse) {
if (request.initRequest && !isError) {
if (datacenter.lastInitVersion != currentAppVersion) {
datacenter.lastInitVersion = currentAppVersion;
saveSession();
FileLog.e("tmessages", "init connection completed");
} else {
FileLog.e("tmessages", "rpc is init, but init connection already completed");
}
}
rpcCompleted(resultMid); rpcCompleted(resultMid);
} else { } else {
request.runningMessageId = 0; request.runningMessageId = 0;
...@@ -2309,6 +2359,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -2309,6 +2359,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
MessageKeyData keyData = Utilities.generateMessageKeyData(datacenter.authKey, messageKey, true); MessageKeyData keyData = Utilities.generateMessageKeyData(datacenter.authKey, messageKey, true);
byte[] messageData = is.readData(data.length - 24); byte[] messageData = is.readData(data.length - 24);
messageData = Utilities.aesIgeEncryption(messageData, keyData.aesKey, keyData.aesIv, false, false); messageData = Utilities.aesIgeEncryption(messageData, keyData.aesKey, keyData.aesIv, false, false);
if (messageData == null) { if (messageData == null) {
FileLog.e("tmessages", "Error: can't decrypt message data " + connection); FileLog.e("tmessages", "Error: can't decrypt message data " + connection);
...@@ -2329,6 +2380,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -2329,6 +2380,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
long messageId = messageIs.readInt64(); long messageId = messageIs.readInt64();
int messageSeqNo = messageIs.readInt32(); int messageSeqNo = messageIs.readInt32();
int messageLength = messageIs.readInt32();
if (isMessageIdProcessed(messageSessionId, messageId)) { if (isMessageIdProcessed(messageSessionId, messageId)) {
doNotProcess = true; doNotProcess = true;
...@@ -2342,22 +2394,20 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. ...@@ -2342,22 +2394,20 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
set.add(messageId); set.add(messageId);
} }
byte[] realMessageKeyFull = Utilities.computeSHA1(messageData, 0, Math.min(messageLength + 32, messageData.length)); byte[] realMessageKeyFull = Utilities.computeSHA1(messageData, 0, Math.min(messageLength + 32, messageData.length));
if (realMessageKeyFull == null) { if (realMessageKeyFull == null) {
return; return;
} }
byte[] realMessageKey = new byte[16]; byte[] realMessageKey = new byte[16];
System.arraycopy(realMessageKeyFull, realMessageKeyFull.length - 16, realMessageKey, 0, 16); System.arraycopy(realMessageKeyFull, realMessageKeyFull.length - 16, realMessageKey, 0, 16);
if (!Arrays.equals(messageKey, realMessageKey)) { if (!Arrays.equals(messageKey, realMessageKey)) {
FileLog.e("tmessages", "***** Error: invalid message key"); FileLog.e("tmessages", "***** Error: invalid message key");
return; return;
} }
if (!doNotProcess) { if (!doNotProcess) {
int messageLength = messageIs.readInt32();
int constructor = messageIs.readInt32(); int constructor = messageIs.readInt32();
TLObject message = TLClassStore.Instance().TLdeserialize(messageIs, constructor, getRequestWithMessageId(messageId)); TLObject message = TLClassStore.Instance().TLdeserialize(messageIs, constructor, getRequestWithMessageId(messageId));
......
...@@ -20,18 +20,19 @@ import java.util.Comparator; ...@@ -20,18 +20,19 @@ import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
public class Datacenter { public class Datacenter {
private final int DATA_VERSION = 2; private final int DATA_VERSION = 3;
public int datacenterId; public int datacenterId;
public ArrayList<String> addresses = new ArrayList<String>(); public ArrayList<String> addresses = new ArrayList<String>();
public HashMap<String, Integer> ports = new HashMap<String, Integer>(); public HashMap<String, Integer> ports = new HashMap<String, Integer>();
public int[] defaultPorts = new int[] {-1, 80, -1, 88, -1, 443, -1, 80, -1, 443, -1}; public int[] defaultPorts = new int[] {-1, 80, -1, 443, -1, 443, -1, 80, -1, 443, -1};
public boolean authorized; public boolean authorized;
public long authSessionId; public long authSessionId;
public long authDownloadSessionId; public long authDownloadSessionId;
public long authUploadSessionId; public long authUploadSessionId;
public byte[] authKey; public byte[] authKey;
public byte[] authKeyId; public byte[] authKeyId;
public int lastInitVersion = 0;
private volatile int currentPortNum = 0; private volatile int currentPortNum = 0;
private volatile int currentAddressNum = 0; private volatile int currentAddressNum = 0;
...@@ -74,8 +75,11 @@ public class Datacenter { ...@@ -74,8 +75,11 @@ public class Datacenter {
} }
} else if (version == 1) { } else if (version == 1) {
int currentVersion = data.readInt32(); int currentVersion = data.readInt32();
if (currentVersion == 2) { if (currentVersion == 2 || currentVersion == 3) {
datacenterId = data.readInt32(); datacenterId = data.readInt32();
if (currentVersion == 3) {
lastInitVersion = data.readInt32();
}
int len = data.readInt32(); int len = data.readInt32();
for (int a = 0; a < len; a++) { for (int a = 0; a < len; a++) {
String address = data.readString(); String address = data.readString();
...@@ -182,6 +186,7 @@ public class Datacenter { ...@@ -182,6 +186,7 @@ public class Datacenter {
public void SerializeToStream(SerializedData stream) { public void SerializeToStream(SerializedData stream) {
stream.writeInt32(DATA_VERSION); stream.writeInt32(DATA_VERSION);
stream.writeInt32(datacenterId); stream.writeInt32(datacenterId);
stream.writeInt32(lastInitVersion);
stream.writeInt32(addresses.size()); stream.writeInt32(addresses.size());
for (String address : addresses) { for (String address : addresses) {
stream.writeString(address); stream.writeString(address);
......
...@@ -19,7 +19,6 @@ import android.graphics.Paint; ...@@ -19,7 +19,6 @@ import android.graphics.Paint;
import android.graphics.Rect; import android.graphics.Rect;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.text.Spannable; import android.text.Spannable;
import android.text.Spanned;
import android.text.style.DynamicDrawableSpan; import android.text.style.DynamicDrawableSpan;
import android.text.style.ImageSpan; import android.text.style.ImageSpan;
import android.view.View; import android.view.View;
...@@ -510,9 +509,9 @@ public class Emoji { ...@@ -510,9 +509,9 @@ public class Emoji {
EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM); EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM);
emojiCount++; emojiCount++;
if (c>= 0xDDE6 && c <= 0xDDFA) { if (c>= 0xDDE6 && c <= 0xDDFA) {
s.setSpan(span, i - 3, i + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(span, i - 3, i + 1, 0);
} else { } else {
s.setSpan(span, i - 1, i + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(span, i - 1, i + 1, 0);
} }
} }
buf = 0; buf = 0;
...@@ -527,7 +526,7 @@ public class Emoji { ...@@ -527,7 +526,7 @@ public class Emoji {
if(d != null) { if(d != null) {
EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM); EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM);
emojiCount++; emojiCount++;
s.setSpan(span, i - 1, i + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(span, i - 1, i + 1, 0);
} }
buf = 0; buf = 0;
} }
...@@ -537,7 +536,7 @@ public class Emoji { ...@@ -537,7 +536,7 @@ public class Emoji {
if(d != null){ if(d != null){
EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM); EmojiSpan span = new EmojiSpan(d, DynamicDrawableSpan.ALIGN_BOTTOM);
emojiCount++; emojiCount++;
s.setSpan(span, i, i + 1, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); s.setSpan(span, i, i + 1, 0);
} }
} }
if (emojiCount >= 50) { if (emojiCount >= 50) {
......
...@@ -42,6 +42,7 @@ public class FileLoadOperation { ...@@ -42,6 +42,7 @@ public class FileLoadOperation {
private File cacheFileFinal; private File cacheFileFinal;
private File cacheIvTemp; private File cacheIvTemp;
private String ext;
private String httpUrl; private String httpUrl;
private URLConnection httpConnection; private URLConnection httpConnection;
public boolean needBitmapCreate = true; public boolean needBitmapCreate = true;
...@@ -90,6 +91,34 @@ public class FileLoadOperation { ...@@ -90,6 +91,34 @@ public class FileLoadOperation {
System.arraycopy(videoLocation.iv, 0, iv, 0, iv.length); System.arraycopy(videoLocation.iv, 0, iv, 0, iv.length);
key = videoLocation.key; key = videoLocation.key;
} }
ext = ".mp4";
}
public FileLoadOperation(TLRPC.Document documentLocation) {
if (documentLocation instanceof TLRPC.TL_document) {
location = new TLRPC.TL_inputDocumentFileLocation();
datacenter_id = documentLocation.dc_id;
location.id = documentLocation.id;
location.access_hash = documentLocation.access_hash;
} else if (documentLocation instanceof TLRPC.TL_documentEncrypted) {
location = new TLRPC.TL_inputEncryptedFileLocation();
location.id = documentLocation.id;
location.access_hash = documentLocation.access_hash;
datacenter_id = documentLocation.dc_id;
iv = new byte[32];
System.arraycopy(documentLocation.iv, 0, iv, 0, iv.length);
key = documentLocation.key;
}
ext = documentLocation.file_name;
int idx = -1;
if (ext == null || (idx = ext.lastIndexOf(".")) == -1) {
ext = "";
} else {
ext = ext.substring(idx);
if (ext.length() <= 1) {
ext = "";
}
}
} }
public FileLoadOperation(String url) { public FileLoadOperation(String url) {
...@@ -112,13 +141,20 @@ public class FileLoadOperation { ...@@ -112,13 +141,20 @@ public class FileLoadOperation {
} }
boolean ignoreCache = false; boolean ignoreCache = false;
boolean onlyCache = false; boolean onlyCache = false;
boolean isLocalFile = false;
String fileNameFinal = null; String fileNameFinal = null;
String fileNameTemp = null; String fileNameTemp = null;
String fileNameIv = null; String fileNameIv = null;
if (httpUrl != null) { if (httpUrl != null) {
fileNameFinal = Utilities.MD5(httpUrl); if (!httpUrl.startsWith("http")) {
fileNameTemp = fileNameFinal + "_temp.jpg"; onlyCache = true;
fileNameFinal += ".jpg"; isLocalFile = true;
fileNameFinal = httpUrl;
} else {
fileNameFinal = Utilities.MD5(httpUrl);
fileNameTemp = fileNameFinal + "_temp.jpg";
fileNameFinal += ".jpg";
}
} else if (location.volume_id != 0 && location.local_id != 0) { } else if (location.volume_id != 0 && location.local_id != 0) {
fileNameTemp = location.volume_id + "_" + location.local_id + "_temp.jpg"; fileNameTemp = location.volume_id + "_" + location.local_id + "_temp.jpg";
fileNameFinal = location.volume_id + "_" + location.local_id + ".jpg"; fileNameFinal = location.volume_id + "_" + location.local_id + ".jpg";
...@@ -131,15 +167,20 @@ public class FileLoadOperation { ...@@ -131,15 +167,20 @@ public class FileLoadOperation {
} else { } else {
ignoreCache = true; ignoreCache = true;
needBitmapCreate = false; needBitmapCreate = false;
fileNameTemp = datacenter_id + "_" + location.id + "_temp.mp4"; fileNameTemp = datacenter_id + "_" + location.id + "_temp" + ext;
fileNameFinal = datacenter_id + "_" + location.id + ".mp4"; fileNameFinal = datacenter_id + "_" + location.id + ext;
if (key != null) { if (key != null) {
fileNameIv = datacenter_id + "_" + location.id + ".iv"; fileNameIv = datacenter_id + "_" + location.id + ".iv";
} }
} }
boolean exist; boolean exist;
cacheFileFinal = new File(Utilities.getCacheDir(), fileNameFinal); if (isLocalFile) {
cacheFileFinal = new File(fileNameFinal);
} else {
cacheFileFinal = new File(Utilities.getCacheDir(), fileNameFinal);
}
final boolean dontDelete = isLocalFile;
if ((exist = cacheFileFinal.exists()) && !ignoreCache) { if ((exist = cacheFileFinal.exists()) && !ignoreCache) {
Utilities.cacheOutQueue.postRunnable(new Runnable() { Utilities.cacheOutQueue.postRunnable(new Runnable() {
@Override @Override
...@@ -184,7 +225,9 @@ public class FileLoadOperation { ...@@ -184,7 +225,9 @@ public class FileLoadOperation {
image = BitmapFactory.decodeStream(is, null, opts); image = BitmapFactory.decodeStream(is, null, opts);
is.close(); is.close();
if (image == null) { if (image == null) {
cacheFileFinal.delete(); if (!dontDelete) {
cacheFileFinal.delete();
}
} else { } else {
if (filter != null && image != null) { if (filter != null && image != null) {
float bitmapW = image.getWidth(); float bitmapW = image.getWidth();
...@@ -213,7 +256,9 @@ public class FileLoadOperation { ...@@ -213,7 +256,9 @@ public class FileLoadOperation {
} }
}); });
} catch (Exception e) { } catch (Exception e) {
cacheFileFinal.delete(); if (!dontDelete) {
cacheFileFinal.delete();
}
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
} }
...@@ -293,7 +338,9 @@ public class FileLoadOperation { ...@@ -293,7 +338,9 @@ public class FileLoadOperation {
private void cleanup() { private void cleanup() {
if (httpUrl != null) { if (httpUrl != null) {
try { try {
httpConnectionStream.close(); if (httpConnectionStream != null) {
httpConnectionStream.close();
}
httpConnection = null; httpConnection = null;
httpConnectionStream = null; httpConnectionStream = null;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -19,6 +19,7 @@ import android.view.View; ...@@ -19,6 +19,7 @@ import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import org.telegram.TL.TLRPC; import org.telegram.TL.TLRPC;
import org.telegram.objects.MessageObject;
import org.telegram.ui.ApplicationLoader; import org.telegram.ui.ApplicationLoader;
import org.telegram.ui.Views.BackupImageView; import org.telegram.ui.Views.BackupImageView;
...@@ -388,8 +389,8 @@ public class FileLoader { ...@@ -388,8 +389,8 @@ public class FileLoader {
}); });
} }
public void cancelLoadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo) { public void cancelLoadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo, final TLRPC.Document document) {
if (video == null && photo == null) { if (video == null && photo == null && document == null) {
return; return;
} }
Utilities.fileUploadQueue.postRunnable(new Runnable() { Utilities.fileUploadQueue.postRunnable(new Runnable() {
...@@ -397,9 +398,14 @@ public class FileLoader { ...@@ -397,9 +398,14 @@ public class FileLoader {
public void run() { public void run() {
String fileName = null; String fileName = null;
if (video != null) { if (video != null) {
fileName = video.dc_id + "_" + video.id + ".mp4"; fileName = MessageObject.getAttachFileName(video);
} else if (photo != null) { } else if (photo != null) {
fileName = photo.location.volume_id + "_" + photo.location.local_id + ".jpg"; fileName = MessageObject.getAttachFileName(photo);
} else if (document != null) {
fileName = MessageObject.getAttachFileName(document);
}
if (fileName == null) {
return;
} }
FileLoadOperation operation = loadOperationPaths.get(fileName); FileLoadOperation operation = loadOperationPaths.get(fileName);
if (operation != null) { if (operation != null) {
...@@ -414,15 +420,20 @@ public class FileLoader { ...@@ -414,15 +420,20 @@ public class FileLoader {
return loadOperationPaths.containsKey(fileName); return loadOperationPaths.containsKey(fileName);
} }
public void loadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo) { public void loadFile(final TLRPC.Video video, final TLRPC.PhotoSize photo, final TLRPC.Document document) {
Utilities.fileUploadQueue.postRunnable(new Runnable() { Utilities.fileUploadQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
String fileName = null; String fileName = null;
if (video != null) { if (video != null) {
fileName = video.dc_id + "_" + video.id + ".mp4"; fileName = MessageObject.getAttachFileName(video);
} else if (photo != null) { } else if (photo != null) {
fileName = photo.location.volume_id + "_" + photo.location.local_id + ".jpg"; fileName = MessageObject.getAttachFileName(photo);
} else if (document != null) {
fileName = MessageObject.getAttachFileName(document);
}
if (fileName == null) {
return;
} }
if (loadOperationPaths.containsKey(fileName)) { if (loadOperationPaths.containsKey(fileName)) {
return; return;
...@@ -435,6 +446,9 @@ public class FileLoader { ...@@ -435,6 +446,9 @@ public class FileLoader {
operation = new FileLoadOperation(photo.location); operation = new FileLoadOperation(photo.location);
operation.totalBytesCount = photo.size; operation.totalBytesCount = photo.size;
operation.needBitmapCreate = false; operation.needBitmapCreate = false;
} else if (document != null) {
operation = new FileLoadOperation(document);
operation.totalBytesCount = document.size;
} }
final String arg1 = fileName; final String arg1 = fileName;
...@@ -536,24 +550,6 @@ public class FileLoader { ...@@ -536,24 +550,6 @@ public class FileLoader {
memCache.evictAll(); memCache.evictAll();
} }
public void cleanDisk(boolean all) {
/*if (all) {
[cacheInQueue cancelAllOperations];
[[NSFileManager defaultManager] removeItemAtPath:diskCachePath error:nil];
[[NSFileManager defaultManager] createDirectoryAtPath:diskCachePath withIntermediateDirectories:YES attributes:nil error:NULL];
} else {
NSDate *expirationDate = [NSDate dateWithTimeIntervalSinceNow:-cacheMaxCacheAge];
NSDirectoryEnumerator *fileEnumerator = [[NSFileManager defaultManager] enumeratorAtPath:diskCachePath];
for (NSString *fileName in fileEnumerator) {
NSString *filePath = [diskCachePath stringByAppendingPathComponent:fileName];
NSDictionary *attrs = [[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil];
if ([[[attrs fileModificationDate] laterDate:expirationDate] isEqualToDate:expirationDate]) {
[[NSFileManager defaultManager] removeItemAtPath:filePath error:nil];
}
}
}*/
}
public void cancelLoadingForImageView(final View imageView) { public void cancelLoadingForImageView(final View imageView) {
if (imageView == null) { if (imageView == null) {
return; return;
...@@ -598,10 +594,11 @@ public class FileLoader { ...@@ -598,10 +594,11 @@ public class FileLoader {
String key; String key;
if (httpUrl != null) { if (httpUrl != null) {
key = Utilities.MD5(httpUrl); key = Utilities.MD5(httpUrl);
} else if (filter == null) {
key = url.volume_id + "_" + url.local_id;
} else { } else {
key = url.volume_id + "_" + url.local_id + "@" + filter; key = url.volume_id + "_" + url.local_id;
}
if (filter != null) {
key += "@" + filter;
} }
Bitmap img = imageFromKey(key); Bitmap img = imageFromKey(key);
...@@ -664,10 +661,11 @@ public class FileLoader { ...@@ -664,10 +661,11 @@ public class FileLoader {
String key; String key;
if (httpUrl != null) { if (httpUrl != null) {
key = Utilities.MD5(httpUrl); key = Utilities.MD5(httpUrl);
} else if (filter == null) {
key = url.volume_id + "_" + url.local_id;
} else { } else {
key = url.volume_id + "_" + url.local_id + "@" + filter; key = url.volume_id + "_" + url.local_id;
}
if (filter != null) {
key += "@" + filter;
} }
Integer num = (Integer)imageView.getTag(R.string.CacheTag); Integer num = (Integer)imageView.getTag(R.string.CacheTag);
......
...@@ -20,8 +20,6 @@ import java.util.ArrayList; ...@@ -20,8 +20,6 @@ import java.util.ArrayList;
import java.util.Locale; import java.util.Locale;
public class FileLog { public class FileLog {
public static boolean DEBUG_VERSION = true;
public static FileLog Instance = new FileLog(); public static FileLog Instance = new FileLog();
private OutputStreamWriter streamWriter = null; private OutputStreamWriter streamWriter = null;
private FastDateFormat dateFormat = null; private FastDateFormat dateFormat = null;
...@@ -29,7 +27,7 @@ public class FileLog { ...@@ -29,7 +27,7 @@ public class FileLog {
private File currentFile = null; private File currentFile = null;
public FileLog() { public FileLog() {
if (!DEBUG_VERSION) { if (!ConnectionsManager.DEBUG_VERSION) {
return; return;
} }
dateFormat = FastDateFormat.getInstance("dd_MM_yyyy_HH_mm_ss", Locale.US); dateFormat = FastDateFormat.getInstance("dd_MM_yyyy_HH_mm_ss", Locale.US);
...@@ -59,7 +57,7 @@ public class FileLog { ...@@ -59,7 +57,7 @@ public class FileLog {
} }
public static void e(final String tag, final String message, final Throwable exception) { public static void e(final String tag, final String message, final Throwable exception) {
if (!DEBUG_VERSION) { if (!ConnectionsManager.DEBUG_VERSION) {
return; return;
} }
Log.e(tag, message, exception); Log.e(tag, message, exception);
...@@ -80,7 +78,7 @@ public class FileLog { ...@@ -80,7 +78,7 @@ public class FileLog {
} }
public static void e(final String tag, final String message) { public static void e(final String tag, final String message) {
if (!DEBUG_VERSION) { if (!ConnectionsManager.DEBUG_VERSION) {
return; return;
} }
Log.e(tag, message); Log.e(tag, message);
...@@ -100,7 +98,7 @@ public class FileLog { ...@@ -100,7 +98,7 @@ public class FileLog {
} }
public static void e(final String tag, final Exception e) { public static void e(final String tag, final Exception e) {
if (!DEBUG_VERSION) { if (!ConnectionsManager.DEBUG_VERSION) {
return; return;
} }
e.printStackTrace(); e.printStackTrace();
...@@ -124,7 +122,7 @@ public class FileLog { ...@@ -124,7 +122,7 @@ public class FileLog {
} }
public static void d(final String tag, final String message) { public static void d(final String tag, final String message) {
if (!DEBUG_VERSION) { if (!ConnectionsManager.DEBUG_VERSION) {
return; return;
} }
Log.d(tag, message); Log.d(tag, message);
......
...@@ -77,9 +77,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti ...@@ -77,9 +77,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
TLRPC.TL_req_pq reqPq = new TLRPC.TL_req_pq(); TLRPC.TL_req_pq reqPq = new TLRPC.TL_req_pq();
byte[] nonceBytes = new byte[16]; byte[] nonceBytes = new byte[16];
for (int a = 0; a < 16; a++) { MessagesController.random.nextBytes(nonceBytes);
nonceBytes[a] = (byte)(MessagesController.random.nextDouble() * 255);
}
authNonce = reqPq.nonce = nonceBytes; authNonce = reqPq.nonce = nonceBytes;
reqPQMsgData = sendMessageData(reqPq, generateMessageId()); reqPQMsgData = sendMessageData(reqPq, generateMessageId());
} }
...@@ -104,6 +102,45 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti ...@@ -104,6 +102,45 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
new BigInteger("010001", 16)}); new BigInteger("010001", 16)});
map.put("fingerprint", 0xc3b42b026ce86b21L); map.put("fingerprint", 0xc3b42b026ce86b21L);
serverPublicKeys.add(map); serverPublicKeys.add(map);
map = new HashMap<String, Object>();
map.put("key", new BigInteger[]{
new BigInteger("c6aeda78b02a251db4b6441031f467fa871faed32526c436524b1fb3b5dc" +
"a28efb8c089dd1b46d92c895993d87108254951c5f001a0f055f3063dcd14d431a300eb9e29" +
"517e359a1c9537e5e87ab1b116faecf5d17546ebc21db234d9d336a693efcb2b6fbcca1e7d1" +
"a0be414dca408a11609b9c4269a920b09fed1f9a1597be02761430f09e4bc48fcafbe289054" +
"c99dba51b6b5eb7d9c3a2ab4e490545b4676bd620e93804bcac93bf94f73f92c729ca899477" +
"ff17625ef14a934d51dc11d5f8650a3364586b3a52fcff2fedec8a8406cac4e751705a472e5" +
"5707e3c8cd5594342b119c6c3293532d85dbe9271ed54a2fd18b4dc79c04a30951107d5639397", 16),
new BigInteger("010001", 16)});
map.put("fingerprint", 0x9a996a1db11c729bL);
serverPublicKeys.add(map);
map = new HashMap<String, Object>();
map.put("key", new BigInteger[]{
new BigInteger("b1066749655935f0a5936f517034c943bea7f3365a8931ae52c8bcb14856" +
"f004b83d26cf2839be0f22607470d67481771c1ce5ec31de16b20bbaa4ecd2f7d2ecf6b6356" +
"f27501c226984263edc046b89fb6d3981546b01d7bd34fedcfcc1058e2d494bda732ff813e5" +
"0e1c6ae249890b225f82b22b1e55fcb063dc3c0e18e91c28d0c4aa627dec8353eee6038a95a" +
"4fd1ca984eb09f94aeb7a2220635a8ceb450ea7e61d915cdb4eecedaa083aa3801daf071855" +
"ec1fb38516cb6c2996d2d60c0ecbcfa57e4cf1fb0ed39b2f37e94ab4202ecf595e167b3ca62" +
"669a6da520859fb6d6c6203dfdfc79c75ec3ee97da8774b2da903e3435f2cd294670a75a526c1", 16),
new BigInteger("010001", 16)});
map.put("fingerprint", 0xb05b2a6f70cdea78L);
serverPublicKeys.add(map);
map = new HashMap<String, Object>();
map.put("key", new BigInteger[]{
new BigInteger("c2a8c55b4a62e2b78a19b91cf692bcdc4ba7c23fe4d06f194e2a0c30f6d9" +
"996f7d1a2bcc89bc1ac4333d44359a6c433252d1a8402d9970378b5912b75bc8cc3fa76710a" +
"025bcb9032df0b87d7607cc53b928712a174ea2a80a8176623588119d42ffce40205c6d7216" +
"0860d8d80b22a8b8651907cf388effbef29cd7cf2b4eb8a872052da1351cfe7fec214ce4830" +
"4ea472bd66329d60115b3420d08f6894b0410b6ab9450249967617670c932f7cbdb5d6fbcce" +
"1e492c595f483109999b2661fcdeec31b196429b7834c7211a93c6789d9ee601c18c39e521f" +
"da9d7264e61e518add6f0712d2d5228204b851e13c4f322e5c5431c3b7f31089668486aadc59f", 16),
new BigInteger("010001", 16)});
map.put("fingerprint", 0x71e025b6c76033e3L);
serverPublicKeys.add(map);
} }
} }
...@@ -209,9 +246,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti ...@@ -209,9 +246,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
innerData.q = reqDH.q; innerData.q = reqDH.q;
byte[] nonceBytes = new byte[32]; byte[] nonceBytes = new byte[32];
for (int a = 0; a < 32; a++) { MessagesController.random.nextBytes(nonceBytes);
nonceBytes[a] = (byte)(MessagesController.random.nextDouble() * 255);
}
innerData.new_nonce = authNewNonce = nonceBytes; innerData.new_nonce = authNewNonce = nonceBytes;
innerData.serializeToStream(os); innerData.serializeToStream(os);
...@@ -340,9 +375,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti ...@@ -340,9 +375,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
} }
byte[] b = new byte[256]; byte[] b = new byte[256];
for (int a = 0; a < 256; a++) { MessagesController.random.nextBytes(b);
b[a] = (byte)(MessagesController.random.nextDouble() * 255);
}
BigInteger p = new BigInteger(1, dhInnerData.dh_prime); BigInteger p = new BigInteger(1, dhInnerData.dh_prime);
BigInteger g_a = new BigInteger(1, dhInnerData.g_a); BigInteger g_a = new BigInteger(1, dhInnerData.g_a);
......
...@@ -133,6 +133,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -133,6 +133,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public int type; public int type;
public TLRPC.FileLocation location; public TLRPC.FileLocation location;
public TLRPC.TL_video videoLocation; public TLRPC.TL_video videoLocation;
public TLRPC.TL_document documentLocation;
public MessageObject obj; public MessageObject obj;
public TLRPC.EncryptedChat encryptedChat; public TLRPC.EncryptedChat encryptedChat;
} }
...@@ -1960,31 +1961,35 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -1960,31 +1961,35 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} }
public void sendMessage(TLRPC.User user, long peer) { public void sendMessage(TLRPC.User user, long peer) {
sendMessage(null, 0, 0, null, null, null, null, user, peer); sendMessage(null, 0, 0, null, null, null, null, user, null, peer);
} }
public void sendMessage(MessageObject message, long peer) { public void sendMessage(MessageObject message, long peer) {
sendMessage(null, 0, 0, null, null, message, null, null, peer); sendMessage(null, 0, 0, null, null, message, null, null, null, peer);
}
public void sendMessage(TLRPC.TL_document document, long peer) {
sendMessage(null, 0, 0, null, null, null, null, null, document, peer);
} }
public void sendMessage(String message, long peer) { public void sendMessage(String message, long peer) {
sendMessage(message, 0, 0, null, null, null, null, null, peer); sendMessage(message, 0, 0, null, null, null, null, null, null, peer);
} }
public void sendMessage(TLRPC.FileLocation location, long peer) { public void sendMessage(TLRPC.FileLocation location, long peer) {
sendMessage(null, 0, 0, null, null, null, location, null, peer); sendMessage(null, 0, 0, null, null, null, location, null, null, peer);
} }
public void sendMessage(double lat, double lon, long peer) { public void sendMessage(double lat, double lon, long peer) {
sendMessage(null, lat, lon, null, null, null, null, null, peer); sendMessage(null, lat, lon, null, null, null, null, null, null, peer);
} }
public void sendMessage(TLRPC.TL_photo photo, long peer) { public void sendMessage(TLRPC.TL_photo photo, long peer) {
sendMessage(null, 0, 0, photo, null, null, null, null, peer); sendMessage(null, 0, 0, photo, null, null, null, null, null, peer);
} }
public void sendMessage(TLRPC.TL_video video, long peer) { public void sendMessage(TLRPC.TL_video video, long peer) {
sendMessage(null, 0, 0, null, video, null, null, null, peer); sendMessage(null, 0, 0, null, video, null, null, null, null, peer);
} }
public void sendTTLMessage(TLRPC.EncryptedChat encryptedChat) { public void sendTTLMessage(TLRPC.EncryptedChat encryptedChat) {
...@@ -2028,7 +2033,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2028,7 +2033,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null); performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null);
} }
private void sendMessage(String message, double lat, double lon, TLRPC.TL_photo photo, TLRPC.TL_video video, MessageObject msgObj, TLRPC.FileLocation location, TLRPC.User user, long peer) { private void sendMessage(String message, double lat, double lon, TLRPC.TL_photo photo, TLRPC.TL_video video, MessageObject msgObj, TLRPC.FileLocation location, TLRPC.User user, TLRPC.TL_document document, long peer) {
TLRPC.Message newMsg = null; TLRPC.Message newMsg = null;
int type = -1; int type = -1;
if (message != null) { if (message != null) {
...@@ -2095,6 +2100,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2095,6 +2100,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMsg.media.user_id = user.id; newMsg.media.user_id = user.id;
newMsg.message = ""; newMsg.message = "";
type = 6; type = 6;
} else if (document != null) {
newMsg = new TLRPC.TL_message();
newMsg.media = new TLRPC.TL_messageMediaDocument();
newMsg.media.document = document;
type = 7;
newMsg.message = "-1";
newMsg.attachPath = document.path;
} }
if (newMsg == null) { if (newMsg == null) {
return; return;
...@@ -2172,7 +2184,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2172,7 +2184,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
reqSend.media = new TLRPC.TL_decryptedMessageMediaEmpty(); reqSend.media = new TLRPC.TL_decryptedMessageMediaEmpty();
performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null); performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null);
} }
} else if (type == 1 || type == 2 || type == 3 || type == 5 || type == 6) { } else if (type == 1 || type == 2 || type == 3 || type == 5 || type == 6 || type == 7) {
if (encryptedChat == null) { if (encryptedChat == null) {
TLRPC.TL_messages_sendMedia reqSend = new TLRPC.TL_messages_sendMedia(); TLRPC.TL_messages_sendMedia reqSend = new TLRPC.TL_messages_sendMedia();
reqSend.peer = sendToPeer; reqSend.peer = sendToPeer;
...@@ -2216,6 +2228,16 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2216,6 +2228,16 @@ public class MessagesController implements NotificationCenter.NotificationCenter
reqSend.media.first_name = user.first_name; reqSend.media.first_name = user.first_name;
reqSend.media.last_name = user.last_name; reqSend.media.last_name = user.last_name;
performSendMessageRequest(reqSend, newMsgObj); performSendMessageRequest(reqSend, newMsgObj);
} else if (type == 7) {
reqSend.media = new TLRPC.TL_inputMediaUploadedDocument();
reqSend.media.mime_type = document.mime_type;
reqSend.media.file_name = document.file_name;
DelayedMessage delayedMessage = new DelayedMessage();
delayedMessage.sendRequest = reqSend;
delayedMessage.type = 2;
delayedMessage.obj = newMsgObj;
delayedMessage.documentLocation = document;
performSendDelayedMessage(delayedMessage);
} }
} else { } else {
TLRPC.TL_decryptedMessage reqSend = new TLRPC.TL_decryptedMessage(); TLRPC.TL_decryptedMessage reqSend = new TLRPC.TL_decryptedMessage();
...@@ -2280,6 +2302,26 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2280,6 +2302,26 @@ public class MessagesController implements NotificationCenter.NotificationCenter
reqSend.media.last_name = user.last_name; reqSend.media.last_name = user.last_name;
reqSend.media.user_id = user.id; reqSend.media.user_id = user.id;
performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null); performSendEncryptedRequest(reqSend, newMsgObj, encryptedChat, null);
} else if (type == 7) {
reqSend.media = new TLRPC.TL_decryptedMessageMediaDocument();
reqSend.media.iv = new byte[32];
reqSend.media.key = new byte[32];
random.nextBytes(reqSend.media.iv);
random.nextBytes(reqSend.media.key);
reqSend.media.size = document.size;
reqSend.media.thumb = new byte[0];
reqSend.media.thumb_h = 0;
reqSend.media.thumb_w = 0;
reqSend.media.file_name = document.file_name;
reqSend.media.mime_type = document.mime_type;
DelayedMessage delayedMessage = new DelayedMessage();
delayedMessage.sendEncryptedRequest = reqSend;
delayedMessage.type = 2;
delayedMessage.obj = newMsgObj;
delayedMessage.encryptedChat = encryptedChat;
delayedMessage.documentLocation = document;
performSendDelayedMessage(delayedMessage);
} }
} }
} else if (type == 4) { } else if (type == 4) {
...@@ -2337,6 +2379,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2337,6 +2379,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter
sendedMessage.message = newMsg.message; sendedMessage.message = newMsg.message;
sendedMessage.attachPath = newMsg.attachPath; sendedMessage.attachPath = newMsg.attachPath;
} }
} else if (sendedMessage.media instanceof TLRPC.TL_messageMediaDocument && sendedMessage.media.document != null && newMsg.media instanceof TLRPC.TL_messageMediaDocument && newMsg.media.document != null) {
sendedMessage.message = newMsg.message;
sendedMessage.attachPath = newMsg.attachPath;
} }
} else if (file != null) { } else if (file != null) {
if (newMsg.media instanceof TLRPC.TL_messageMediaPhoto && newMsg.media.photo != null) { if (newMsg.media instanceof TLRPC.TL_messageMediaPhoto && newMsg.media.photo != null) {
...@@ -2378,6 +2423,24 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2378,6 +2423,24 @@ public class MessagesController implements NotificationCenter.NotificationCenter
ArrayList<TLRPC.Message> arr = new ArrayList<TLRPC.Message>(); ArrayList<TLRPC.Message> arr = new ArrayList<TLRPC.Message>();
arr.add(newMsg); arr.add(newMsg);
MessagesStorage.Instance.putMessages(arr, false, true); MessagesStorage.Instance.putMessages(arr, false, true);
} else if (newMsg.media instanceof TLRPC.TL_messageMediaDocument && newMsg.media.document != null) {
TLRPC.Document document = newMsg.media.document;
newMsg.media.document = new TLRPC.TL_documentEncrypted();
newMsg.media.document.id = file.id;
newMsg.media.document.access_hash = file.access_hash;
newMsg.media.document.user_id = document.user_id;
newMsg.media.document.date = document.date;
newMsg.media.document.file_name = document.file_name;
newMsg.media.document.mime_type = document.mime_type;
newMsg.media.document.size = file.size;
newMsg.media.document.key = decryptedMessage.media.key;
newMsg.media.document.iv = decryptedMessage.media.iv;
newMsg.media.document.path = document.path;
newMsg.media.document.thumb = document.thumb;
newMsg.media.document.dc_id = file.dc_id;
ArrayList<TLRPC.Message> arr = new ArrayList<TLRPC.Message>();
arr.add(newMsg);
MessagesStorage.Instance.putMessages(arr, false, true);
} }
} }
} }
...@@ -2591,6 +2654,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2591,6 +2654,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter
delayedMessages.put(location, message); delayedMessages.put(location, message);
FileLoader.Instance.uploadFile(location, message.sendEncryptedRequest.media.key, message.sendEncryptedRequest.media.iv); FileLoader.Instance.uploadFile(location, message.sendEncryptedRequest.media.key, message.sendEncryptedRequest.media.iv);
} }
} else if (message.type == 2) {
String location = message.documentLocation.path;
delayedMessages.put(location, message);
if (message.sendRequest != null) {
FileLoader.Instance.uploadFile(location, null, null);
} else {
FileLoader.Instance.uploadFile(location, message.sendEncryptedRequest.media.key, message.sendEncryptedRequest.media.iv);
}
} }
} }
}); });
...@@ -2903,12 +2974,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -2903,12 +2974,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter
message.sendRequest.media.file = file; message.sendRequest.media.file = file;
performSendMessageRequest(message.sendRequest, message.obj); performSendMessageRequest(message.sendRequest, message.obj);
} }
} else if (message.type == 2) {
message.sendRequest.media.file = file;
performSendMessageRequest(message.sendRequest, message.obj);
} }
} else if (encryptedFile != null) { } else if (encryptedFile != null) {
if (message.type == 0) { if (message.type == 0) {
performSendEncryptedRequest(message.sendEncryptedRequest, message.obj, message.encryptedChat, encryptedFile); performSendEncryptedRequest(message.sendEncryptedRequest, message.obj, message.encryptedChat, encryptedFile);
} else if (message.type == 1) { } else if (message.type == 1) {
performSendEncryptedRequest(message.sendEncryptedRequest, message.obj, message.encryptedChat, encryptedFile); performSendEncryptedRequest(message.sendEncryptedRequest, message.obj, message.encryptedChat, encryptedFile);
} else if (message.type == 2) {
performSendEncryptedRequest(message.sendEncryptedRequest, message.obj, message.encryptedChat, encryptedFile);
} }
} }
delayedMessages.remove(location); delayedMessages.remove(location);
...@@ -4473,6 +4549,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4473,6 +4549,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageContact, Utilities.formatName(u.first_name, u.last_name)); msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageContact, Utilities.formatName(u.first_name, u.last_name));
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) { } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageMap, Utilities.formatName(u.first_name, u.last_name)); msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageMap, Utilities.formatName(u.first_name, u.last_name));
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageDocument, Utilities.formatName(u.first_name, u.last_name));
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaAudio) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageAudio, Utilities.formatName(u.first_name, u.last_name));
} }
} }
} else if (chat_id != 0 && user_id == 0) { } else if (chat_id != 0 && user_id == 0) {
...@@ -4527,6 +4607,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4527,6 +4607,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupContact, Utilities.formatName(u.first_name, u.last_name), chat.title); msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupContact, Utilities.formatName(u.first_name, u.last_name), chat.title);
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) { } else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaGeo) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupMap, Utilities.formatName(u.first_name, u.last_name), chat.title); msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupMap, Utilities.formatName(u.first_name, u.last_name), chat.title);
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupDocument, Utilities.formatName(u.first_name, u.last_name), chat.title);
} else if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaAudio) {
msg = ApplicationLoader.applicationContext.getString(R.string.NotificationMessageGroupAudio, Utilities.formatName(u.first_name, u.last_name), chat.title);
} }
} }
} }
...@@ -4737,13 +4821,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4737,13 +4821,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.media.photo.date = newMessage.date; newMessage.media.photo.date = newMessage.date;
newMessage.media.photo.caption = ""; newMessage.media.photo.caption = "";
newMessage.media.photo.geo = new TLRPC.TL_geoPointEmpty(); newMessage.media.photo.geo = new TLRPC.TL_geoPointEmpty();
TLRPC.TL_photoCachedSize small = new TLRPC.TL_photoCachedSize(); if (decryptedMessage.media.thumb.length != 0 && decryptedMessage.media.thumb.length <= 5000 && decryptedMessage.media.thumb_w < 100 && decryptedMessage.media.thumb_h < 100) {
small.w = decryptedMessage.media.thumb_w; TLRPC.TL_photoCachedSize small = new TLRPC.TL_photoCachedSize();
small.h = decryptedMessage.media.thumb_h; small.w = decryptedMessage.media.thumb_w;
small.bytes = decryptedMessage.media.thumb; small.h = decryptedMessage.media.thumb_h;
small.type = "s"; small.bytes = decryptedMessage.media.thumb;
small.location = new TLRPC.TL_fileLocationUnavailable(); small.type = "s";
newMessage.media.photo.sizes.add(small); small.location = new TLRPC.TL_fileLocationUnavailable();
newMessage.media.photo.sizes.add(small);
}
TLRPC.TL_photoSize big = new TLRPC.TL_photoSize(); TLRPC.TL_photoSize big = new TLRPC.TL_photoSize();
big.w = decryptedMessage.media.w; big.w = decryptedMessage.media.w;
...@@ -4764,12 +4850,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4764,12 +4850,17 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} }
newMessage.media = new TLRPC.TL_messageMediaVideo(); newMessage.media = new TLRPC.TL_messageMediaVideo();
newMessage.media.video = new TLRPC.TL_videoEncrypted(); newMessage.media.video = new TLRPC.TL_videoEncrypted();
newMessage.media.video.thumb = new TLRPC.TL_photoCachedSize(); if (decryptedMessage.media.thumb.length != 0 && decryptedMessage.media.thumb.length <= 5000 && decryptedMessage.media.thumb_w < 100 && decryptedMessage.media.thumb_h < 100) {
newMessage.media.video.thumb.bytes = decryptedMessage.media.thumb; newMessage.media.video.thumb = new TLRPC.TL_photoCachedSize();
newMessage.media.video.thumb.w = decryptedMessage.media.thumb_w; newMessage.media.video.thumb.bytes = decryptedMessage.media.thumb;
newMessage.media.video.thumb.h = decryptedMessage.media.thumb_h; newMessage.media.video.thumb.w = decryptedMessage.media.thumb_w;
newMessage.media.video.thumb.type = "s"; newMessage.media.video.thumb.h = decryptedMessage.media.thumb_h;
newMessage.media.video.thumb.location = new TLRPC.TL_fileLocationUnavailable(); newMessage.media.video.thumb.type = "s";
newMessage.media.video.thumb.location = new TLRPC.TL_fileLocationUnavailable();
} else {
newMessage.media.video.thumb = new TLRPC.TL_photoSizeEmpty();
newMessage.media.video.thumb.type = "s";
}
newMessage.media.video.duration = decryptedMessage.media.duration; newMessage.media.video.duration = decryptedMessage.media.duration;
newMessage.media.video.dc_id = message.file.dc_id; newMessage.media.video.dc_id = message.file.dc_id;
newMessage.media.video.w = decryptedMessage.media.w; newMessage.media.video.w = decryptedMessage.media.w;
...@@ -4782,6 +4873,33 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4782,6 +4873,33 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.media.video.access_hash = message.file.access_hash; newMessage.media.video.access_hash = message.file.access_hash;
newMessage.media.video.key = decryptedMessage.media.key; newMessage.media.video.key = decryptedMessage.media.key;
newMessage.media.video.iv = decryptedMessage.media.iv; newMessage.media.video.iv = decryptedMessage.media.iv;
} else if (decryptedMessage.media instanceof TLRPC.TL_decryptedMessageMediaDocument) {
if (decryptedMessage.media.key.length != 32 || decryptedMessage.media.iv.length != 32) {
return null;
}
newMessage.media = new TLRPC.TL_messageMediaDocument();
newMessage.media.document = new TLRPC.TL_documentEncrypted();
newMessage.media.document.id = message.file.id;
newMessage.media.document.access_hash = message.file.access_hash;
newMessage.media.document.user_id = decryptedMessage.media.user_id;
newMessage.media.document.date = message.date;
newMessage.media.document.file_name = decryptedMessage.media.file_name;
newMessage.media.document.mime_type = decryptedMessage.media.mime_type;
newMessage.media.document.size = message.file.size;
newMessage.media.document.key = decryptedMessage.media.key;
newMessage.media.document.iv = decryptedMessage.media.iv;
if (decryptedMessage.media.thumb.length != 0 && decryptedMessage.media.thumb.length <= 5000 && decryptedMessage.media.thumb_w < 100 && decryptedMessage.media.thumb_h < 100) {
newMessage.media.document.thumb = new TLRPC.TL_photoCachedSize();
newMessage.media.document.thumb.bytes = decryptedMessage.media.thumb;
newMessage.media.document.thumb.w = decryptedMessage.media.thumb_w;
newMessage.media.document.thumb.h = decryptedMessage.media.thumb_h;
newMessage.media.document.thumb.type = "s";
newMessage.media.document.thumb.location = new TLRPC.TL_fileLocationUnavailable();
} else {
newMessage.media.document.thumb = new TLRPC.TL_photoSizeEmpty();
newMessage.media.document.thumb.type = "s";
}
newMessage.media.document.dc_id = message.file.dc_id;
} else { } else {
return null; return null;
} }
...@@ -4903,7 +5021,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -4903,7 +5021,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} }
byte[] salt = new byte[256]; byte[] salt = new byte[256];
for (int a = 0; a < 256; a++) { for (int a = 0; a < 256; a++) {
salt[a] = (byte)((byte)(random.nextDouble() * 255) ^ res.random[a]); salt[a] = (byte)((byte)(random.nextDouble() * 256) ^ res.random[a]);
} }
encryptedChat.a_or_b = salt; encryptedChat.a_or_b = salt;
BigInteger p = new BigInteger(1, MessagesStorage.secretPBytes); BigInteger p = new BigInteger(1, MessagesStorage.secretPBytes);
...@@ -5009,7 +5127,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ...@@ -5009,7 +5127,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} }
final byte[] salt = new byte[256]; final byte[] salt = new byte[256];
for (int a = 0; a < 256; a++) { for (int a = 0; a < 256; a++) {
salt[a] = (byte)((byte)(random.nextDouble() * 255) ^ res.random[a]); salt[a] = (byte)((byte)(random.nextDouble() * 256) ^ res.random[a]);
} }
BigInteger i_g_a = BigInteger.valueOf(MessagesStorage.secretG); BigInteger i_g_a = BigInteger.valueOf(MessagesStorage.secretG);
......
...@@ -58,6 +58,8 @@ public class RPCRequest { ...@@ -58,6 +58,8 @@ public class RPCRequest {
boolean confirmed; boolean confirmed;
boolean initRequest = false;
ArrayList<Long> respondsToMessageIds = new ArrayList<Long>(); ArrayList<Long> respondsToMessageIds = new ArrayList<Long>();
public void addRespondMessageId(long messageId) { public void addRespondMessageId(long messageId) {
......
...@@ -753,6 +753,18 @@ public class Utilities { ...@@ -753,6 +753,18 @@ public class Utilities {
return result; return result;
} }
public static String formatFileSize(long size) {
if (size < 1024) {
return String.format("%d B", size);
} else if (size < 1024 * 1024) {
return String.format("%.1f KB", size / 1024.0f);
} else if (size < 1024 * 1024 * 1024) {
return String.format("%.1f MB", size / 1024.0f / 1024.0f);
} else {
return String.format("%.1f GB", size / 1024.0f / 1024.0f / 1024.0f);
}
}
public static String stringForMessageListDate(long date) { public static String stringForMessageListDate(long date) {
Calendar rightNow = Calendar.getInstance(); Calendar rightNow = Calendar.getInstance();
int day = rightNow.get(Calendar.DAY_OF_YEAR); int day = rightNow.get(Calendar.DAY_OF_YEAR);
......
...@@ -10,6 +10,7 @@ package org.telegram.objects; ...@@ -10,6 +10,7 @@ package org.telegram.objects;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import org.telegram.TL.TLObject;
import org.telegram.TL.TLRPC; import org.telegram.TL.TLRPC;
import org.telegram.messenger.Emoji; import org.telegram.messenger.Emoji;
import org.telegram.messenger.MessagesController; import org.telegram.messenger.MessagesController;
...@@ -211,6 +212,10 @@ public class MessageObject { ...@@ -211,6 +212,10 @@ public class MessageObject {
messageText = ApplicationLoader.applicationContext.getString(R.string.AttachContact); messageText = ApplicationLoader.applicationContext.getString(R.string.AttachContact);
} else if (message.media instanceof TLRPC.TL_messageMediaUnsupported) { } else if (message.media instanceof TLRPC.TL_messageMediaUnsupported) {
messageText = ApplicationLoader.applicationContext.getString(R.string.UnsuppotedMedia); messageText = ApplicationLoader.applicationContext.getString(R.string.UnsuppotedMedia);
} else if (message.media instanceof TLRPC.TL_messageMediaDocument) {
messageText = ApplicationLoader.applicationContext.getString(R.string.AttachDocument);
} else if (message.media instanceof TLRPC.TL_messageMediaAudio) {
messageText = ApplicationLoader.applicationContext.getString(R.string.AttachAudio);
} }
} else { } else {
messageText = message.message; messageText = message.message;
...@@ -255,6 +260,12 @@ public class MessageObject { ...@@ -255,6 +260,12 @@ public class MessageObject {
} else { } else {
type = 1; type = 1;
} }
} else if (message.media != null && message.media instanceof TLRPC.TL_messageMediaDocument) {
if (message.from_id == UserConfig.clientUserId) {
type = 16;
} else {
type = 17;
}
} }
} else if (message instanceof TLRPC.TL_messageService) { } else if (message instanceof TLRPC.TL_messageService) {
if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto || message.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) { if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto || message.action instanceof TLRPC.TL_messageActionUserUpdatedPhoto) {
...@@ -277,4 +288,38 @@ public class MessageObject { ...@@ -277,4 +288,38 @@ public class MessageObject {
int dateMonth = rightNow.get(Calendar.MONTH); int dateMonth = rightNow.get(Calendar.MONTH);
dateKey = String.format("%d_%02d_%02d", dateYear, dateMonth, dateDay); dateKey = String.format("%d_%02d_%02d", dateYear, dateMonth, dateDay);
} }
public String getFileName() {
if (messageOwner.media instanceof TLRPC.TL_messageMediaVideo) {
return getAttachFileName(messageOwner.media.video);
} else if (messageOwner.media instanceof TLRPC.TL_messageMediaDocument) {
return getAttachFileName(messageOwner.media.document);
}
return "";
}
public static String getAttachFileName(TLObject attach) {
if (attach instanceof TLRPC.Video) {
TLRPC.Video video = (TLRPC.Video)attach;
return video.dc_id + "_" + video.id + ".mp4";
} else if (attach instanceof TLRPC.Document) {
TLRPC.Document document = (TLRPC.Document)attach;
String ext = document.file_name;
int idx = -1;
if (ext == null || (idx = ext.lastIndexOf(".")) == -1) {
ext = "";
} else {
ext = ext.substring(idx);
}
if (ext.length() > 1) {
return document.dc_id + "_" + document.id + ext;
} else {
return document.dc_id + "_" + document.id;
}
} else if (attach instanceof TLRPC.PhotoSize) {
TLRPC.PhotoSize photo = (TLRPC.PhotoSize)attach;
return photo.location.volume_id + "_" + photo.location.local_id + ".jpg";
}
return "";
}
} }
...@@ -317,12 +317,12 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati ...@@ -317,12 +317,12 @@ public class ApplicationActivity extends ActionBarActivity implements Notificati
} }
private void checkForCrashes() { private void checkForCrashes() {
CrashManager.register(this, "your-hockeyapp-api-key-here"); CrashManager.register(this, ConnectionsManager.HOCKEY_APP_HASH);
} }
private void checkForUpdates() { private void checkForUpdates() {
if (FileLog.DEBUG_VERSION) { if (ConnectionsManager.DEBUG_VERSION) {
UpdateManager.register(this, "your-hockeyapp-api-key-here"); UpdateManager.register(this, ConnectionsManager.HOCKEY_APP_HASH);
} }
} }
......
...@@ -150,7 +150,7 @@ public class ApplicationLoader extends Application { ...@@ -150,7 +150,7 @@ public class ApplicationLoader extends Application {
return ""; return "";
} }
int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE); int registeredVersion = prefs.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE);
int currentVersion = getAppVersion(context); int currentVersion = getAppVersion();
if (registeredVersion != currentVersion) { if (registeredVersion != currentVersion) {
FileLog.d("tmessages", "App version changed."); FileLog.d("tmessages", "App version changed.");
return ""; return "";
...@@ -162,9 +162,9 @@ public class ApplicationLoader extends Application { ...@@ -162,9 +162,9 @@ public class ApplicationLoader extends Application {
return getSharedPreferences(ApplicationLoader.class.getSimpleName(), Context.MODE_PRIVATE); return getSharedPreferences(ApplicationLoader.class.getSimpleName(), Context.MODE_PRIVATE);
} }
private static int getAppVersion(Context context) { public static int getAppVersion() {
try { try {
PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(), 0); PackageInfo packageInfo = applicationContext.getPackageManager().getPackageInfo(applicationContext.getPackageName(), 0);
return packageInfo.versionCode; return packageInfo.versionCode;
} catch (PackageManager.NameNotFoundException e) { } catch (PackageManager.NameNotFoundException e) {
throw new RuntimeException("Could not get package name: " + e); throw new RuntimeException("Could not get package name: " + e);
...@@ -223,7 +223,7 @@ public class ApplicationLoader extends Application { ...@@ -223,7 +223,7 @@ public class ApplicationLoader extends Application {
private void storeRegistrationId(Context context, String regId) { private void storeRegistrationId(Context context, String regId) {
final SharedPreferences prefs = getGCMPreferences(context); final SharedPreferences prefs = getGCMPreferences(context);
int appVersion = getAppVersion(context); int appVersion = getAppVersion();
FileLog.e("tmessages", "Saving regId on app version " + appVersion); FileLog.e("tmessages", "Saving regId on app version " + appVersion);
SharedPreferences.Editor editor = prefs.edit(); SharedPreferences.Editor editor = prefs.edit();
editor.putString(PROPERTY_REG_ID, regId); editor.putString(PROPERTY_REG_ID, regId);
......
...@@ -53,6 +53,7 @@ import android.view.ViewParent; ...@@ -53,6 +53,7 @@ import android.view.ViewParent;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.webkit.MimeTypeMap;
import android.widget.AbsListView; import android.widget.AbsListView;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
...@@ -95,7 +96,7 @@ import java.util.Comparator; ...@@ -95,7 +96,7 @@ import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate, NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate { public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLayout.SizeNotifierRelativeLayoutDelegate, NotificationCenter.NotificationCenterDelegate, MessagesActivity.MessagesActivityDelegate, DocumentSelectActivity.DocumentSelectActivityDelegate {
private LayoutListView chatListView; private LayoutListView chatListView;
private BackupImageView avatarImageView; private BackupImageView avatarImageView;
private TLRPC.Chat currentChat; private TLRPC.Chat currentChat;
...@@ -164,7 +165,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -164,7 +165,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
private MessageObject unreadMessageObject = null; private MessageObject unreadMessageObject = null;
//private boolean reloadAfterAnimation = false; //private boolean reloadAfterAnimation = false;
private int videoLocalId;
private String currentPicturePath; private String currentPicturePath;
private TLRPC.ChatParticipants info = null; private TLRPC.ChatParticipants info = null;
...@@ -421,9 +421,17 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -421,9 +421,17 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
v.setVisibility(View.VISIBLE); v.setVisibility(View.VISIBLE);
if (currentEncryptedChat.admin_id == UserConfig.clientUserId) { if (currentEncryptedChat.admin_id == UserConfig.clientUserId) {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleOutgoing), currentUser.first_name)); if (currentUser.first_name.length() > 0) {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleOutgoing), currentUser.first_name));
} else {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleOutgoing), currentUser.last_name));
}
} else { } else {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleIncoming), currentUser.first_name)); if (currentUser.first_name.length() > 0) {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleIncoming), currentUser.first_name));
} else {
secretViewStatusTextView.setText(String.format(getStringEntry(R.string.EncryptedPlaceholderTitleIncoming), currentUser.last_name));
}
} }
updateSecretStatus(); updateSecretStatus();
...@@ -1192,7 +1200,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -1192,7 +1200,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
TLRPC.TL_video video = new TLRPC.TL_video(); TLRPC.TL_video video = new TLRPC.TL_video();
video.thumb = size; video.thumb = size;
video.caption = ""; video.caption = "";
video.id = videoLocalId; video.id = 0;
video.path = videoPath; video.path = videoPath;
File temp = new File(videoPath); File temp = new File(videoPath);
if (temp != null && temp.exists()) { if (temp != null && temp.exists()) {
...@@ -2360,6 +2368,10 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2360,6 +2368,10 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} else if (selectedObject.type == 12 || selectedObject.type == 13) { } else if (selectedObject.type == 12 || selectedObject.type == 13) {
TLRPC.User user = MessagesController.Instance.users.get(selectedObject.messageOwner.media.user_id); TLRPC.User user = MessagesController.Instance.users.get(selectedObject.messageOwner.media.user_id);
MessagesController.Instance.sendMessage(user, dialog_id); MessagesController.Instance.sendMessage(user, dialog_id);
} else if (selectedObject.type == 16 || selectedObject.type == 17) {
TLRPC.TL_document document = (TLRPC.TL_document)selectedObject.messageOwner.media.document;
document.path = selectedObject.messageOwner.attachPath;
MessagesController.Instance.sendMessage(document, dialog_id);
} }
ArrayList<Integer> arr = new ArrayList<Integer>(); ArrayList<Integer> arr = new ArrayList<Integer>();
arr.add(selectedObject.messageOwner.id); arr.add(selectedObject.messageOwner.id);
...@@ -2404,6 +2416,33 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2404,6 +2416,33 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
} }
@Override
public void didSelectFile(DocumentSelectActivity activity, String path, String name, String ext, long size) {
activity.finishFragment();
TLRPC.TL_document document = new TLRPC.TL_document();
document.thumb = new TLRPC.TL_photoSizeEmpty();
document.thumb.type = "s";
document.id = 0;
document.user_id = UserConfig.clientUserId;
document.date = ConnectionsManager.Instance.getCurrentTime();
document.file_name = name;
document.size = (int)size;
document.dc_id = 0;
document.path = path;
if (ext.length() != 0) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
String mimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
if (mimeType != null) {
document.mime_type = mimeType;
} else {
document.mime_type = "application/octet-stream";
}
} else {
document.mime_type = "application/octet-stream";
}
MessagesController.Instance.sendMessage(document, dialog_id);
}
@Override @Override
public void didSelectDialog(MessagesActivity activity, long did) { public void didSelectDialog(MessagesActivity activity, long did) {
if (dialog_id != 0 && (forwaringMessage != null || !selectedMessagesIds.isEmpty())) { if (dialog_id != 0 && (forwaringMessage != null || !selectedMessagesIds.isEmpty())) {
...@@ -2537,6 +2576,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2537,6 +2576,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
((ApplicationActivity)parentActivity).presentFragment(fragment, "location", false); ((ApplicationActivity)parentActivity).presentFragment(fragment, "location", false);
break; break;
} }
case R.id.attach_document: {
DocumentSelectActivity fragment = new DocumentSelectActivity();
fragment.delegate = this;
((ApplicationActivity)parentActivity).presentFragment(fragment, "document", false);
break;
}
} }
return true; return true;
} }
...@@ -2656,6 +2701,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2656,6 +2701,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} else if (messageType == 13) { } else if (messageType == 13) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0);
} else if (messageType == 16) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states);
holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0);
} else if (messageType == 17) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0);
} }
} else { } else {
if (messageType == 2 || messageType == 4 || messageType == 6) { if (messageType == 2 || messageType == 4 || messageType == 6) {
...@@ -2698,6 +2749,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2698,6 +2749,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
} }
holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0);
} else if (messageType == 16) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out);
}
holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0);
} else if (messageType == 17) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
}
holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0);
} }
} }
} }
...@@ -2830,6 +2895,14 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2830,6 +2895,14 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
} else if (type == 15) { } else if (type == 15) {
view = li.inflate(R.layout.chat_unread_layout, viewGroup, false); view = li.inflate(R.layout.chat_unread_layout, viewGroup, false);
} else if (type == 16) {
view = li.inflate(R.layout.chat_outgoing_document_layout, viewGroup, false);
} else if (type == 17) {
if (currentChat != null) {
view = li.inflate(R.layout.chat_group_incoming_document_layout, viewGroup, false);
} else {
view = li.inflate(R.layout.chat_incoming_document_layout, viewGroup, false);
}
} }
} }
...@@ -2871,6 +2944,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2871,6 +2944,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} else if (messageType == 13) { } else if (messageType == 13) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states); holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0);
} else if (messageType == 16) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_outgoing_text_states);
holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0);
} else if (messageType == 17) {
holder.chatBubbleView.setBackgroundResource(R.drawable.chat_incoming_text_states);
holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0);
} }
} else { } else {
if (messageType == 2 || messageType == 4 || messageType == 6) { if (messageType == 2 || messageType == 4 || messageType == 6) {
...@@ -2913,6 +2992,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2913,6 +2992,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in); holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
} }
holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0); holder.chatBubbleView.setPadding((int)(15 * displayDensity), (int)(6 * displayDensity), (int)(9 * displayDensity), 0);
} else if (messageType == 16) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_out);
}
holder.chatBubbleView.setPadding((int)(9 * displayDensity), (int)(9 * displayDensity), (int)(18 * displayDensity), 0);
} else if (messageType == 17) {
if (selected) {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in_selected);
} else {
holder.chatBubbleView.setBackgroundResource(R.drawable.msg_in);
}
holder.chatBubbleView.setPadding((int)(18 * displayDensity), (int)(9 * displayDensity), (int)(9 * displayDensity), 0);
} }
} }
...@@ -2939,7 +3032,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -2939,7 +3032,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
@Override @Override
public int getViewTypeCount() { public int getViewTypeCount() {
return 16; return 18;
} }
@Override @Override
...@@ -3014,7 +3107,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3014,7 +3107,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
avatarImageView.setImage(photo, "50_50", placeHolderId); avatarImageView.setImage(photo, "50_50", placeHolderId);
} }
if (type != 12 && type != 13 && nameTextView != null && fromUser != null) { if (type != 12 && type != 13 && nameTextView != null && fromUser != null && type != 16 && type != 17) {
nameTextView.setText(Utilities.formatName(fromUser.first_name, fromUser.last_name)); nameTextView.setText(Utilities.formatName(fromUser.first_name, fromUser.last_name));
nameTextView.setTextColor(Utilities.getColorForId(message.messageOwner.from_id)); nameTextView.setTextColor(Utilities.getColorForId(message.messageOwner.from_id));
} }
...@@ -3026,7 +3119,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3026,7 +3119,6 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
} else if (type == 2 || type == 3 || type == 6 || type == 7) { } else if (type == 2 || type == 3 || type == 6 || type == 7) {
int width = (int)(Math.min(displaySize.x, displaySize.y) / 2.5f); int width = (int)(Math.min(displaySize.x, displaySize.y) / 2.5f);
/*PhotoObject photo = PhotoObject.getClosestImageWithSize(message.photoThumbs, width, width + 100);*/
PhotoObject photo = PhotoObject.getClosestImageWithSize(message.photoThumbs, width, width + 100); PhotoObject photo = PhotoObject.getClosestImageWithSize(message.photoThumbs, width, width + 100);
if (photo != null) { if (photo != null) {
...@@ -3141,6 +3233,48 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3141,6 +3233,48 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} else { } else {
messageTextView.setText(String.format(getStringEntry(R.string.FewNewMessages), unread_to_load)); messageTextView.setText(String.format(getStringEntry(R.string.FewNewMessages), unread_to_load));
} }
} else if (type == 16 || type == 17) {
TLRPC.Document document = message.messageOwner.media.document;
if (document instanceof TLRPC.TL_document || document instanceof TLRPC.TL_documentEncrypted) {
nameTextView.setText(message.messageOwner.media.document.file_name);
String fileName = message.getFileName();
int idx = fileName.lastIndexOf(".");
String ext = null;
if (idx != -1) {
ext = fileName.substring(idx + 1);
}
if (ext == null || ext.length() == 0) {
ext = message.messageOwner.media.document.mime_type;
}
ext = ext.toUpperCase();
if (document.size < 1024) {
phoneTextView.setText(String.format("%d B %s", document.size, ext));
} else if (document.size < 1024 * 1024) {
phoneTextView.setText(String.format("%.1f KB %s", document.size / 1024.0f, ext));
} else {
phoneTextView.setText(String.format("%.1f MB %s", document.size / 1024.0f / 1024.0f, ext));
}
if (document.thumb instanceof TLRPC.TL_photoSize) {
} else if (document.thumb instanceof TLRPC.TL_photoCachedSize) {
} else {
if (type == 16) {
contactAvatar.setImageResource(R.drawable.doc_green);
} else {
contactAvatar.setImageResource(R.drawable.doc_blue);
}
}
} else {
nameTextView.setText("Error");
phoneTextView.setText("Error");
if (type == 16) {
contactAvatar.setImageResource(R.drawable.doc_green);
} else {
contactAvatar.setImageResource(R.drawable.doc_blue);
}
}
} }
if (message.messageOwner.id < 0 && message.messageOwner.send_state != MessagesController.MESSAGE_SEND_STATE_SENT) { if (message.messageOwner.id < 0 && message.messageOwner.send_state != MessagesController.MESSAGE_SEND_STATE_SENT) {
...@@ -3212,7 +3346,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3212,7 +3346,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
} }
} }
if (message.type == 6 || message.type == 7) { if (message.type == 6 || message.type == 7 || message.type == 16 || message.type == 17) {
Integer tag = (Integer)actionProgress.getTag(); Integer tag = (Integer)actionProgress.getTag();
String file = progressByTag.get(tag); String file = progressByTag.get(tag);
if (file != null) { if (file != null) {
...@@ -3222,14 +3356,18 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3222,14 +3356,18 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (file != null) { if (file != null) {
progressBarMap.remove(file); progressBarMap.remove(file);
} }
String fileName = message.messageOwner.media.video.dc_id + "_" + message.messageOwner.media.video.id + ".mp4"; String fileName = message.getFileName();
boolean load = false; boolean load = false;
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) { if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
File f = new File(message.messageOwner.attachPath); File f = new File(message.messageOwner.attachPath);
if (f.exists()) { if (f.exists()) {
actionAttachButton.setVisibility(View.VISIBLE); actionAttachButton.setVisibility(View.VISIBLE);
actionView.setVisibility(View.GONE); actionView.setVisibility(View.GONE);
actionAttachButton.setText(getStringEntry(R.string.ViewVideo)); if (message.type == 6 || message.type == 7) {
actionAttachButton.setText(getStringEntry(R.string.ViewVideo));
} else if (message.type == 16 || message.type == 17) {
actionAttachButton.setText(getStringEntry(R.string.Open));
}
} else { } else {
load = true; load = true;
} }
...@@ -3238,7 +3376,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3238,7 +3376,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (cacheFile.exists()) { if (cacheFile.exists()) {
actionAttachButton.setVisibility(View.VISIBLE); actionAttachButton.setVisibility(View.VISIBLE);
actionView.setVisibility(View.GONE); actionView.setVisibility(View.GONE);
actionAttachButton.setText(getStringEntry(R.string.ViewVideo)); if (message.type == 6 || message.type == 7) {
actionAttachButton.setText(getStringEntry(R.string.ViewVideo));
} else if (message.type == 16 || message.type == 17) {
actionAttachButton.setText(getStringEntry(R.string.Open));
}
} else { } else {
load = true; load = true;
} }
...@@ -3258,11 +3400,33 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3258,11 +3400,33 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} else { } else {
actionView.setVisibility(View.GONE); actionView.setVisibility(View.GONE);
actionAttachButton.setVisibility(View.VISIBLE); actionAttachButton.setVisibility(View.VISIBLE);
actionAttachButton.setText(String.format("%s %.1f MB", getStringEntry(R.string.DOWNLOAD), message.messageOwner.media.video.size / 1024.0f / 1024.0f)); if (message.type == 6 || message.type == 7) {
actionAttachButton.setText(String.format("%s %.1f MB", getStringEntry(R.string.DOWNLOAD), message.messageOwner.media.video.size / 1024.0f / 1024.0f));
} else if (message.type == 16 || message.type == 17) {
actionAttachButton.setText(getStringEntry(R.string.DOWNLOAD));
}
} }
} }
} }
} }
if (message.type == 16 || message.type == 17) {
int width;
if (currentChat != null && type != 16) {
if (actionView.getVisibility() == View.VISIBLE) {
width = displaySize.x - (int)(290 * displayDensity);
} else {
width = displaySize.x - (int)(270 * displayDensity);
}
} else {
if (actionView.getVisibility() == View.VISIBLE) {
width = displaySize.x - (int)(240 * displayDensity);
} else {
width = displaySize.x - (int)(220 * displayDensity);
}
}
nameTextView.setMaxWidth(width);
phoneTextView.setMaxWidth(width);
}
} }
public ChatListRowHolderEx(View view) { public ChatListRowHolderEx(View view) {
...@@ -3343,16 +3507,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3343,16 +3507,20 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
contactView.setOnClickListener(new View.OnClickListener() { contactView.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (mActionMode != null) { if (message.type == 16 || message.type == 17) {
processRowSelect(view); processOnClick(view);
return; } else if (message.type == 12 || message.type == 13) {
} if (mActionMode != null) {
if (message.messageOwner.media.user_id != UserConfig.clientUserId) { processRowSelect(view);
UserProfileActivity fragment = new UserProfileActivity(); return;
Bundle args = new Bundle(); }
args.putInt("user_id", message.messageOwner.media.user_id); if (message.messageOwner.media.user_id != UserConfig.clientUserId) {
fragment.setArguments(args); UserProfileActivity fragment = new UserProfileActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.user_id, false); Bundle args = new Bundle();
args.putInt("user_id", message.messageOwner.media.user_id);
fragment.setArguments(args);
((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + message.messageOwner.media.user_id, false);
}
} }
} }
}); });
...@@ -3370,83 +3538,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3370,83 +3538,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
actionAttachButton.setOnClickListener(new View.OnClickListener() { actionAttachButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (mActionMode != null) { processOnClick(view);
processRowSelect(view);
return;
}
if (message != null) {
if (message.type == 4 || message.type == 5) {
if (!isGoogleMapsInstalled()) {
return;
}
NotificationCenter.Instance.addToMemCache(0, message);
LocationActivity fragment = new LocationActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "location_view", false);
} else if (message.type == 2 || message.type == 3) {
NotificationCenter.Instance.addToMemCache(51, message);
Intent intent = new Intent(parentActivity, GalleryImageViewer.class);
startActivity(intent);
} else if (message.type == 6 || message.type == 7) {
boolean loadFile = false;
String fileName = message.messageOwner.media.video.dc_id + "_" + message.messageOwner.media.video.id + ".mp4";
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
File f = new File(message.messageOwner.attachPath);
if (f.exists()) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(f), "video/mp4");
startActivity(intent);
} catch (Exception e) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(R.string.AppName);
builder.setMessage(R.string.NoPlayerInstalled);
visibleDialog = builder.show();
visibleDialog.setCanceledOnTouchOutside(true);
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
visibleDialog = null;
}
});
}
} else {
loadFile = true;
}
} else {
File cacheFile = new File(Utilities.getCacheDir(), fileName);
if (cacheFile.exists()) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(cacheFile), "video/mp4");
startActivity(intent);
} catch (Exception e) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(R.string.AppName);
builder.setMessage(R.string.NoPlayerInstalled);
visibleDialog = builder.show();
visibleDialog.setCanceledOnTouchOutside(true);
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
visibleDialog = null;
}
});
}
} else {
loadFile = true;
}
}
if (loadFile) {
if (!loadingFile.containsKey(fileName)) {
progressByTag.put((Integer)actionProgress.getTag(), fileName);
addToLoadingFile(fileName, actionProgress);
FileLoader.Instance.loadFile(message.messageOwner.media.video, null);
updateVisibleRows();
}
}
}
}
} }
}); });
} }
...@@ -3482,11 +3574,15 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3482,11 +3574,15 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (file != null) { if (file != null) {
progressBarMap.remove(file); progressBarMap.remove(file);
} }
} else if (message.type == 6 || message.type == 7) { } else if (message.type == 6 || message.type == 7 || message.type == 16 || message.type == 17) {
String file = progressByTag.get(tag); String file = progressByTag.get(tag);
if (file != null) { if (file != null) {
loadingFile.remove(file); loadingFile.remove(file);
FileLoader.Instance.cancelLoadFile(message.messageOwner.media.video, null); if (message.type == 6 || message.type == 7) {
FileLoader.Instance.cancelLoadFile(message.messageOwner.media.video, null, null);
} else if (message.type == 16 || message.type == 17) {
FileLoader.Instance.cancelLoadFile(null, null, message.messageOwner.media.document);
}
updateVisibleRows(); updateVisibleRows();
} }
} }
...@@ -3499,88 +3595,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3499,88 +3595,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
photoImage.setOnClickListener(new View.OnClickListener() { photoImage.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
if (mActionMode != null) { processOnClick(view);
processRowSelect(view);
return;
}
if (message != null) {
if (message.type == 4 || message.type == 5) {
if (!isGoogleMapsInstalled()) {
return;
}
NotificationCenter.Instance.addToMemCache(0, message);
LocationActivity fragment = new LocationActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "location_view", false);
} else if (message.type == 2 || message.type == 3) {
NotificationCenter.Instance.addToMemCache(51, message);
Intent intent = new Intent(parentActivity, GalleryImageViewer.class);
startActivity(intent);
} else if (message.type == 11) {
NotificationCenter.Instance.addToMemCache(51, message);
Intent intent = new Intent(parentActivity, GalleryImageViewer.class);
startActivity(intent);
} else if (message.type == 6 || message.type == 7) {
boolean loadFile = false;
String fileName = message.messageOwner.media.video.dc_id + "_" + message.messageOwner.media.video.id + ".mp4";
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
File f = new File(message.messageOwner.attachPath);
if (f.exists()) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(f), "video/mp4");
startActivity(intent);
} catch (Exception e) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(R.string.AppName);
builder.setMessage(R.string.NoPlayerInstalled);
visibleDialog = builder.show();
visibleDialog.setCanceledOnTouchOutside(true);
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
visibleDialog = null;
}
});
}
} else {
loadFile = true;
}
} else {
File cacheFile = new File(Utilities.getCacheDir(), fileName);
if (cacheFile.exists()) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(cacheFile), "video/*");
startActivity(intent);
} catch (Exception e) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(R.string.AppName);
builder.setMessage(R.string.NoPlayerInstalled);
visibleDialog = builder.show();
visibleDialog.setCanceledOnTouchOutside(true);
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
visibleDialog = null;
}
});
}
} else {
loadFile = true;
}
}
if (loadFile) {
if (!loadingFile.containsKey(fileName)) {
progressByTag.put((Integer)actionProgress.getTag(), fileName);
addToLoadingFile(fileName, actionProgress);
FileLoader.Instance.loadFile(message.messageOwner.media.video, null);
updateVisibleRows();
}
}
}
}
} }
}); });
...@@ -3609,5 +3624,96 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ...@@ -3609,5 +3624,96 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
}); });
} }
} }
private void processOnClick(View view) {
if (mActionMode != null) {
processRowSelect(view);
return;
}
if (message != null) {
if (message.type == 4 || message.type == 5) {
if (!isGoogleMapsInstalled()) {
return;
}
NotificationCenter.Instance.addToMemCache(0, message);
LocationActivity fragment = new LocationActivity();
((ApplicationActivity)parentActivity).presentFragment(fragment, "location_view", false);
} else if (message.type == 2 || message.type == 3) {
NotificationCenter.Instance.addToMemCache(51, message);
Intent intent = new Intent(parentActivity, GalleryImageViewer.class);
startActivity(intent);
} else if (message.type == 11) {
NotificationCenter.Instance.addToMemCache(51, message);
Intent intent = new Intent(parentActivity, GalleryImageViewer.class);
startActivity(intent);
} else if (message.type == 6 || message.type == 7 || message.type == 16 || message.type == 17) {
File f = null;
String fileName = message.getFileName();
if (message.messageOwner.attachPath != null && message.messageOwner.attachPath.length() != 0) {
f = new File(message.messageOwner.attachPath);
} else {
f = new File(Utilities.getCacheDir(), fileName);
}
if (f != null && f.exists()) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
if (message.type == 6 || message.type == 7) {
intent.setDataAndType(Uri.fromFile(f), "video/mp4");
} else if (message.type == 16 || message.type == 17) {
MimeTypeMap myMime = MimeTypeMap.getSingleton();
int idx = fileName.lastIndexOf(".");
if (idx != -1) {
String ext = fileName.substring(idx + 1);
String mimeType = myMime.getMimeTypeFromExtension(ext.toLowerCase());
if (mimeType != null) {
intent.setDataAndType(Uri.fromFile(f), mimeType);
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
} else {
intent.setDataAndType(Uri.fromFile(f), "text/plain");
}
}
startActivity(intent);
} catch (Exception e) {
AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity);
builder.setTitle(R.string.AppName);
builder.setPositiveButton(R.string.OK, null);
if (message.type == 6 || message.type == 7) {
builder.setMessage(R.string.NoPlayerInstalled);
} else {
builder.setMessage(String.format(getStringEntry(R.string.NoHandleAppInstalled), message.messageOwner.media.document.mime_type));
}
visibleDialog = builder.show();
visibleDialog.setCanceledOnTouchOutside(true);
visibleDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
visibleDialog = null;
}
});
}
} else {
if (message.messageOwner.send_state != MessagesController.MESSAGE_SEND_STATE_SEND_ERROR && message.messageOwner.send_state != MessagesController.MESSAGE_SEND_STATE_SENDING || !message.messageOwner.out) {
if (!loadingFile.containsKey(fileName)) {
progressByTag.put((Integer)actionProgress.getTag(), fileName);
addToLoadingFile(fileName, actionProgress);
if (message.type == 6 || message.type == 7) {
FileLoader.Instance.loadFile(message.messageOwner.media.video, null, null);
} else if (message.type == 16 || message.type == 17) {
FileLoader.Instance.loadFile(null, null, message.messageOwner.media.document);
}
updateVisibleRows();
}
} else {
if (message.messageOwner.send_state == MessagesController.MESSAGE_SEND_STATE_SEND_ERROR) {
createMenu(view, false);
}
}
}
}
}
}
} }
} }
/*
* This is the source code of Telegram for Android v. 1.3.2.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013.
*/
package org.telegram.ui;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.os.StatFs;
import android.support.v7.app.ActionBar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.R;
import org.telegram.messenger.Utilities;
import org.telegram.ui.Views.BackupImageView;
import org.telegram.ui.Views.BaseFragment;
import org.telegram.ui.Views.OnSwipeTouchListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
public class DocumentSelectActivity extends BaseFragment {
public static abstract interface DocumentSelectActivityDelegate {
public void didSelectFile(DocumentSelectActivity activity, String path, String name, String ext, long size);
}
private ListView listView;
private ListAdapter listAdapter;
private File currentDir;
private TextView emptyView;
private ArrayList<ListItem> items = new ArrayList<ListItem>();
private boolean receiverRegistered = false;
private ArrayList<HistoryEntry> history = new ArrayList<HistoryEntry>();
private long sizeLimit = 1024 * 1024 * 1024;
public DocumentSelectActivityDelegate delegate;
private class ListItem {
int icon;
String title;
String subtitle = "";
String ext = "";
String thumb;
File file;
}
private class HistoryEntry {
int scrollItem, scrollOffset;
File dir;
String title;
}
private BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context arg0, Intent intent) {
Runnable r = new Runnable() {
public void run() {
if (currentDir == null){
listRoots();
} else {
listFiles(currentDir);
}
}
};
if (Intent.ACTION_MEDIA_UNMOUNTED.equals(intent.getAction())) {
listView.postDelayed(r, 1000);
} else {
r.run();
}
}
};
@Override
public boolean onFragmentCreate() {
super.onFragmentCreate();
return true;
}
@Override
public void onFragmentDestroy() {
if (receiverRegistered) {
parentActivity.unregisterReceiver(receiver);
}
super.onFragmentDestroy();
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setHasOptionsMenu(true);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (!receiverRegistered) {
receiverRegistered = true;
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL);
filter.addAction(Intent.ACTION_MEDIA_CHECKING);
filter.addAction(Intent.ACTION_MEDIA_EJECT);
filter.addAction(Intent.ACTION_MEDIA_MOUNTED);
filter.addAction(Intent.ACTION_MEDIA_NOFS);
filter.addAction(Intent.ACTION_MEDIA_REMOVED);
filter.addAction(Intent.ACTION_MEDIA_SHARED);
filter.addAction(Intent.ACTION_MEDIA_UNMOUNTABLE);
filter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
filter.addDataScheme("file");
parentActivity.registerReceiver(receiver, filter);
}
if (fragmentView == null) {
fragmentView = inflater.inflate(R.layout.document_select_layout, container, false);
listAdapter = new ListAdapter(parentActivity);
emptyView = (TextView)fragmentView.findViewById(R.id.searchEmptyView);
listView = (ListView)fragmentView.findViewById(R.id.listView);
listView.setEmptyView(emptyView);
listView.setAdapter(listAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
ListItem item = items.get(i);
File file = item.file;
if (file.isDirectory()) {
HistoryEntry he = new HistoryEntry();
he.scrollItem = listView.getFirstVisiblePosition();
he.scrollOffset = listView.getChildAt(0).getTop();
he.dir = currentDir;
ActionBar actionBar = parentActivity.getSupportActionBar();
he.title = actionBar.getTitle().toString();
if (!listFiles(file)){
return;
}
history.add(he);
actionBar.setTitle(item.title);
listView.setSelection(0);
} else {
if (!file.canRead()) {
showErrorBox(getString(R.string.AccessError));
return;
}
if (sizeLimit != 0) {
if (file.length() > sizeLimit) {
showErrorBox(getString(R.string.FileUploadLimit, Utilities.formatFileSize(sizeLimit)));
return;
}
}
if (file.length() == 0) {
return;
}
if (delegate != null) {
delegate.didSelectFile(DocumentSelectActivity.this, file.getAbsolutePath(), item.title, item.ext, file.length());
}
}
}
});
listView.setOnTouchListener(new OnSwipeTouchListener() {
public void onSwipeRight() {
finishFragment(true);
}
});
listRoots();
} else {
ViewGroup parent = (ViewGroup)fragmentView.getParent();
if (parent != null) {
parent.removeView(fragmentView);
}
}
return fragmentView;
}
@Override
public void applySelfActionBar() {
if (parentActivity == null) {
return;
}
ActionBar actionBar = parentActivity.getSupportActionBar();
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setDisplayShowCustomEnabled(false);
actionBar.setSubtitle(null);
actionBar.setCustomView(null);
actionBar.setTitle(getStringEntry(R.string.SelectFile));
TextView title = (TextView)parentActivity.findViewById(R.id.action_bar_title);
if (title == null) {
final int subtitleId = parentActivity.getResources().getIdentifier("action_bar_title", "id", "android");
title = (TextView)parentActivity.findViewById(subtitleId);
}
if (title != null) {
title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
title.setCompoundDrawablePadding(0);
}
}
@Override
public void onResume() {
super.onResume();
if (isFinish) {
return;
}
if (getActivity() == null) {
return;
}
if (!firstStart && listAdapter != null) {
listAdapter.notifyDataSetChanged();
}
firstStart = false;
((ApplicationActivity)parentActivity).showActionBar();
((ApplicationActivity)parentActivity).updateActionBar();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int itemId = item.getItemId();
switch (itemId) {
case android.R.id.home:
finishFragment();
break;
}
return true;
}
@Override
public boolean onBackPressed() {
if (history.size() > 0){
HistoryEntry he = history.remove(history.size() - 1);
ActionBar actionBar = parentActivity.getSupportActionBar();
actionBar.setTitle(he.title);
if (he.dir != null) {
listFiles(he.dir);
} else {
listRoots();
}
listView.setSelectionFromTop(he.scrollItem, he.scrollOffset);
return false;
}
return super.onBackPressed();
}
private boolean listFiles(File dir) {
if (!dir.canRead()) {
if (dir.getAbsolutePath().startsWith(Environment.getExternalStorageDirectory().toString())
|| dir.getAbsolutePath().startsWith("/sdcard")
|| dir.getAbsolutePath().startsWith("/mnt/sdcard")) {
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)
&& !Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED_READ_ONLY)) {
currentDir = dir;
items.clear();
String state = Environment.getExternalStorageState();
if (Environment.MEDIA_SHARED.equals(state)){
emptyView.setText(R.string.UsbActive);
} else {
emptyView.setText(R.string.NotMounted);
}
listAdapter.notifyDataSetChanged();
return true;
}
}
showErrorBox(getString(R.string.AccessError));
return false;
}
emptyView.setText(R.string.NoFiles);
File[] files = null;
try {
files = dir.listFiles();
} catch(Exception e) {
showErrorBox(e.getLocalizedMessage());
return false;
}
if (files == null) {
showErrorBox(getString(R.string.UnknownError));
return false;
}
currentDir = dir;
items.clear();
Arrays.sort(files, new Comparator<File>() {
@Override
public int compare(File lhs, File rhs) {
if (lhs.isDirectory() != rhs.isDirectory()) {
return lhs.isDirectory() ? -1 : 1;
}
return lhs.getName().compareToIgnoreCase(rhs.getName());
}
});
for (File file : files) {
if (file.getName().startsWith(".")) {
continue;
}
ListItem item = new ListItem();
item.title = file.getName();
item.file = file;
if (file.isDirectory()) {
item.icon = R.drawable.ic_directory;
} else {
String fname = file.getName();
String[] sp = fname.split("\\.");
item.ext = sp.length > 1 ? sp[sp.length - 1] : "?";
item.subtitle = Utilities.formatFileSize(file.length());
fname = fname.toLowerCase();
if (fname.endsWith(".jpg") || fname.endsWith(".png") || fname.endsWith(".gif") || fname.endsWith(".jpeg")) {
item.thumb = file.getAbsolutePath();
}
}
items.add(item);
}
listAdapter.notifyDataSetChanged();
return true;
}
private void showErrorBox(String error){
new AlertDialog.Builder(parentActivity)
.setTitle(R.string.AppName)
.setMessage(error)
.setPositiveButton(R.string.OK, null)
.show();
}
private void listRoots() {
currentDir = null;
items.clear();
String extStorage = Environment.getExternalStorageDirectory().getAbsolutePath();
ListItem ext = new ListItem();
ext.title = getString(Build.VERSION.SDK_INT < 9 || Environment.isExternalStorageRemovable() ? R.string.SdCard : R.string.InternalStorage);
ext.icon = Build.VERSION.SDK_INT < 9 || Environment.isExternalStorageRemovable() ? R.drawable.ic_external_storage : R.drawable.ic_storage;
ext.subtitle = getRootSubtitle(extStorage);
ext.file = Environment.getExternalStorageDirectory();
items.add(ext);
try {
BufferedReader reader = new BufferedReader(new FileReader("/proc/mounts"));
String line;
HashMap<String, ArrayList<String>> aliases = new HashMap<String, ArrayList<String>>();
ArrayList<String> result = new ArrayList<String>();
String extDevice = null;
while ((line = reader.readLine()) != null) {
if ((!line.contains("/mnt") && !line.contains("/storage") && !line.contains("/sdcard")) || line.contains("asec") || line.contains("tmpfs") || line.contains("none")) {
continue;
}
String[] info = line.split(" ");
if (!aliases.containsKey(info[0])) {
aliases.put(info[0], new ArrayList<String>());
}
aliases.get(info[0]).add(info[1]);
if (info[1].equals(extStorage)) {
extDevice=info[0];
}
result.add(info[1]);
}
reader.close();
if (extDevice != null) {
result.removeAll(aliases.get(extDevice));
for (String path : result) {
boolean isSd = path.toLowerCase().contains("sd");
ListItem item = new ListItem();
item.title = getString(isSd ? R.string.SdCard : R.string.ExternalStorage);
item.icon = R.drawable.ic_external_storage;
item.subtitle = getRootSubtitle(path);
item.file = new File(path);
items.add(item);
}
}
} catch (Exception e) {
FileLog.e("tmessages", e);
}
ListItem fs = new ListItem();
fs.title = "/";
fs.subtitle = getString(R.string.SystemRoot);
fs.icon = R.drawable.ic_directory;
fs.file = new File("/");
items.add(fs);
listAdapter.notifyDataSetChanged();
}
private String getRootSubtitle(String path){
StatFs stat = new StatFs(path);
long total = (long)stat.getBlockCount() * (long)stat.getBlockSize();
long free = (long)stat.getAvailableBlocks() * (long)stat.getBlockSize();
if (total == 0) {
return "";
}
return getString(R.string.FreeOfTotal, Utilities.formatFileSize(free), Utilities.formatFileSize(total));
}
private class ListAdapter extends BaseAdapter {
private Context mContext;
public ListAdapter(Context context) {
mContext = context;
}
@Override
public int getCount() {
return items.size();
}
@Override
public Object getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int position) {
return 0;
}
public int getViewTypeCount(){
return 2;
}
public int getItemViewType(int pos){
return items.get(pos).subtitle.length() > 0 ? 0 : 1;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
ListItem item = items.get(position);
if (v == null) {
v = View.inflate(mContext, R.layout.document_item, null);
if (item.subtitle.length() == 0) {
v.findViewById(R.id.docs_item_info).setVisibility(View.GONE);
}
}
TextView typeTextView = (TextView)v.findViewById(R.id.docs_item_type);
((TextView)v.findViewById(R.id.docs_item_title)).setText(item.title);
((TextView)v.findViewById(R.id.docs_item_info)).setText(item.subtitle);
BackupImageView imageView = (BackupImageView)v.findViewById(R.id.docs_item_thumb);
if (item.thumb != null) {
imageView.setImageBitmap(null);
typeTextView.setText(item.ext.toUpperCase().substring(0, Math.min(item.ext.length(), 4)));
imageView.setImage(item.thumb, "55_42", 0);
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
imageView.setVisibility(View.VISIBLE);
typeTextView.setVisibility(View.VISIBLE);
} else if (item.icon != 0) {
imageView.setImageResource(item.icon);
imageView.setScaleType(ImageView.ScaleType.CENTER);
imageView.setVisibility(View.VISIBLE);
typeTextView.setVisibility(View.GONE);
} else {
typeTextView.setText(item.ext.toUpperCase().substring(0, Math.min(item.ext.length(), 4)));
imageView.setVisibility(View.GONE);
typeTextView.setVisibility(View.VISIBLE);
}
return v;
}
}
}
...@@ -924,9 +924,9 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif ...@@ -924,9 +924,9 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif
} }
if (loadFile) { if (loadFile) {
if (!FileLoader.Instance.isLoadingFile(fileName)) { if (!FileLoader.Instance.isLoadingFile(fileName)) {
FileLoader.Instance.loadFile(message.messageOwner.media.video, null); FileLoader.Instance.loadFile(message.messageOwner.media.video, null, null);
} else { } else {
FileLoader.Instance.cancelLoadFile(message.messageOwner.media.video, null); FileLoader.Instance.cancelLoadFile(message.messageOwner.media.video, null, null);
} }
checkCurrentFile(); checkCurrentFile();
processViews(playButton, message); processViews(playButton, message);
......
...@@ -292,8 +292,6 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI ...@@ -292,8 +292,6 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
updatePhoneField(); updatePhoneField();
} }
@Override @Override
public void onNothingSelected(AdapterView<?> adapterView) { public void onNothingSelected(AdapterView<?> adapterView) {
...@@ -303,8 +301,8 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI ...@@ -303,8 +301,8 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
public void onNextPressed() { public void onNextPressed() {
TLRPC.TL_auth_sendCode req = new TLRPC.TL_auth_sendCode(); TLRPC.TL_auth_sendCode req = new TLRPC.TL_auth_sendCode();
String phone = PhoneFormat.stripExceptNumbers("" + codeField.getText() + phoneField.getText()); String phone = PhoneFormat.stripExceptNumbers("" + codeField.getText() + phoneField.getText());
req.api_hash = "5bce48dc7d331e62c955669eb7233217"; req.api_hash = ConnectionsManager.APP_HASH;
req.api_id = 2458; req.api_id = ConnectionsManager.APP_ID;
req.sms_type = 0; req.sms_type = 0;
req.phone_number = phone; req.phone_number = phone;
req.lang_code = Locale.getDefault().getCountry(); req.lang_code = Locale.getDefault().getCountry();
......
...@@ -382,7 +382,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No ...@@ -382,7 +382,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No
BackupImageView imageView = (BackupImageView)view.findViewById(R.id.media_photo_image); BackupImageView imageView = (BackupImageView)view.findViewById(R.id.media_photo_image);
if (message.messageOwner.media.photo != null && !message.messageOwner.media.photo.sizes.isEmpty()) { if (message.messageOwner.media != null && message.messageOwner.media.photo != null && !message.messageOwner.media.photo.sizes.isEmpty()) {
ArrayList<TLRPC.PhotoSize> sizes = message.messageOwner.media.photo.sizes; ArrayList<TLRPC.PhotoSize> sizes = message.messageOwner.media.photo.sizes;
boolean set = false; boolean set = false;
// for (TLRPC.PhotoSize size : sizes) { // for (TLRPC.PhotoSize size : sizes) {
......
...@@ -102,7 +102,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter ...@@ -102,7 +102,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
blockedRow = rowCount++; blockedRow = rowCount++;
backgroundRow = rowCount++; backgroundRow = rowCount++;
supportSectionRow = rowCount++; supportSectionRow = rowCount++;
if (FileLog.DEBUG_VERSION) { if (ConnectionsManager.DEBUG_VERSION) {
sendLogsRow = rowCount++; sendLogsRow = rowCount++;
} }
askQuestionRow = rowCount++; askQuestionRow = rowCount++;
......
...@@ -248,11 +248,11 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica ...@@ -248,11 +248,11 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
progressBar.setVisibility(View.VISIBLE); progressBar.setVisibility(View.VISIBLE);
loadingSize = size; loadingSize = size;
selectedColor = 0; selectedColor = 0;
FileLoader.Instance.loadFile(null, size); FileLoader.Instance.loadFile(null, size, null);
backgroundImage.setBackgroundColor(0); backgroundImage.setBackgroundColor(0);
} else { } else {
if (loadingFile != null) { if (loadingFile != null) {
FileLoader.Instance.cancelLoadFile(null, loadingSize); FileLoader.Instance.cancelLoadFile(null, loadingSize, null);
} }
loadingFileObject = null; loadingFileObject = null;
loadingFile = null; loadingFile = null;
...@@ -265,7 +265,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica ...@@ -265,7 +265,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica
} }
} else { } else {
if (loadingFile != null) { if (loadingFile != null) {
FileLoader.Instance.cancelLoadFile(null, loadingSize); FileLoader.Instance.cancelLoadFile(null, loadingSize, null);
} }
if (selectedBackground == 1000001) { if (selectedBackground == 1000001) {
backgroundImage.setImageResource(R.drawable.background_hd); backgroundImage.setImageResource(R.drawable.background_hd);
......
...@@ -150,6 +150,7 @@ public class FrameLayoutFixed extends FrameLayout { ...@@ -150,6 +150,7 @@ public class FrameLayoutFixed extends FrameLayout {
} }
} catch (Exception e) { } catch (Exception e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
} }
} }
} }
/*
* This is the source code of Telegram for Android v. 1.3.2.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013.
*/
package org.telegram.ui.Views;
import android.annotation.SuppressLint;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.view.TextureView;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.ViewGroup;
import com.google.android.gms.maps.SupportMapFragment;
public class NiceSupportMapFragment extends SupportMapFragment {
private View drawingView;
private boolean hasTextureViewSupport = false;
private boolean preventParentScrolling = true;
private boolean textureViewSupport() {
boolean exist = true;
try {
Class.forName("android.view.TextureView");
} catch (ClassNotFoundException e) {
exist = false;
}
return exist;
}
private View searchAndFindDrawingView(ViewGroup group) {
int childCount = group.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = group.getChildAt(i);
if (child instanceof ViewGroup) {
View view = searchAndFindDrawingView((ViewGroup) child);
if (view != null) {
return view;
}
}
if (child instanceof SurfaceView) {
return (View) child;
}
if (hasTextureViewSupport) { // if we have support for texture view
if (child instanceof TextureView) {
return (View) child;
}
}
}
return null;
}
@SuppressLint("NewApi")
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
ViewGroup view = (ViewGroup) super.onCreateView(inflater, container,
savedInstanceState);
view.setBackgroundColor(0x00000000); // Set Root View to be transparent
// to prevent black screen on
// load
hasTextureViewSupport = textureViewSupport(); // Find out if we support
// texture view on this
// device
drawingView = searchAndFindDrawingView(view); // Find the view the map
// is using for Open GL
if (drawingView == null)
return view; // If we didn't get anything then abort
drawingView.setBackgroundColor(0x00000000); // Stop black artifact from
// being left behind on
// scroll
// Create On Touch Listener for MapView Parent Scrolling Fix - Many thanks to Gemerson Ribas (gmribas) for help with this fix.
OnTouchListener touchListener = new OnTouchListener() {
public boolean onTouch(View view, MotionEvent event) {
int action = event.getAction();
switch (action) {
case MotionEvent.ACTION_DOWN:
// Disallow Parent to intercept touch events.
view.getParent().requestDisallowInterceptTouchEvent(preventParentScrolling);
break;
case MotionEvent.ACTION_UP:
// Allow Parent to intercept touch events.
view.getParent().requestDisallowInterceptTouchEvent(!preventParentScrolling);
break;
}
// Handle View touch events.
view.onTouchEvent(event);
return false;
}
};
// texture view
if (hasTextureViewSupport) { // If we support texture view and the
// drawing view is a TextureView then
// tweak it and return the fragment view
if (drawingView instanceof TextureView) {
TextureView textureView = (TextureView) drawingView;
// Stop Containing Views from moving when a user is interacting
// with Map View Directly
textureView.setOnTouchListener(touchListener);
return view;
}
}
// Otherwise continue onto legacy surface view hack
final SurfaceView surfaceView = (SurfaceView) drawingView;
// Fix for reducing black view flash issues
SurfaceHolder holder = surfaceView.getHolder();
holder.setFormat(PixelFormat.RGB_888);
// Stop Containing Views from moving when a user is interacting with
// Map View Directly
surfaceView.setOnTouchListener(touchListener);
return view;
}
public boolean getPreventParentScrolling() {
return preventParentScrolling;
}
public void setPreventParentScrolling(boolean value) {
preventParentScrolling = value;
}
}
\ No newline at end of file
...@@ -87,6 +87,8 @@ public class TightTextView extends TextView { ...@@ -87,6 +87,8 @@ public class TightTextView extends TextView {
if (w < getMeasuredWidth()) { if (w < getMeasuredWidth()) {
super.onMeasure(MeasureSpec.makeMeasureSpec(w, MeasureSpec.AT_MOST), heightMeasureSpec); super.onMeasure(MeasureSpec.makeMeasureSpec(w, MeasureSpec.AT_MOST), heightMeasureSpec);
} }
} else {
super.onMeasure(MeasureSpec.makeMeasureSpec(Math.min(maxWidth, linesMaxWidth), MeasureSpec.AT_MOST), heightMeasureSpec);
} }
} }
} }
...@@ -99,6 +101,7 @@ public class TightTextView extends TextView { ...@@ -99,6 +101,7 @@ public class TightTextView extends TextView {
public void setMaxWidth(int maxpixels) { public void setMaxWidth(int maxpixels) {
super.setMaxWidth(maxpixels); super.setMaxWidth(maxpixels);
hasMaxWidth = true; hasMaxWidth = true;
maxWidth = maxpixels;
} }
@Override @Override
......
<!--
~ This is the source code of Telegram for Android v. 1.3.2.
~ It is licensed under GNU GPL v. 2 or later.
~ You should have received a copy of the license in this archive (see LICENSE).
~
~ Copyright Nikolai Kudashov, 2013.
-->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<solid android:color="#802a2a2a" />
</shape>
</item>
<item android:id="@android:id/progress">
<clip android:clipOrientation="horizontal" android:gravity="top|left">
<shape>
<solid android:color="#39b0dd" />
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<!--
~ This is the source code of Telegram for Android v. 1.3.2.
~ It is licensed under GNU GPL v. 2 or later.
~ You should have received a copy of the license in this archive (see LICENSE).
~
~ Copyright Nikolai Kudashov, 2013.
-->
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/HLRelativeLayout1"
android:layout_width="match_parent"
android:layout_height="64dp"
android:paddingLeft="13dp"
android:paddingRight="13dp">
<TextView
android:id="@+id/docs_item_type"
android:layout_width="55dp"
android:layout_height="42dp"
android:layout_marginTop="11dp"
android:background="#1A808080"
android:ellipsize="marquee"
android:gravity="center"
android:padding="5dp"
android:singleLine="true"
android:textColor="#919191"
android:textSize="16dp"
android:textStyle="bold"
android:layout_gravity="top|right"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="62dp"
android:layout_marginLeft="7dp"
android:layout_marginRight="66dp"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_gravity="top|right">
<TextView
android:id="@+id/docs_item_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="TextView"
android:textColor="#000"
android:textSize="18dp"
android:gravity="right"
android:layout_gravity="top|right"/>
<TextView
android:id="@+id/docs_item_info"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="marquee"
android:singleLine="true"
android:text="TextView"
android:textColor="#a6a6a6"
android:textSize="16dp"
android:gravity="right"
android:layout_gravity="top|right"/>
</LinearLayout>
<org.telegram.ui.Views.BackupImageView
android:id="@+id/docs_item_thumb"
android:layout_width="55dp"
android:layout_height="42dp"
android:scaleType="centerCrop"
android:layout_marginTop="11dp"
android:layout_gravity="top|right"/>
<View
android:background="@color/divider"
android:layout_width="fill_parent"
android:layout_height="1px"
android:layout_gravity="bottom"
android:id="@+id/settings_row_divider"/>
</FrameLayout>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
android:id="@+id/chat_group_avatar_image" android:id="@+id/chat_group_avatar_image"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:layout_marginBottom="2dp" android:layout_marginBottom="2dp"
android:layout_marginRight="4dp"
android:layout_gravity="bottom"/> android:layout_gravity="bottom"/>
<LinearLayout <LinearLayout
...@@ -27,7 +28,8 @@ ...@@ -27,7 +28,8 @@
android:baselineAligned="false" android:baselineAligned="false"
android:id="@+id/chat_bubble_layout"> android:id="@+id/chat_bubble_layout">
<FrameLayout android:layout_height="58dp" <FrameLayout
android:layout_height="58dp"
android:layout_width="0dp" android:layout_width="0dp"
android:id="@+id/shared_layout" android:id="@+id/shared_layout"
android:layout_weight="1"> android:layout_weight="1">
......
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="left">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_marginLeft="6dp"
android:id="@+id/chat_group_avatar_image"
android:scaleType="fitCenter"
android:layout_marginBottom="2dp"
android:layout_marginRight="4dp"
android:layout_gravity="bottom"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:orientation="horizontal"
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="18dp"
android:paddingRight="9dp"
android:layout_gravity="top|left"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#40b7c9d7"
android:src="@drawable/doc_blue"
android:scaleType="center"
android:id="@+id/contact_avatar"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_gravity="top"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#000000"
android:layout_marginRight="2dp"
android:id="@+id/chat_user_group_name"
android:layout_marginLeft="50dp"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:singleLine="true"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:textColor="#9daab8"
android:id="@+id/phone_text_view"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#a1aab3"
android:textSize="12dp"
android:layout_marginBottom="5dp"
android:layout_gravity="bottom|right"/>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center_vertical"
android:id="@+id/chat_view_action_layout"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginRight="4dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="12dp"
android:layout_marginRight="36dp"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/DOWNLOAD"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center|left"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center_vertical|left"/>
</LinearLayout>
\ No newline at end of file
...@@ -130,12 +130,13 @@ ...@@ -130,12 +130,13 @@
<ProgressBar <ProgressBar
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:progress="50" android:progress="50"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginRight="36dp" android:layout_marginRight="36dp"
android:layout_gravity="center|left"
android:id="@+id/chat_view_action_progress" android:id="@+id/chat_view_action_progress"
android:max="100"/> android:max="100"/>
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="1dp" android:paddingBottom="1dp"
......
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="left">
<org.telegram.ui.Views.FrameLayoutFixed
android:orientation="horizontal"
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="18dp"
android:paddingRight="9dp"
android:layout_gravity="top|left"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#40b7c9d7"
android:src="@drawable/doc_blue"
android:scaleType="center"
android:id="@+id/contact_avatar"/>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollHorizontally="true"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_marginRight="2dp"
android:layout_gravity="top"
android:ellipsize="end"
android:textColor="#000000"
android:id="@+id/chat_user_group_name"
android:maxLines="1"
android:layout_marginLeft="50dp"/>
<TextView android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:singleLine="true"
android:textColor="#9daab8"
android:id="@+id/phone_text_view"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#a1aab3"
android:textSize="12dp"
android:layout_gravity="bottom|right"
android:layout_marginBottom="5dp"/>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_gravity="center_vertical"
android:id="@+id/chat_view_action_layout"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginRight="4dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="12dp"
android:layout_marginRight="36dp"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/DOWNLOAD"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center_vertical"/>
</LinearLayout>
\ No newline at end of file
...@@ -16,15 +16,16 @@ ...@@ -16,15 +16,16 @@
android:id="@+id/message_layout" android:id="@+id/message_layout"
android:layout_gravity="top|left"> android:layout_gravity="top|left">
<TextView android:layout_height="wrap_content" <TextView
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:textColor="#006fc8" android:layout_width="wrap_content"
android:textSize="14dp" android:textColor="#006fc8"
android:maxLines="1" android:textSize="14dp"
android:ellipsize="end" android:maxLines="1"
android:text="@string/ForwardedMessage" android:ellipsize="end"
android:layout_gravity="top|left" android:text="@string/ForwardedMessage"
android:id="@+id/chat_text_forward_text"/> android:layout_gravity="top|left"
android:id="@+id/chat_text_forward_text"/>
<TextView <TextView
android:layout_height="wrap_content" android:layout_height="wrap_content"
......
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
android:textStyle="bold" android:textStyle="bold"
android:layout_marginLeft="10dp"/> android:layout_marginLeft="10dp"/>
<org.telegram.ui.Views.FrameLayoutFixed android:layout_height="wrap_content" <org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp" android:layout_width="140dp"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
...@@ -120,12 +121,13 @@ ...@@ -120,12 +121,13 @@
<ProgressBar <ProgressBar
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="3dp"
android:layout_gravity="left|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:progress="50" android:progress="50"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_marginRight="36dp" android:layout_marginRight="36dp"
android:layout_gravity="center|left"
android:id="@+id/chat_view_action_progress" android:id="@+id/chat_view_action_progress"
android:max="100"/> android:max="100"/>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
android:textSize="14dp" android:textSize="14dp"
android:id="@+id/searchEmptyView" android:id="@+id/searchEmptyView"
android:visibility="gone" android:visibility="gone"
android:layout_centerInParent="true"/> android:layout_gravity="center"/>
<include <include
layout="@layout/encrypted_chat_placeholder" layout="@layout/encrypted_chat_placeholder"
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
<FrameLayout <FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingBottom="1dp" android:paddingBottom="1dp"
...@@ -106,4 +105,5 @@ ...@@ -106,4 +105,5 @@
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="1dp"
android:paddingTop="1dp"
android:layout_gravity="top"
android:gravity="right">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="wrap_content"
android:layout_width="140dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:id="@+id/chat_view_action_layout"
android:layout_gravity="center"
android:visibility="gone">
<ImageView
android:layout_width="30dp"
android:layout_height="30dp"
android:scaleType="centerInside"
android:layout_marginLeft="4dp"
android:id="@+id/chat_view_action_cancel_button"
android:src="@drawable/ic_msg_btn_cross_custom"
android:layout_gravity="left|center"
android:clickable="true"/>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="3dp"
style="?android:attr/progressBarStyleHorizontal"
android:progress="50"
android:layout_marginLeft="36dp"
android:layout_marginRight="12dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
android:id="@+id/chat_view_action_progress"
android:max="100"/>
</org.telegram.ui.Views.FrameLayoutFixed>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/DOWNLOAD"
android:textColor="#54759e"
android:background="@drawable/chat_incoming_media_states"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:id="@+id/chat_view_action_button"
android:textSize="14dp"
android:layout_marginRight="10dp"
android:layout_marginLeft="10dp"
android:descendantFocusability="blocksDescendants"
android:clickable="true"
android:gravity="center"
android:visibility="gone"
android:textStyle="bold"
android:layout_gravity="center"/>
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="78dp"
android:layout_width="wrap_content"
android:paddingTop="9dp"
android:paddingLeft="9dp"
android:paddingRight="18dp"
android:layout_gravity="top|right"
android:id="@+id/chat_bubble_layout">
<org.telegram.ui.Views.FrameLayoutFixed
android:layout_height="69dp"
android:layout_width="wrap_content"
android:layout_gravity="top|right"
android:id="@+id/shared_layout">
<org.telegram.ui.Views.BackupImageView
android:layout_width="42dp"
android:layout_height="42dp"
android:background="#408ed057"
android:src="@drawable/doc_green"
android:scaleType="center"
android:id="@+id/contact_avatar"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:scrollHorizontally="true"
android:layout_marginTop="3dp"
android:textSize="14dp"
android:lines="1"
android:singleLine="true"
android:layout_marginRight="2dp"
android:layout_gravity="top"
android:ellipsize="end"
android:textColor="#000000"
android:id="@+id/chat_user_group_name"
android:layout_marginLeft="50dp"/>
<org.telegram.ui.Views.TightTextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_marginLeft="50dp"
android:layout_marginTop="22dp"
android:layout_gravity="top"
android:layout_marginRight="2dp"
android:textSize="11dp"
android:maxLines="1"
android:textColor="#75b166"
android:id="@+id/phone_text_view"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_layout"
android:layout_gravity="bottom|right"
android:layout_marginBottom="5dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chat_time_text"
android:textColor="#70b15c"
android:textSize="12dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/msg_check"
android:layout_marginTop="2dp"
android:layout_marginLeft="4dp"
android:layout_marginRight="-8dp"
android:id="@+id/chat_row_check"
android:visibility="visible"
android:layout_gravity="top"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/msg_halfcheck"
android:layout_marginTop="2dp"
android:id="@+id/chat_row_halfcheck"
android:visibility="visible"
android:layout_gravity="top"/>
</LinearLayout>
</org.telegram.ui.Views.FrameLayoutFixed>
</org.telegram.ui.Views.FrameLayoutFixed>
</LinearLayout>
\ No newline at end of file
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:id="@+id/chat_view_action_layout" android:id="@+id/chat_view_action_layout"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="visible"> android:visibility="gone">
<ImageView <ImageView
android:layout_width="30dp" android:layout_width="30dp"
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
<ProgressBar <ProgressBar
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="3dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:progress="50" android:progress="50"
android:layout_marginLeft="36dp" android:layout_marginLeft="36dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_progress" android:id="@+id/chat_view_action_progress"
android:max="100"/> android:max="100"/>
...@@ -55,7 +56,8 @@ ...@@ -55,7 +56,8 @@
android:clickable="true" android:clickable="true"
android:gravity="center" android:gravity="center"
android:textStyle="bold" android:textStyle="bold"
android:layout_gravity="center"/> android:layout_gravity="center"
android:visibility="gone"/>
<org.telegram.ui.Views.FrameLayoutFixed <org.telegram.ui.Views.FrameLayoutFixed
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -29,12 +29,13 @@ ...@@ -29,12 +29,13 @@
<ProgressBar <ProgressBar
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="3dp"
android:layout_gravity="right|center_vertical"
android:progressDrawable="@drawable/photo_progress_chat"
style="?android:attr/progressBarStyleHorizontal" style="?android:attr/progressBarStyleHorizontal"
android:progress="50" android:progress="50"
android:layout_marginLeft="36dp" android:layout_marginLeft="36dp"
android:layout_marginRight="12dp" android:layout_marginRight="12dp"
android:layout_gravity="right|center"
android:id="@+id/chat_view_action_progress" android:id="@+id/chat_view_action_progress"
android:max="100"/> android:max="100"/>
......
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/HLRelativeLayout1"
android:layout_width="match_parent"
android:layout_height="64dp"
android:paddingLeft="13dp"
android:paddingRight="13dp">
<TextView
android:id="@+id/docs_item_type"
android:layout_width="55dp"
android:layout_height="42dp"
android:layout_marginTop="11dp"
android:background="#1A808080"
android:ellipsize="marquee"
android:gravity="center"
android:padding="5dp"
android:singleLine="true"
android:textColor="#919191"
android:textSize="16dp"
android:textStyle="bold"
android:layout_gravity="top|left"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="62dp"
android:layout_marginRight="7dp"
android:layout_marginLeft="66dp"
android:gravity="center_vertical"
android:orientation="vertical"
android:layout_gravity="top|left">
<TextView
android:id="@+id/docs_item_title"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:singleLine="true"
android:text="TextView"
android:textColor="#000"
android:textSize="18dp"
android:layout_gravity="top|left"/>
<TextView
android:id="@+id/docs_item_info"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:ellipsize="marquee"
android:singleLine="true"
android:text="TextView"
android:textColor="#a6a6a6"
android:textSize="16dp"
android:layout_gravity="top|left"/>
</LinearLayout>
<org.telegram.ui.Views.BackupImageView
android:id="@+id/docs_item_thumb"
android:layout_width="55dp"
android:layout_height="42dp"
android:scaleType="centerCrop"
android:layout_marginTop="11dp"
android:layout_gravity="top|left"/>
<View
android:background="@color/divider"
android:layout_width="fill_parent"
android:layout_height="1px"
android:layout_gravity="bottom"
android:id="@+id/settings_row_divider"/>
</FrameLayout>
\ No newline at end of file
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/listView"
android:clipToPadding="false"
android:fadingEdge="none"
android:fadingEdgeLength="0dp"
android:dividerHeight="0dp"
android:divider="@null"
android:scrollbars="none"
android:cacheColorHint="#ffffffff"/>
<TextView android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#808080"
android:gravity="center"
android:text="@string/NoFiles"
android:textSize="24dp"
android:id="@+id/searchEmptyView"
android:visibility="gone"
android:layout_gravity="top"/>
</FrameLayout>
...@@ -24,6 +24,11 @@ ...@@ -24,6 +24,11 @@
android:title="@string/ChatVideo" android:title="@string/ChatVideo"
android:id="@+id/attach_video"/> android:id="@+id/attach_video"/>
<item
android:icon="@drawable/ic_ab_doc"
android:title="@string/ChatDocument"
android:id="@+id/attach_document"/>
<item <item
android:icon="@drawable/ic_attach_location" android:icon="@drawable/ic_attach_location"
android:title="@string/ChatLocation" android:title="@string/ChatLocation"
......
...@@ -46,6 +46,20 @@ ...@@ -46,6 +46,20 @@
<string name="EncryptedChatStartedIncoming">لقد قمت بالدخول للمحادثة السرية.</string> <string name="EncryptedChatStartedIncoming">لقد قمت بالدخول للمحادثة السرية.</string>
<string name="ClearHistory">مسح سجل التاريخ</string> <string name="ClearHistory">مسح سجل التاريخ</string>
<string name="DeleteChat">حذف وخروج</string> <string name="DeleteChat">حذف وخروج</string>
<!--documents view-->
<string name="SelectFile">اختر ملف</string>
<string name="FreeOfTotal">متاح %1$s من %2$s</string>
<string name="UnknownError">حدث خطأ غير معروف</string>
<string name="AccessError">خطأ في الوصول</string>
<string name="NoFiles">لا يوجد ملفات بعد...</string>
<string name="FileUploadLimit">حجم الملف لا يمكن أن يكون أكبر من %1$s</string>
<string name="NotMounted">الذاكرة غير مثبتة</string>
<string name="UsbActive">نقل اليو إس بي مفعل</string>
<string name="InternalStorage">الذاكرة الداخلية</string>
<string name="ExternalStorage">الذاكرة الخارجية</string>
<string name="SystemRoot">جذر النظام</string>
<string name="SdCard">بطاقة الذاكرة</string>
<!--chat view--> <!--chat view-->
<string name="Invisible">مخفي</string> <string name="Invisible">مخفي</string>
...@@ -59,6 +73,7 @@ ...@@ -59,6 +73,7 @@
<string name="ChatGallery">صورة</string> <string name="ChatGallery">صورة</string>
<string name="ChatLocation"> موقع</string> <string name="ChatLocation"> موقع</string>
<string name="ChatVideo">مقطع مرئي</string> <string name="ChatVideo">مقطع مرئي</string>
<string name="ChatDocument">مستند</string>
<string name="NoMessages">...لا توجد رسائل بعد</string> <string name="NoMessages">...لا توجد رسائل بعد</string>
<string name="ViewPhoto">عرض الصورة</string> <string name="ViewPhoto">عرض الصورة</string>
<string name="ViewLocation">عرض الموقع</string> <string name="ViewLocation">عرض الموقع</string>
...@@ -105,12 +120,16 @@ ...@@ -105,12 +120,16 @@
<string name="NotificationMessageVideo">%1$s قام بإرسال مقطع مرئي لك</string> <string name="NotificationMessageVideo">%1$s قام بإرسال مقطع مرئي لك</string>
<string name="NotificationMessageContact">%1$s قام بإرسال جهة اتصال لك</string> <string name="NotificationMessageContact">%1$s قام بإرسال جهة اتصال لك</string>
<string name="NotificationMessageMap">%1$s قام بإرسال خريطة لك</string> <string name="NotificationMessageMap">%1$s قام بإرسال خريطة لك</string>
<string name="NotificationMessageDocument">%1$s قام بإرسال مستند لك</string>
<string name="NotificationMessageAudio">%1$s قام بإرسال مقطع صوتي لك</string>
<string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string> <string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string>
<string name="NotificationMessageGroupNoText">%1$s قام بإرسال رسالة للمجموعة %2$s</string> <string name="NotificationMessageGroupNoText">%1$s قام بإرسال رسالة للمجموعة %2$s</string>
<string name="NotificationMessageGroupPhoto">%1$s قام بإرسال صورة للمجموعة %2$s</string> <string name="NotificationMessageGroupPhoto">%1$s قام بإرسال صورة للمجموعة %2$s</string>
<string name="NotificationMessageGroupVideo">%1$s قام بإرسال مقطع مرئي للمجموعة %2$s</string> <string name="NotificationMessageGroupVideo">%1$s قام بإرسال مقطع مرئي للمجموعة %2$s</string>
<string name="NotificationMessageGroupContact">%1$s قام بإرسال جهة اتصال للمجموعة %2$s</string> <string name="NotificationMessageGroupContact">%1$s قام بإرسال جهة اتصال للمجموعة %2$s</string>
<string name="NotificationMessageGroupMap">%1$s قام بإرسال خريطة للمجموعة %2$s</string> <string name="NotificationMessageGroupMap">%1$s قام بإرسال خريطة للمجموعة %2$s</string>
<string name="NotificationMessageGroupDocument">%1$s قام بإرسال مستند للمجموعة %2$s</string>
<string name="NotificationMessageGroupAudio">%1$s قام بإرسال مقطع صوتي للمجموعة %2$s</string>
<string name="NotificationInvitedToGroup">%1$s قام بدعوتك للمجموعة %2$s</string> <string name="NotificationInvitedToGroup">%1$s قام بدعوتك للمجموعة %2$s</string>
<string name="NotificationEditedGroupName">%1$s قام بتعديل اسم المجموعة %2$s</string> <string name="NotificationEditedGroupName">%1$s قام بتعديل اسم المجموعة %2$s</string>
<string name="NotificationEditedGroupPhoto">%1$s قام بتغيير صورة المجموعة %2$s</string> <string name="NotificationEditedGroupPhoto">%1$s قام بتغيير صورة المجموعة %2$s</string>
...@@ -235,6 +254,7 @@ ...@@ -235,6 +254,7 @@
<string name="Next">التالي</string> <string name="Next">التالي</string>
<string name="Back">رجوع</string> <string name="Back">رجوع</string>
<string name="Done">تم</string> <string name="Done">تم</string>
<string name="Open">فتح</string>
<string name="Cancel">إلغاء</string> <string name="Cancel">إلغاء</string>
<string name="Add">إضافة</string> <string name="Add">إضافة</string>
<string name="Edit">تعديل</string> <string name="Edit">تعديل</string>
...@@ -264,6 +284,8 @@ ...@@ -264,6 +284,8 @@
<string name="AttachVideo">مقطع مرئي</string> <string name="AttachVideo">مقطع مرئي</string>
<string name="AttachLocation">موقع</string> <string name="AttachLocation">موقع</string>
<string name="AttachContact">جهة اتصال</string> <string name="AttachContact">جهة اتصال</string>
<string name="AttachDocument">مستند</string>
<string name="AttachAudio">مقطع صوتي</string>
<string name="FromYou">أنت</string> <string name="FromYou">أنت</string>
<!--Alert messages--> <!--Alert messages-->
...@@ -275,6 +297,7 @@ ...@@ -275,6 +297,7 @@
<string name="InvalidLastName">اسم العائلة غير صحيح</string> <string name="InvalidLastName">اسم العائلة غير صحيح</string>
<string name="Loading">جاري التحميل ...</string> <string name="Loading">جاري التحميل ...</string>
<string name="NoPlayerInstalled">ليس لديك أي مشغل مقاطع مرئية، يرجى تنزيل أية مشغل</string> <string name="NoPlayerInstalled">ليس لديك أي مشغل مقاطع مرئية، يرجى تنزيل أية مشغل</string>
<string name="NoHandleAppInstalled">لا يوجد لديك تطبيق يمكنه فته هذا المستند، يرجى تنزيل تطبيق يمكنه للإستمرار</string>
<string name="InviteUser">هذا المستخدم ليس لديه تيليجرام بعد ، هل ترغب في دعوته الآن؟</string> <string name="InviteUser">هذا المستخدم ليس لديه تيليجرام بعد ، هل ترغب في دعوته الآن؟</string>
<string name="AreYouSure">هل أنت متأكد؟</string> <string name="AreYouSure">هل أنت متأكد؟</string>
<string name="DeleteChatQuestion">هل تريد حذف هذه الدردشة؟</string> <string name="DeleteChatQuestion">هل تريد حذف هذه الدردشة؟</string>
......
...@@ -47,6 +47,20 @@ ...@@ -47,6 +47,20 @@
<string name="ClearHistory">Clear History</string> <string name="ClearHistory">Clear History</string>
<string name="DeleteChat">Delete and Exit</string> <string name="DeleteChat">Delete and Exit</string>
<!--documents view-->
<string name="SelectFile">Select File</string>
<string name="FreeOfTotal">Free %1$s of %2$s</string>
<string name="UnknownError">Unknown error</string>
<string name="AccessError">Access error</string>
<string name="NoFiles">No files yet...</string>
<string name="FileUploadLimit">File size shouldn\'t be greater than %1$s</string>
<string name="NotMounted">Storage not mounted</string>
<string name="UsbActive">Usb transfer active</string>
<string name="InternalStorage">Internal Storage</string>
<string name="ExternalStorage">External Storage</string>
<string name="SystemRoot">System Root</string>
<string name="SdCard">SD Card</string>
<!--chat view--> <!--chat view-->
<string name="Invisible">invisible</string> <string name="Invisible">invisible</string>
<string name="Typing">typing...</string> <string name="Typing">typing...</string>
...@@ -59,6 +73,7 @@ ...@@ -59,6 +73,7 @@
<string name="ChatGallery">Gallery</string> <string name="ChatGallery">Gallery</string>
<string name="ChatLocation">Location</string> <string name="ChatLocation">Location</string>
<string name="ChatVideo">Video</string> <string name="ChatVideo">Video</string>
<string name="ChatDocument">Document</string>
<string name="NoMessages">No messages here yet...</string> <string name="NoMessages">No messages here yet...</string>
<string name="ViewPhoto">View Photo</string> <string name="ViewPhoto">View Photo</string>
<string name="ViewLocation">View Location</string> <string name="ViewLocation">View Location</string>
...@@ -105,12 +120,16 @@ ...@@ -105,12 +120,16 @@
<string name="NotificationMessageVideo">%1$s sent you a video</string> <string name="NotificationMessageVideo">%1$s sent you a video</string>
<string name="NotificationMessageContact">%1$s shared a contact with you</string> <string name="NotificationMessageContact">%1$s shared a contact with you</string>
<string name="NotificationMessageMap">%1$s sent you a map</string> <string name="NotificationMessageMap">%1$s sent you a map</string>
<string name="NotificationMessageDocument">%1$s sent you a document</string>
<string name="NotificationMessageAudio">%1$s sent you an audio</string>
<string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string> <string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string>
<string name="NotificationMessageGroupNoText">%1$s sent a message to the group %2$s</string> <string name="NotificationMessageGroupNoText">%1$s sent a message to the group %2$s</string>
<string name="NotificationMessageGroupPhoto">%1$s sent a photo to the group %2$s</string> <string name="NotificationMessageGroupPhoto">%1$s sent a photo to the group %2$s</string>
<string name="NotificationMessageGroupVideo">%1$s sent a video to the group %2$s</string> <string name="NotificationMessageGroupVideo">%1$s sent a video to the group %2$s</string>
<string name="NotificationMessageGroupContact">%1$s shared a contact in the group %2$s</string> <string name="NotificationMessageGroupContact">%1$s shared a contact in the group %2$s</string>
<string name="NotificationMessageGroupMap">%1$s sent a map to the group %2$s</string> <string name="NotificationMessageGroupMap">%1$s sent a map to the group %2$s</string>
<string name="NotificationMessageGroupDocument">%1$s sent a document to the group %2$s</string>
<string name="NotificationMessageGroupAudio">%1$s sent an audio to the group %2$s</string>
<string name="NotificationInvitedToGroup">%1$s invited you to the group %2$s</string> <string name="NotificationInvitedToGroup">%1$s invited you to the group %2$s</string>
<string name="NotificationEditedGroupName">%1$s edited the group\'s %2$s name</string> <string name="NotificationEditedGroupName">%1$s edited the group\'s %2$s name</string>
<string name="NotificationEditedGroupPhoto">%1$s edited the group\'s %2$s photo</string> <string name="NotificationEditedGroupPhoto">%1$s edited the group\'s %2$s photo</string>
...@@ -235,6 +254,7 @@ ...@@ -235,6 +254,7 @@
<string name="Next">Next</string> <string name="Next">Next</string>
<string name="Back">Back</string> <string name="Back">Back</string>
<string name="Done">Done</string> <string name="Done">Done</string>
<string name="Open">Open</string>
<string name="Cancel">Cancel</string> <string name="Cancel">Cancel</string>
<string name="Add">Add</string> <string name="Add">Add</string>
<string name="Edit">Edit</string> <string name="Edit">Edit</string>
...@@ -264,6 +284,8 @@ ...@@ -264,6 +284,8 @@
<string name="AttachVideo">Video</string> <string name="AttachVideo">Video</string>
<string name="AttachLocation">Location</string> <string name="AttachLocation">Location</string>
<string name="AttachContact">Contact</string> <string name="AttachContact">Contact</string>
<string name="AttachDocument">Document</string>
<string name="AttachAudio">Audio</string>
<string name="FromYou">You</string> <string name="FromYou">You</string>
<!--Alert messages--> <!--Alert messages-->
...@@ -275,6 +297,7 @@ ...@@ -275,6 +297,7 @@
<string name="InvalidLastName">Invalid last name</string> <string name="InvalidLastName">Invalid last name</string>
<string name="Loading">Loading...</string> <string name="Loading">Loading...</string>
<string name="NoPlayerInstalled">You don\'t have a video player, please install one to continue</string> <string name="NoPlayerInstalled">You don\'t have a video player, please install one to continue</string>
<string name="NoHandleAppInstalled">You don\'t have any application that can handle with mime type \'%1$s\', please install one to continue</string>
<string name="InviteUser">This user does not have Telegram yet, send an invitation?</string> <string name="InviteUser">This user does not have Telegram yet, send an invitation?</string>
<string name="AreYouSure">Are you sure?</string> <string name="AreYouSure">Are you sure?</string>
<string name="AddContactQ">Add contact?</string> <string name="AddContactQ">Add contact?</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment