From 90d8e8a370fba504eadf40f410781c6f4085967b Mon Sep 17 00:00:00 2001 From: DrKLO Date: Mon, 4 Nov 2013 16:31:01 +0400 Subject: [PATCH] update to 1.2.7 --- TMessagesProj/build.gradle | 12 +- ...ockeySDK-3.0.0.jar => HockeySDK-3.0.1.jar} | Bin 104219 -> 105133 bytes TMessagesProj/src/main/AndroidManifest.xml | 8 +- TMessagesProj/src/main/assets/countries.txt | 1 - .../org/telegram/PhoneFormat/PhoneFormat.java | 4 +- .../messenger/ConnectionsManager.java | 6 +- .../java/org/telegram/messenger/Emoji.java | 16 +- .../org/telegram/messenger/FileLoader.java | 3 +- .../messenger/GcmBroadcastReceiver.java | 2 +- .../messenger/MessagesController.java | 343 +++++++++--------- .../telegram/messenger/MessagesStorage.java | 101 +++++- .../org/telegram/messenger/UserConfig.java | 102 +++--- .../org/telegram/messenger/Utilities.java | 72 ++-- .../org/telegram/objects/MessageObject.java | 43 +-- .../org/telegram/ui/ApplicationActivity.java | 10 +- .../org/telegram/ui/ApplicationLoader.java | 24 +- .../java/org/telegram/ui/ChatActivity.java | 66 ++-- .../org/telegram/ui/ChatProfileActivity.java | 12 +- .../ui/ChatProfileChangeNameActivity.java | 4 +- .../org/telegram/ui/ContactAddActivity.java | 4 +- .../org/telegram/ui/ContactsActivity.java | 13 +- .../org/telegram/ui/GalleryImageViewer.java | 2 +- .../org/telegram/ui/GroupCreateActivity.java | 8 +- .../telegram/ui/GroupCreateFinalActivity.java | 2 +- .../org/telegram/ui/IdenticonActivity.java | 4 +- .../java/org/telegram/ui/IntroActivity.java | 2 +- .../java/org/telegram/ui/LaunchActivity.java | 16 +- .../org/telegram/ui/LocationActivity.java | 20 +- .../java/org/telegram/ui/LoginActivity.java | 4 +- .../java/org/telegram/ui/MediaActivity.java | 2 +- .../org/telegram/ui/MessagesActivity.java | 14 +- .../ui/ScreenSlidePageFragmentPhone.java | 16 +- .../ui/ScreenSlidePageFragmentRegister.java | 12 +- .../ui/ScreenSlidePageFragmentSms.java | 16 +- .../org/telegram/ui/SettingsActivity.java | 12 +- .../org/telegram/ui/SettingsBlockedUsers.java | 2 +- .../ui/SettingsChangeNameActivity.java | 6 +- .../ui/SettingsNotificationsActivity.java | 26 +- .../ui/SettingsWallpapersActivity.java | 14 +- .../org/telegram/ui/UserProfileActivity.java | 4 +- .../org/telegram/ui/Views/AvatarUpdater.java | 15 +- .../org/telegram/ui/Views/BaseFragment.java | 5 +- .../telegram/ui/Views/NotificationView.java | 30 +- .../res/layout-ar/notification_layout.xml | 2 - .../res/layout-ar/settings_name_layout.xml | 1 + .../chat_group_incoming_forward_layout.xml | 2 +- .../chat_group_incoming_text_layout.xml | 2 +- .../layout/chat_incoming_forward_layout.xml | 2 +- .../res/layout/chat_incoming_text_layout.xml | 2 +- .../layout/chat_outgoing_forward_layout.xml | 2 +- .../res/layout/chat_outgoing_text_layout.xml | 2 +- .../main/res/layout/notification_layout.xml | 2 - .../main/res/layout/settings_name_layout.xml | 1 + .../src/main/res/values-ar/strings.xml | 1 + TMessagesProj/src/main/res/values/strings.xml | 3 +- 55 files changed, 632 insertions(+), 468 deletions(-) rename TMessagesProj/libs/{HockeySDK-3.0.0.jar => HockeySDK-3.0.1.jar} (58%) diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 93a80ca2..69062617 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -32,18 +32,18 @@ tasks.withType(Compile) { dependencies { compile 'com.actionbarsherlock:actionbarsherlock:4.4.0@aar' - compile 'com.google.android.gms:play-services:3.1.+' - compile 'net.hockeyapp.android:HockeySDK:3.0.0' - compile 'com.android.support:support-v4:18.0.+' + compile 'com.google.android.gms:play-services:4.0.+' + compile 'net.hockeyapp.android:HockeySDK:3.0.1' + compile 'com.android.support:support-v4:19.0.+' compile fileTree(dir: "$buildDir/native-libs", include: '*.jar') } android { - compileSdkVersion 18 - buildToolsVersion "17.0.0" + compileSdkVersion 19 + buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 8 - targetSdkVersion 18 + targetSdkVersion 19 } } diff --git a/TMessagesProj/libs/HockeySDK-3.0.0.jar b/TMessagesProj/libs/HockeySDK-3.0.1.jar similarity index 58% rename from TMessagesProj/libs/HockeySDK-3.0.0.jar rename to TMessagesProj/libs/HockeySDK-3.0.1.jar index 5d22fa5effc7ef76e44664cdf1dcb53d49ba1112..7b7d60379028acd168776769067481ae628aaf2e 100644 GIT binary patch delta 36545 zcmZ6y1CZzJ@&-D#ZQHhO8@prM{*7(hHg{~>Hg{~#?9AQsedpX;|C>sxJJreaRwbRM zlRW)q)k4&?Kp-f|f`Y*S{b%`zq!3L&AO(B>k7ZB(*G?1sYj3Fju}QeVO#eEHz}){j z(ZD?aIupQL|2je-6iIu{knsO6@_!JMgg`j{zi>VX(my*z%^(m^{|Q@Ql}jacK?wsa z988f()UCyTaM|0w&u z?~Ee_=HDA$cmJN!-f^Dk{yp>gv0DTHS~|={RA0Low)WVLlIhwX7I+L_&N3>ARIiH@ z)q{g3WP5y@ivzwBNo&{*0wo~x#R>-O55lF3kdTK42^1T88X8ND5hOaUg?X-B^dmF( zlJ9iUYutqI>k~iZ?sYS25JK5Y@^eu{`1k`*vvMLoHMZSW4*Dnk!*t0}Ur;W&XC^_K$l`>%>4 z1Lseke>ps)%NW{7>ar~@Zmi%%&V|W>7wOaYm(J8aD|H5c&g{8Cvu4T-HmVO^Yb1$g zf+-r;lP)bT6Wr~ws^Cv|;>8hU7b*+4Gw^ZI7Z^0zojzl1R92s-GS!UB&50?CaW<}UmEu?6$HOG;IMm!*p3`H``PO_}k< zrB&sdi>HNIY_G!U4V6tz)R-7NLh&7TZBe9-Ud#7B%O;rJMyqp|s?)6yk(Bco{HLeX z#5h3@@Q=w@ejg=MyO7nE*le>&6bvuD0=N9M*04=EuYg;w#KBucNtFlq$K${ajX*~v zc3K%0%_i>wLSy5RV7f)USQ5rrnM3vIV%oQA6crcIgw*Ftr!q~5==0=A(`Cq?+GrB@ z2kzmler1jiRab{vg5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=iTA$*KD~LojQLw5QY={G_5T5YUrj#Wa^2DlsM^58#z*k=Nc%^5YY6_7ivL`M z(cc1_N&gp5h7N!P8hHbF0eXn}yMNHffl)T(|3x{){e5kP{RWg%{ueL-20XRHjamNq z|11?4ZySN}W{u)5H!W06^3z}UL(8EhI-5Tp2S#2nu%tk3Kd|T^Y3iBEC?oVHCxJ^I5+=1Ukfv4c**1Mo4;rv##vZSDG+#PxqS!brH(kEQ&Wy0z10U zT*5XTs8e+MT9_u3c{3DE?G~t-c&D>WhZP!9(}8}O?t-Ks)q_!BI@fflQxH9H^v2F2 zH;^XaZV@j=k?FT*FmfqD+IJ}3auj!L^aklro8IovD2S{B(N{+gD1~5<4jV|YPn-dC zs&*>G*3&Z>Wgz|Z*C656!s+ZY8D$l~4RIt(RpD#_hX4OJ6;6+s#i%|#dnPc&fjj=y zGl81Ff`tvIp8yIgz + android:versionCode="98" + android:versionName="1.2.7"> - + @@ -19,6 +19,8 @@ + + diff --git a/TMessagesProj/src/main/assets/countries.txt b/TMessagesProj/src/main/assets/countries.txt index 27e56e5d..6daf6438 100644 --- a/TMessagesProj/src/main/assets/countries.txt +++ b/TMessagesProj/src/main/assets/countries.txt @@ -228,7 +228,6 @@ 31;NL;Netherlands 30;GR;Greece 27;ZA;South Africa -21;DZ;Algeria 20;EG;Egypt 7;KZ;Kazakhstan 7;RU;Russia diff --git a/TMessagesProj/src/main/java/org/telegram/PhoneFormat/PhoneFormat.java b/TMessagesProj/src/main/java/org/telegram/PhoneFormat/PhoneFormat.java index d76bea8a..dc0e4fe6 100644 --- a/TMessagesProj/src/main/java/org/telegram/PhoneFormat/PhoneFormat.java +++ b/TMessagesProj/src/main/java/org/telegram/PhoneFormat/PhoneFormat.java @@ -24,7 +24,7 @@ package org.telegram.PhoneFormat; -import org.telegram.messenger.Utilities; +import org.telegram.ui.ApplicationLoader; import java.io.ByteArrayOutputStream; import java.io.InputStream; @@ -78,7 +78,7 @@ public class PhoneFormat { public void init(String countryCode) { try { - InputStream stream = Utilities.applicationContext.getAssets().open("PhoneFormats.dat"); + InputStream stream = ApplicationLoader.applicationContext.getAssets().open("PhoneFormats.dat"); ByteArrayOutputStream bos = new ByteArrayOutputStream(); byte[] buf = new byte[1024]; int len; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java index 07cad788..84eec705 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/ConnectionsManager.java @@ -150,7 +150,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. Utilities.stageQueue.postRunnable(new Runnable() { @Override public void run() { - File configFile = new File(Utilities.applicationContext.getFilesDir(), "config.dat"); + File configFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "config.dat"); if (configFile.exists()) { try { SerializedData data = new SerializedData(configFile); @@ -235,7 +235,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. data.writeInt32(0); } try { - File configFile = new File(Utilities.applicationContext.getFilesDir(), "config.dat"); + File configFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "config.dat"); if (!configFile.exists()) { configFile.createNewFile(); } @@ -491,7 +491,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection. public static boolean isNetworkOnline() { boolean status = false; try { - ConnectivityManager cm = (ConnectivityManager)Utilities.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE); + ConnectivityManager cm = (ConnectivityManager)ApplicationLoader.applicationContext.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo netInfo = cm.getNetworkInfo(0); if (netInfo != null && netInfo.getState() == NetworkInfo.State.CONNECTED) { status = true; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java b/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java index f8ce2f36..84569877 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Emoji.java @@ -27,6 +27,8 @@ import android.view.View; import android.view.ViewGroup; import android.widget.TextView; +import org.telegram.ui.ApplicationLoader; + public class Emoji { private static final int[] ROW_SIZES = {27, 29, 33, 34, 34}; private static HashMap rects = new HashMap(); @@ -287,7 +289,7 @@ public class Emoji { 0x00000000D83DDD34L, 0x00000000D83DDD35L, 0x00000000D83DDD3BL, 0x00000000D83DDD36L, 0x00000000D83DDD37L, 0x00000000D83DDD38L, 0x00000000D83DDD39L}}; static { - imgSize = Math.min(scale(30), Utilities.applicationContext.getResources().getDisplayMetrics().density < 1.5f ? 28 : 56); + imgSize = Math.min(scale(30), ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density < 1.5f ? 28 : 56); drawImgSize = scale(20); bigImgSize = scale(30); if(Math.abs(imgSize - bigImgSize) < 5) { @@ -306,7 +308,7 @@ public class Emoji { } public static int scale(float value) { - return (int)(Utilities.applicationContext.getResources().getDisplayMetrics().density * value); + return (int)(ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density * value); } private static Bitmap loadPage(final int page){ @@ -317,13 +319,13 @@ public class Emoji { opts.inPreferredConfig = Bitmap.Config.ARGB_8888; opts.inDither = false; - if (Utilities.applicationContext.getResources().getDisplayMetrics().density < 1.5f) { + if (ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density < 1.5f) { opts.inSampleSize = 2; } int iw, ih; - InputStream is = Utilities.applicationContext.getAssets().open("emojisprite_" + page + ".png"); + InputStream is = ApplicationLoader.applicationContext.getAssets().open("emojisprite_" + page + ".png"); Bitmap color = BitmapFactory.decodeStream(is, null, opts); is.close(); @@ -559,8 +561,8 @@ public class Emoji { int sz = super.getSize(paint, text, start, end, fm); - int offset = (int)(8 * Utilities.applicationContext.getResources().getDisplayMetrics().density); - int w = (int)(20 * Utilities.applicationContext.getResources().getDisplayMetrics().density / 2); + int offset = (int)(8 * ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density); + int w = (int)(20 * ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density / 2); fm.top = -w - offset; fm.bottom = w - offset; fm.ascent = -w - offset; @@ -586,7 +588,7 @@ public class Emoji { int sz = super.getSize(paint, text, start, end, fm); - int offset = (int)(6 * Utilities.applicationContext.getResources().getDisplayMetrics().density); + int offset = (int)(6 * ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density); int w = (fm.bottom - fm.top) / 2; fm.top = -w - offset; fm.bottom = w - offset; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java index e25f02d4..46aff813 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/FileLoader.java @@ -18,6 +18,7 @@ import android.view.View; import android.widget.ImageView; import org.telegram.TL.TLRPC; +import org.telegram.ui.ApplicationLoader; import org.telegram.ui.Views.BackupImageView; import java.io.ByteArrayOutputStream; @@ -247,7 +248,7 @@ public class FileLoader { public FileLoader() { int maxMemory = (int)Runtime.getRuntime().maxMemory(); int cacheSize = maxMemory / 10; - density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (Build.VERSION.SDK_INT < 11) { runtimeHack = new VMRuntimeHack(); cacheSize = 1024 * 1024 * 3; diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/GcmBroadcastReceiver.java b/TMessagesProj/src/main/java/org/telegram/messenger/GcmBroadcastReceiver.java index 30be10a4..d4455982 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/GcmBroadcastReceiver.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/GcmBroadcastReceiver.java @@ -198,7 +198,7 @@ public class GcmBroadcastReceiver extends BroadcastReceiver { PendingIntent contentIntent = PendingIntent.getActivity(context, 0, intent, PendingIntent.FLAG_ONE_SHOT); NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context) - .setContentTitle(Utilities.applicationContext.getString(R.string.AppName)) + .setContentTitle(ApplicationLoader.applicationContext.getString(R.string.AppName)) .setSmallIcon(R.drawable.notification) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index 9e02fa7a..23fe7ed0 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -39,6 +39,7 @@ import android.util.SparseArray; import com.actionbarsherlock.app.SherlockFragmentActivity; +import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.TL.TLClassStore; import org.telegram.TL.TLObject; import org.telegram.TL.TLRPC; @@ -197,7 +198,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter try { soundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0); - sound = soundPool.load(Utilities.applicationContext, R.raw.sound_a, 1); + sound = soundPool.load(ApplicationLoader.applicationContext, R.raw.sound_a, 1); } catch (Exception e) { e.printStackTrace(); } @@ -364,7 +365,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } public void checkAppAccount() { - AccountManager am = AccountManager.get(Utilities.applicationContext); + AccountManager am = AccountManager.get(ApplicationLoader.applicationContext); Account[] accounts = am.getAccountsByType("org.telegram.messenger.account"); boolean recreateAccount = false; if (UserConfig.currentUser != null) { @@ -460,7 +461,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.peer = new TLRPC.TL_inputPeerChat(); req.peer.chat_id = -lower_part; } else { - TLRPC.User user = MessagesController.Instance.users.get(uid); + TLRPC.User user = users.get(lower_part); if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { req.peer = new TLRPC.TL_inputPeerForeign(); req.peer.access_hash = user.access_hash; @@ -518,7 +519,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.peer = new TLRPC.TL_inputPeerChat(); req.peer.chat_id = -lower_part; } else { - TLRPC.User user = MessagesController.Instance.users.get(uid); + TLRPC.User user = users.get(lower_part); if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { req.peer = new TLRPC.TL_inputPeerForeign(); req.peer.access_hash = user.access_hash; @@ -562,7 +563,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter final HashMap> sectionsDict = new HashMap>(); final ArrayList sortedSectionsArray = new ArrayList(); - ContentResolver cr = Utilities.applicationContext.getContentResolver(); + ContentResolver cr = ApplicationLoader.applicationContext.getContentResolver(); String[] projectioPhones = { ContactsContract.CommonDataKinds.Phone.CONTACT_ID, @@ -594,23 +595,20 @@ public class MessagesController implements NotificationCenter.NotificationCenter contactsMap.put(id, contact); contact.id = id; } - number = number.replace(" ", "").replace("(", "").replace(")", "").replace("-", "").replace("+", ""); - if (number.startsWith("8")) { - number = "7" + number.substring(1); - } + contact.phones.add(number); if (type == ContactsContract.CommonDataKinds.Phone.TYPE_CUSTOM) { contact.phoneTypes.add(pCur.getString(3)); } else if (type == ContactsContract.CommonDataKinds.Phone.TYPE_HOME) { - contact.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneHome)); + contact.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneHome)); } else if (type == ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE) { - contact.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneMobile)); + contact.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneMobile)); } else if (type == ContactsContract.CommonDataKinds.Phone.TYPE_WORK) { - contact.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneWork)); + contact.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneWork)); } else if (type == ContactsContract.CommonDataKinds.Phone.TYPE_MAIN) { - contact.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneMain)); + contact.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneMain)); } else { - contact.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneOther)); + contact.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneOther)); } } } @@ -676,7 +674,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter imp.client_id = id; imp.first_name = value.first_name; imp.last_name = value.last_name; - imp.phone = value.phones.get(a); + imp.phone = PhoneFormat.stripExceptNumbers(value.phones.get(a)); toImport.add(imp); String str = imp.client_id + imp.first_name + imp.last_name + imp.phone; if (mdEnc != null) { @@ -747,7 +745,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (!toImport.isEmpty() && !UserConfig.importHash.equals(importHash)) { UserConfig.importHash = importHash; - UserConfig.saveConfig(); + UserConfig.saveConfig(false); importContacts(toImport); } else { loadContacts(true); @@ -774,7 +772,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter try { Uri rawContactUri = ContactsContract.RawContacts.CONTENT_URI.buildUpon().appendQueryParameter(ContactsContract.RawContacts.ACCOUNT_NAME, currentAccount.name).appendQueryParameter( ContactsContract.RawContacts.ACCOUNT_TYPE, currentAccount.type).build(); - Cursor c1 = Utilities.applicationContext.getContentResolver().query(rawContactUri, new String[]{BaseColumns._ID, ContactsContract.RawContacts.SYNC2}, null, null, null); + Cursor c1 = ApplicationLoader.applicationContext.getContentResolver().query(rawContactUri, new String[]{BaseColumns._ID, ContactsContract.RawContacts.SYNC2}, null, null, null); HashMap bookContacts = new HashMap(); if (c1 != null) { while (c1.moveToNext()) { @@ -832,7 +830,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter builder.withValue(ContactsContract.Data.DATA4, user.id); query.add(builder.build()); try { - ContentProviderResult[] result = Utilities.applicationContext.getContentResolver().applyBatch(ContactsContract.AUTHORITY, query); + ContentProviderResult[] result = ApplicationLoader.applicationContext.getContentResolver().applyBatch(ContactsContract.AUTHORITY, query); return Long.parseLong(result[0].uri.getLastPathSegment()); } catch (Exception e) { e.printStackTrace(); @@ -894,7 +892,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.peer = new TLRPC.TL_inputPeerChat(); req.peer.chat_id = -lower_part; } else { - TLRPC.User user = MessagesController.Instance.users.get(did); + TLRPC.User user = users.get(lower_part); if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { req.peer = new TLRPC.TL_inputPeerForeign(); req.peer.access_hash = user.access_hash; @@ -911,11 +909,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (res.offset > 0) { deleteDialog(did, res.offset, onlyHistory); } - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } } @@ -1057,13 +1055,13 @@ public class MessagesController implements NotificationCenter.NotificationCenter ArrayList keys = new ArrayList(printingUsers.keySet()); for (Long key : keys) { if (key > 0) { - newPrintingStrings.put(key, Html.fromHtml(String.format("%s", Utilities.applicationContext.getString(R.string.Typing)))); + newPrintingStrings.put(key, Html.fromHtml(String.format("%s", ApplicationLoader.applicationContext.getString(R.string.Typing)))); } else { ArrayList arr = printingUsers.get(key); int count = 0; String label = ""; for (PrintingUser pu : arr) { - TLRPC.User user = MessagesController.Instance.users.get(pu.userId); + TLRPC.User user = users.get(pu.userId); if (user != null) { if (label.length() != 0) { label += ", "; @@ -1078,12 +1076,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (label.length() != 0) { if (count > 1) { if (arr.size() > 2) { - newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s %s", label, String.format(Utilities.applicationContext.getString(R.string.AndMoreTyping), arr.size() - 2), Utilities.applicationContext.getString(R.string.AreTyping)))); + newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s %s", label, String.format(ApplicationLoader.applicationContext.getString(R.string.AndMoreTyping), arr.size() - 2), ApplicationLoader.applicationContext.getString(R.string.AreTyping)))); } else { - newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s", label, Utilities.applicationContext.getString(R.string.AreTyping)))); + newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s", label, ApplicationLoader.applicationContext.getString(R.string.AreTyping)))); } } else { - newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s", label, Utilities.applicationContext.getString(R.string.IsTyping)))); + newPrintingStrings.put(key, Html.fromHtml(String.format("%s %s", label, ApplicationLoader.applicationContext.getString(R.string.IsTyping)))); } } } @@ -1127,7 +1125,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter ids += aContactsArr.user_id; } UserConfig.contactsHash = Utilities.MD5(ids); - UserConfig.saveConfig(); + UserConfig.saveConfig(false); if (from == 2) { loadContacts(false); } @@ -1414,7 +1412,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void run() { for (TLRPC.User u : messagesRes.users) { if (isCache) { - users.putIfAbsent(u.id, u); + if (u.id == UserConfig.clientUserId || u.id == 333000) { + users.put(u.id, u); + } else { + users.putIfAbsent(u.id, u); + } } else { users.put(u.id, u); if (u.id == UserConfig.clientUserId) { @@ -1568,7 +1570,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void run() { for (TLRPC.User u : dialogsRes.users) { if (isCache) { - users.putIfAbsent(u.id, u); + if (u.id == UserConfig.clientUserId || u.id == 333000) { + users.put(u.id, u); + } else { + users.putIfAbsent(u.id, u); + } } else { users.put(u.id, u); if (u.id == UserConfig.clientUserId) { @@ -1632,7 +1638,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void run() { for (TLRPC.User u : dialogsRes.users) { if (isCache) { - users.putIfAbsent(u.id, u); + if (u.id == UserConfig.clientUserId || u.id == 333000) { + users.put(u.id, u); + } else { + users.putIfAbsent(u.id, u); + } } else { users.put(u.id, u); if (u.id == UserConfig.clientUserId) { @@ -1737,7 +1747,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (sizes.isEmpty()) { return null; } else { - UserConfig.saveConfig(); + UserConfig.saveConfig(false); TLRPC.TL_photo photo = new TLRPC.TL_photo(); photo.user_id = UserConfig.clientUserId; photo.date = ConnectionsManager.Instance.getCurrentTime(); @@ -1784,11 +1794,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter markDialogAsRead(dialog_id, 0, res.offset, max_date, was); } - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } } @@ -1914,7 +1924,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter newMsg.out = true; newMsg.date = ConnectionsManager.Instance.getCurrentTime(); newMsg.random_id = getNextRandomId(); - UserConfig.saveConfig(); + UserConfig.saveConfig(false); final MessageObject newMsgObj = new MessageObject(newMsg, users); newMsgObj.messageOwner.send_state = MESSAGE_SEND_STATE_SENDING; @@ -2048,7 +2058,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter newMsg.out = true; newMsg.date = ConnectionsManager.Instance.getCurrentTime(); newMsg.random_id = getNextRandomId(); - UserConfig.saveConfig(); + UserConfig.saveConfig(false); final MessageObject newMsgObj = new MessageObject(newMsg, null); newMsgObj.messageOwner.send_state = MESSAGE_SEND_STATE_SENDING; @@ -2284,6 +2294,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter } private void performSendEncryptedRequest(final TLRPC.DecryptedMessage req, final MessageObject newMsgObj, final TLRPC.EncryptedChat chat, final TLRPC.InputEncryptedFile encryptedFile) { + if (req == null) { + return; + } //TLRPC.decryptedMessageLayer messageLayer = new TLRPC.decryptedMessageLayer(); //messageLayer.layer = 8; //messageLayer.message = req; @@ -2377,11 +2390,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter if (response instanceof TLRPC.TL_messages_sentMessage) { TLRPC.TL_messages_sentMessage res = (TLRPC.TL_messages_sentMessage)response; newMsgObj.messageOwner.id = res.id; - if(UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastDateValue = res.date; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); + if(MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastDateValue = res.date; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } else { getDifference(); } @@ -2390,11 +2403,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter sendedMessages.add(res.message); newMsgObj.messageOwner.id = res.message.id; processSendedMessage(newMsgObj.messageOwner, res.message, null, null); - if(UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.lastDateValue = res.message.date; - UserConfig.saveConfig(); + if(MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.lastDateValue = res.message.date; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } else { getDifference(); } @@ -2406,10 +2419,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter sendedMessages.add(message); processSendedMessage(newMsgObj.messageOwner, message, null, null); } - if(UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); + if(MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } else { getDifference(); } @@ -2524,7 +2537,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter newContactBook.phones = new ArrayList(); newContactBook.phones.add(user.phone); newContactBook.phoneTypes = new ArrayList(); - newContactBook.phoneTypes.add(Utilities.applicationContext.getString(R.string.PhoneMobile)); + newContactBook.phoneTypes.add(ApplicationLoader.applicationContext.getString(R.string.PhoneMobile)); contactsMapBook.put((int)bookId, newContactBook); String contactsImportHash = ""; @@ -2715,7 +2728,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } UserConfig.contactsHash = Utilities.MD5(ids); UserConfig.importHash = importHash; - UserConfig.saveConfig(); + UserConfig.saveConfig(false); MessagesStorage.Instance.putContacts(contactsArr, true); ArrayList users = new ArrayList(); @@ -2816,7 +2829,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter TLRPC.TL_messages_createChat req = new TLRPC.TL_messages_createChat(); req.title = title; for (Integer uid : selectedContacts) { - TLRPC.User user = MessagesController.Instance.users.get(uid); + TLRPC.User user = users.get(uid); TLRPC.InputUser inputUser; if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { inputUser = new TLRPC.TL_inputUserForeign(); @@ -2845,11 +2858,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter final ArrayList messages = new ArrayList(); messages.add(res.message); MessagesStorage.Instance.putMessages(messages, true, true); - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } Utilities.RunOnUIThread(new Runnable() { @@ -2883,7 +2896,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter TLRPC.TL_messages_addChatUser req = new TLRPC.TL_messages_addChatUser(); req.chat_id = chat_id; req.fwd_limit = 50; - TLRPC.User user = MessagesController.Instance.users.get(user_id); + TLRPC.User user = users.get(user_id); if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { req.user_id = new TLRPC.TL_inputUserForeign(); req.user_id.user_id = user.id; @@ -2904,11 +2917,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter final ArrayList messages = new ArrayList(); messages.add(res.message); MessagesStorage.Instance.putMessages(messages, true, true); - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } @@ -2954,7 +2967,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void deleteUserFromChat(int chat_id, final int user_id, final TLRPC.ChatParticipants info) { TLRPC.TL_messages_deleteChatUser req = new TLRPC.TL_messages_deleteChatUser(); req.chat_id = chat_id; - TLRPC.User user = MessagesController.Instance.users.get(user_id); + TLRPC.User user = users.get(user_id); if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { req.user_id = new TLRPC.TL_inputUserForeign(); req.user_id.user_id = user.id; @@ -2978,11 +2991,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter messages.add(res.message); MessagesStorage.Instance.putMessages(messages, true, true); } - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } @@ -3042,11 +3055,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter final ArrayList messages = new ArrayList(); messages.add(res.message); MessagesStorage.Instance.putMessages(messages, true, true); - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } @@ -3095,11 +3108,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter final ArrayList messages = new ArrayList(); messages.add(res.message); MessagesStorage.Instance.putMessages(messages, true, true); - if (UserConfig.lastSeqValue + 1 == res.seq) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastPtsValue = res.pts; - UserConfig.saveConfig(); - } else if (UserConfig.lastSeqValue != res.seq) { + if (MessagesStorage.lastSeqValue + 1 == res.seq) { + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); + } else if (MessagesStorage.lastSeqValue != res.seq) { getDifference(); } @@ -3168,7 +3181,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter req.device_model = "Android unknown"; } req.system_version = "SDK " + Build.VERSION.SDK_INT; - PackageInfo pInfo = Utilities.applicationContext.getPackageManager().getPackageInfo(Utilities.applicationContext.getPackageName(), 0); + PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); req.app_version = pInfo.versionName; if (req.app_version == null) { req.app_version = "App version unknown"; @@ -3186,7 +3199,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter Log.e("tmessages", "registered for push"); UserConfig.registeredForPush = true; UserConfig.pushString = regid; - UserConfig.saveConfig(); + UserConfig.saveConfig(false); } Utilities.RunOnUIThread(new Runnable() { @Override @@ -3211,11 +3224,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter updatingState = false; if (error == null) { TLRPC.TL_updates_state res = (TLRPC.TL_updates_state)response; - UserConfig.lastDateValue = res.date; - UserConfig.lastPtsValue = res.pts; - UserConfig.lastSeqValue = res.seq; - UserConfig.lastQtsValue = res.qts; - UserConfig.saveConfig(); + MessagesStorage.lastDateValue = res.date; + MessagesStorage.lastPtsValue = res.pts; + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastQtsValue = res.qts; + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } else { loadCurrentState(); } @@ -3225,7 +3238,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void getDifference() { registerForPush(UserConfig.pushString); - if (UserConfig.lastDateValue == 0) { + if (MessagesStorage.lastDateValue == 0) { loadCurrentState(); return; } @@ -3238,9 +3251,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter } gettingDifference = true; TLRPC.TL_updates_getDifference req = new TLRPC.TL_updates_getDifference(); - req.pts = UserConfig.lastPtsValue; - req.date = UserConfig.lastDateValue; - req.qts = UserConfig.lastQtsValue; + req.pts = MessagesStorage.lastPtsValue; + req.date = MessagesStorage.lastDateValue; + req.qts = MessagesStorage.lastQtsValue; if (ConnectionsManager.Instance.connectionState == 0) { ConnectionsManager.Instance.connectionState = 3; final int stateCopy = ConnectionsManager.Instance.connectionState; @@ -3373,10 +3386,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter } if (res instanceof TLRPC.TL_updates_difference) { - UserConfig.lastSeqValue = res.state.seq; - UserConfig.lastDateValue = res.state.date; - UserConfig.lastPtsValue = res.state.pts; - UserConfig.lastQtsValue = res.state.qts; + MessagesStorage.lastSeqValue = res.state.seq; + MessagesStorage.lastDateValue = res.state.date; + MessagesStorage.lastPtsValue = res.state.pts; + MessagesStorage.lastQtsValue = res.state.qts; ConnectionsManager.Instance.connectionState = 0; final int stateCopy = ConnectionsManager.Instance.connectionState; Utilities.RunOnUIThread(new Runnable() { @@ -3386,14 +3399,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter } }); } else if (res instanceof TLRPC.TL_updates_differenceSlice) { - UserConfig.lastSeqValue = res.intermediate_state.seq; - UserConfig.lastDateValue = res.intermediate_state.date; - UserConfig.lastPtsValue = res.intermediate_state.pts; - UserConfig.lastQtsValue = res.intermediate_state.qts; + MessagesStorage.lastSeqValue = res.intermediate_state.seq; + MessagesStorage.lastDateValue = res.intermediate_state.date; + MessagesStorage.lastPtsValue = res.intermediate_state.pts; + MessagesStorage.lastQtsValue = res.intermediate_state.qts; getDifference(); } else if (res instanceof TLRPC.TL_updates_differenceEmpty) { - UserConfig.lastSeqValue = res.seq; - UserConfig.lastDateValue = res.date; + MessagesStorage.lastSeqValue = res.seq; + MessagesStorage.lastDateValue = res.date; ConnectionsManager.Instance.connectionState = 0; final int stateCopy = ConnectionsManager.Instance.connectionState; Utilities.RunOnUIThread(new Runnable() { @@ -3403,14 +3416,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter } }); } - UserConfig.saveConfig(); + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } }); } }); if (ConnectionsManager.DEBUG_VERSION) { - Log.e("tmessages", "received defference with date = " + UserConfig.lastDateValue + " pts = " + UserConfig.lastPtsValue + " seq = " + UserConfig.lastSeqValue); + Log.e("tmessages", "received defference with date = " + MessagesStorage.lastDateValue + " pts = " + MessagesStorage.lastPtsValue + " seq = " + MessagesStorage.lastSeqValue); Log.e("tmessages", "messages = " + res.new_messages.size() + " users = " + res.users.size() + " chats = " + res.chats.size() + " other updates = " + res.other_updates.size()); } } else { @@ -3429,7 +3442,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter arr.add(updates.update); processUpdateArray(arr, null, null); } else if (updates instanceof TLRPC.TL_updateShortChatMessage) { - if (UserConfig.lastSeqValue + 1 == updates.seq && chats.get(updates.chat_id) != null && users.get(updates.from_id) != null) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq && chats.get(updates.chat_id) != null && users.get(updates.from_id) != null) { TLRPC.TL_message message = new TLRPC.TL_message(); message.from_id = updates.from_id; message.id = updates.id; @@ -3439,8 +3452,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter message.date = updates.date; message.unread = true; message.media = new TLRPC.TL_messageMediaEmpty(); - UserConfig.lastSeqValue = updates.seq; - UserConfig.lastPtsValue = updates.pts; + MessagesStorage.lastSeqValue = updates.seq; + MessagesStorage.lastPtsValue = updates.pts; final MessageObject obj = new MessageObject(message, null); final ArrayList objArr = new ArrayList(); objArr.add(obj); @@ -3477,7 +3490,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter needGetDiff = true; } } else if (updates instanceof TLRPC.TL_updateShortMessage) { - if (UserConfig.lastSeqValue + 1 == updates.seq && users.get(updates.from_id) != null) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq && users.get(updates.from_id) != null) { TLRPC.TL_message message = new TLRPC.TL_message(); message.from_id = updates.from_id; message.id = updates.id; @@ -3487,9 +3500,9 @@ public class MessagesController implements NotificationCenter.NotificationCenter message.date = updates.date; message.unread = true; message.media = new TLRPC.TL_messageMediaEmpty(); - UserConfig.lastSeqValue = updates.seq; - UserConfig.lastPtsValue = updates.pts; - UserConfig.lastDateValue = updates.date; + MessagesStorage.lastSeqValue = updates.seq; + MessagesStorage.lastPtsValue = updates.pts; + MessagesStorage.lastDateValue = updates.date; final MessageObject obj = new MessageObject(message, null); final ArrayList objArr = new ArrayList(); objArr.add(obj); @@ -3526,18 +3539,18 @@ public class MessagesController implements NotificationCenter.NotificationCenter needGetDiff = true; } } else if (updates instanceof TLRPC.TL_updatesCombined) { - if (UserConfig.lastSeqValue + 1 == updates.seq_start || updates.seq_start == 0 || UserConfig.lastSeqValue == updates.seq_start) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq_start || updates.seq_start == 0 || MessagesStorage.lastSeqValue == updates.seq_start) { MessagesStorage.Instance.putUsersAndChats(updates.users, updates.chats, true, true); - int lastPtsValue = UserConfig.lastPtsValue; - int lastQtsValue = UserConfig.lastQtsValue; + int lastPtsValue = MessagesStorage.lastPtsValue; + int lastQtsValue = MessagesStorage.lastQtsValue; if (!processUpdateArray(updates.updates, updates.users, updates.chats)) { - UserConfig.lastPtsValue = lastPtsValue; - UserConfig.lastQtsValue = lastQtsValue; + MessagesStorage.lastPtsValue = lastPtsValue; + MessagesStorage.lastQtsValue = lastQtsValue; needGetDiff = true; } else { - UserConfig.lastDateValue = updates.date; - UserConfig.lastSeqValue = updates.seq; - if (UserConfig.lastQtsValue != lastQtsValue) { + MessagesStorage.lastDateValue = updates.date; + MessagesStorage.lastSeqValue = updates.seq; + if (MessagesStorage.lastQtsValue != lastQtsValue) { needReceivedQueue = true; } } @@ -3545,18 +3558,18 @@ public class MessagesController implements NotificationCenter.NotificationCenter needGetDiff = true; } } else if (updates instanceof TLRPC.TL_updates) { - if (UserConfig.lastSeqValue + 1 == updates.seq || updates.seq == 0 || updates.seq == UserConfig.lastSeqValue) { + if (MessagesStorage.lastSeqValue + 1 == updates.seq || updates.seq == 0 || updates.seq == MessagesStorage.lastSeqValue) { MessagesStorage.Instance.putUsersAndChats(updates.users, updates.chats, true, true); - int lastPtsValue = UserConfig.lastPtsValue; - int lastQtsValue = UserConfig.lastQtsValue; + int lastPtsValue = MessagesStorage.lastPtsValue; + int lastQtsValue = MessagesStorage.lastQtsValue; if (!processUpdateArray(updates.updates, updates.users, updates.chats)) { needGetDiff = true; - UserConfig.lastPtsValue = lastPtsValue; - UserConfig.lastQtsValue = lastQtsValue; + MessagesStorage.lastPtsValue = lastPtsValue; + MessagesStorage.lastQtsValue = lastQtsValue; } else { - UserConfig.lastDateValue = updates.date; - UserConfig.lastSeqValue = updates.seq; - if (UserConfig.lastQtsValue != lastQtsValue) { + MessagesStorage.lastDateValue = updates.date; + MessagesStorage.lastSeqValue = updates.seq; + if (MessagesStorage.lastQtsValue != lastQtsValue) { needReceivedQueue = true; } } @@ -3571,7 +3584,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } if (needReceivedQueue) { TLRPC.TL_messages_receivedQueue req = new TLRPC.TL_messages_receivedQueue(); - req.max_qts = UserConfig.lastQtsValue; + req.max_qts = MessagesStorage.lastQtsValue; ConnectionsManager.Instance.performRpc(req, new RPCRequest.RPCRequestDelegate() { @Override public void run(TLObject response, TLRPC.TL_error error) { @@ -3579,7 +3592,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } }, null, true, RPCRequest.RPCRequestClassGeneric); } - UserConfig.saveConfig(); + MessagesStorage.Instance.saveDiffParams(MessagesStorage.lastSeqValue, MessagesStorage.lastPtsValue, MessagesStorage.lastDateValue, MessagesStorage.lastQtsValue); } public boolean processUpdateArray(ArrayList updates, final ArrayList usersArr, final ArrayList chatsArr) { @@ -3653,7 +3666,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter messages.put(uid, arr); } arr.add(obj); - UserConfig.lastPtsValue = update.pts; + MessagesStorage.lastPtsValue = update.pts; if (upd.message.from_id != UserConfig.clientUserId && upd.message.to_id != null) { if (uid != openned_dialog_id) { lastMessage = obj; @@ -3663,12 +3676,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter //can't be here } else if (update instanceof TLRPC.TL_updateReadMessages) { markAsReadMessages.addAll(update.messages); - UserConfig.lastPtsValue = update.pts; + MessagesStorage.lastPtsValue = update.pts; } else if (update instanceof TLRPC.TL_updateDeleteMessages) { deletedMessages.addAll(update.messages); - UserConfig.lastPtsValue = update.pts; + MessagesStorage.lastPtsValue = update.pts; } else if (update instanceof TLRPC.TL_updateRestoreMessages) { - UserConfig.lastPtsValue = update.pts; + MessagesStorage.lastPtsValue = update.pts; } else if (update instanceof TLRPC.TL_updateUserTyping || update instanceof TLRPC.TL_updateChatUserTyping) { if (update.user_id != UserConfig.clientUserId) { long uid = -update.chat_id; @@ -3727,7 +3740,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } else if (update instanceof TLRPC.TL_updateNewGeoChatMessage) { //TODO } else if (update instanceof TLRPC.TL_updateNewEncryptedMessage) { - UserConfig.lastQtsValue = update.qts; + MessagesStorage.lastQtsValue = update.qts; TLRPC.Message message = decryptMessage(((TLRPC.TL_updateNewEncryptedMessage)update).message); if (message != null) { int cid = ((TLRPC.TL_updateNewEncryptedMessage)update).message.chat_id; @@ -3852,7 +3865,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } }); MessagesStorage.Instance.putEncryptedChat(newChat, user, dialog); - MessagesController.Instance.acceptSecretChat(newChat); + acceptSecretChat(newChat); } else if (newChat instanceof TLRPC.TL_encryptedChat) { if (existingChat != null && existingChat instanceof TLRPC.TL_encryptedChatWaiting && (existingChat.auth_key == null || existingChat.auth_key.length == 1)) { newChat.a_or_b = existingChat.a_or_b; @@ -4101,7 +4114,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } private void showInAppNotification(MessageObject messageObject) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Context.MODE_PRIVATE); boolean globalEnabled = preferences.getBoolean("EnableAll", true); if (!globalEnabled) { return; @@ -4157,7 +4170,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter NotificationCenter.Instance.postNotificationName(701, messageObject); } if (inAppVibrate) { - Vibrator v = (Vibrator)Utilities.applicationContext.getSystemService(Context.VIBRATOR_SERVICE); + Vibrator v = (Vibrator)ApplicationLoader.applicationContext.getSystemService(Context.VIBRATOR_SERVICE); v.vibrate(100); } if (inAppSounds) { @@ -4206,8 +4219,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter String userSoundPath = null; String chatSoundPath = null; - NotificationManager mNotificationManager = (NotificationManager)Utilities.applicationContext.getSystemService(Context.NOTIFICATION_SERVICE); - Intent intent = new Intent(Utilities.applicationContext, LaunchActivity.class); + NotificationManager mNotificationManager = (NotificationManager)ApplicationLoader.applicationContext.getSystemService(Context.NOTIFICATION_SERVICE); + Intent intent = new Intent(ApplicationLoader.applicationContext, LaunchActivity.class); String msg; if ((int)dialog_id != 0) { @@ -4219,7 +4232,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } msg = messageObject.messageOwner.message; } else { - msg = Utilities.applicationContext.getString(R.string.YouHaveNewMessage); + msg = ApplicationLoader.applicationContext.getString(R.string.YouHaveNewMessage); } boolean needVibrate = false; @@ -4253,10 +4266,10 @@ public class MessagesController implements NotificationCenter.NotificationCenter intent.setAction("com.tmessages.openchat" + Math.random() + Integer.MAX_VALUE); intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); - PendingIntent contentIntent = PendingIntent.getActivity(Utilities.applicationContext, 0, intent, PendingIntent.FLAG_ONE_SHOT); + PendingIntent contentIntent = PendingIntent.getActivity(ApplicationLoader.applicationContext, 0, intent, PendingIntent.FLAG_ONE_SHOT); - NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(Utilities.applicationContext) - .setContentTitle(Utilities.applicationContext.getString(R.string.AppName)) + NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(ApplicationLoader.applicationContext) + .setContentTitle(ApplicationLoader.applicationContext.getString(R.string.AppName)) .setSmallIcon(R.drawable.notification) .setStyle(new NotificationCompat.BigTextStyle() .bigText(msg)) @@ -4486,7 +4499,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter public void processAcceptedSecretChat(final TLRPC.EncryptedChat encryptedChat) { BigInteger i_authKey = new BigInteger(1, encryptedChat.g_a_or_b); - i_authKey = i_authKey.modPow(new BigInteger(1, encryptedChat.a_or_b), new BigInteger(1, UserConfig.secretPBytes)); + i_authKey = i_authKey.modPow(new BigInteger(1, encryptedChat.a_or_b), new BigInteger(1, MessagesStorage.secretPBytes)); byte[] authKey = i_authKey.toByteArray(); if (authKey.length > 256) { @@ -4553,25 +4566,25 @@ public class MessagesController implements NotificationCenter.NotificationCenter acceptingChats.put(encryptedChat.id, encryptedChat); TLRPC.TL_messages_getDhConfig req = new TLRPC.TL_messages_getDhConfig(); req.random_length = 256; - req.version = UserConfig.lastSecretVersion; + req.version = MessagesStorage.lastSecretVersion; ConnectionsManager.Instance.performRpc(req, new RPCRequest.RPCRequestDelegate() { @Override public void run(TLObject response, TLRPC.TL_error error) { if (error == null) { TLRPC.messages_DhConfig res = (TLRPC.messages_DhConfig)response; if (response instanceof TLRPC.TL_messages_dhConfig) { - UserConfig.secretPBytes = res.p; - UserConfig.secretG = res.g; - UserConfig.lastSecretVersion = res.version; - UserConfig.saveConfig(); + MessagesStorage.secretPBytes = res.p; + MessagesStorage.secretG = res.g; + MessagesStorage.lastSecretVersion = res.version; + MessagesStorage.Instance.saveSecretParams(MessagesStorage.lastSecretVersion, MessagesStorage.secretG, MessagesStorage.secretPBytes); } byte[] salt = new byte[256]; for (int a = 0; a < 256; a++) { salt[a] = (byte)((byte)(random.nextDouble() * 255) ^ res.random[a]); } encryptedChat.a_or_b = salt; - BigInteger i_g_b = BigInteger.valueOf(UserConfig.secretG); - i_g_b = i_g_b.modPow(new BigInteger(1, salt), new BigInteger(1, UserConfig.secretPBytes)); + BigInteger i_g_b = BigInteger.valueOf(MessagesStorage.secretG); + i_g_b = i_g_b.modPow(new BigInteger(1, salt), new BigInteger(1, MessagesStorage.secretPBytes)); byte[] g_b = i_g_b.toByteArray(); if (g_b.length > 256) { byte[] correctedAuth = new byte[256]; @@ -4580,7 +4593,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter } BigInteger i_authKey = new BigInteger(1, encryptedChat.g_a); - i_authKey = i_authKey.modPow(new BigInteger(1, salt), new BigInteger(1, UserConfig.secretPBytes)); + i_authKey = i_authKey.modPow(new BigInteger(1, salt), new BigInteger(1, MessagesStorage.secretPBytes)); byte[] authKey = i_authKey.toByteArray(); if (authKey.length > 256) { @@ -4643,24 +4656,24 @@ public class MessagesController implements NotificationCenter.NotificationCenter progressDialog.show(); TLRPC.TL_messages_getDhConfig req = new TLRPC.TL_messages_getDhConfig(); req.random_length = 256; - req.version = UserConfig.lastSecretVersion; + req.version = MessagesStorage.lastSecretVersion; ConnectionsManager.Instance.performRpc(req, new RPCRequest.RPCRequestDelegate() { @Override public void run(TLObject response, TLRPC.TL_error error) { if (error == null) { TLRPC.messages_DhConfig res = (TLRPC.messages_DhConfig)response; if (response instanceof TLRPC.TL_messages_dhConfig) { - UserConfig.secretPBytes = res.p; - UserConfig.secretG = res.g; - UserConfig.lastSecretVersion = res.version; - UserConfig.saveConfig(); + MessagesStorage.secretPBytes = res.p; + MessagesStorage.secretG = res.g; + MessagesStorage.lastSecretVersion = res.version; + MessagesStorage.Instance.saveSecretParams(MessagesStorage.lastSecretVersion, MessagesStorage.secretG, MessagesStorage.secretPBytes); } final byte[] salt = new byte[256]; for (int a = 0; a < 256; a++) { salt[a] = (byte)((byte)(random.nextDouble() * 255) ^ res.random[a]); } - BigInteger i_g_a = BigInteger.valueOf(UserConfig.secretG); - i_g_a = i_g_a.modPow(new BigInteger(1, salt), new BigInteger(1, UserConfig.secretPBytes)); + BigInteger i_g_a = BigInteger.valueOf(MessagesStorage.secretG); + i_g_a = i_g_a.modPow(new BigInteger(1, salt), new BigInteger(1, MessagesStorage.secretPBytes)); byte[] g_a = i_g_a.toByteArray(); if (g_a.length > 256) { byte[] correctedAuth = new byte[256]; @@ -4668,7 +4681,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter g_a = correctedAuth; } - final TLRPC.User user = MessagesController.Instance.users.get(user_id); + final TLRPC.User user = users.get(user_id); TLRPC.InputUser inputUser; if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) { inputUser = new TLRPC.TL_inputUserForeign(); @@ -4735,7 +4748,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle(context.getString(R.string.AppName)); builder.setMessage(String.format(context.getString(R.string.CreateEncryptedChatOutdatedError), user.first_name, user.first_name)); - builder.setPositiveButton(Utilities.applicationContext.getString(R.string.OK), null); + builder.setPositiveButton(ApplicationLoader.applicationContext.getString(R.string.OK), null); builder.show().setCanceledOnTouchOutside(true); } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java index ed4896eb..bf0ffb5a 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesStorage.java @@ -17,6 +17,7 @@ import org.telegram.SQLite.SQLitePreparedStatement; import org.telegram.TL.TLClassStore; import org.telegram.TL.TLObject; import org.telegram.TL.TLRPC; +import org.telegram.ui.ApplicationLoader; import java.io.File; import java.util.ArrayList; @@ -28,6 +29,13 @@ public class MessagesStorage { public DispatchQueue storageQueue = new DispatchQueue("storageQueue"); private SQLiteDatabase database; private File cacheFile; + public static int lastDateValue = 0; + public static int lastPtsValue = 0; + public static int lastQtsValue = 0; + public static int lastSeqValue = 0; + public static int lastSecretVersion = 0; + public static byte[] secretPBytes = null; + public static int secretG = 0; public static final int wallpapersDidLoaded = 171; public static MessagesStorage Instance = new MessagesStorage(); @@ -38,7 +46,7 @@ public class MessagesStorage { } public void openDatabase() { - cacheFile = new File(Utilities.applicationContext.getFilesDir(), "cache4.db"); + cacheFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "cache4.db"); boolean createTable = false; //cacheFile.delete(); if (!cacheFile.exists()) { @@ -60,6 +68,8 @@ public class MessagesStorage { database.executeFast("CREATE TABLE wallpapers(uid INTEGER PRIMARY KEY, data BLOB)").stepThis().dispose(); database.executeFast("CREATE TABLE randoms(random_id INTEGER PRIMARY KEY, mid INTEGER)").stepThis().dispose(); database.executeFast("CREATE TABLE enc_tasks(date INTEGER, data BLOB)").stepThis().dispose(); + database.executeFast("CREATE TABLE params(id INTEGER PRIMARY KEY, seq INTEGER, pts INTEGER, date INTEGER, qts INTEGER, lsv INTEGER, sg INTEGER, pbytes BLOB)").stepThis().dispose(); + database.executeFast("INSERT INTO params VALUES(1, 0, 0, 0, 0, 0, 0, NULL)").stepThis().dispose(); database.executeFast("CREATE INDEX IF NOT EXISTS date_idx_dialogs ON dialogs(date);").stepThis().dispose(); database.executeFast("CREATE INDEX IF NOT EXISTS date_idx_enc_tasks ON enc_tasks(date);").stepThis().dispose(); @@ -69,6 +79,41 @@ public class MessagesStorage { database.executeFast("CREATE INDEX IF NOT EXISTS uid_mid_idx_media ON media(uid, mid);").stepThis().dispose(); database.executeFast("CREATE INDEX IF NOT EXISTS ttl_idx_messages ON messages(ttl);").stepThis().dispose(); database.executeFast("CREATE INDEX IF NOT EXISTS read_state_out_idx_messages ON messages(read_state, out);").stepThis().dispose(); + } else { + SQLiteCursor cursor = database.queryFinalized("SELECT count(*) FROM sqlite_master WHERE type='table' AND name='params'"); + boolean create = false; + if (cursor.next()) { + int count = cursor.intValue(0); + if (count == 0) { + create = true; + } + } else { + create = true; + } + cursor.dispose(); + if (create) { + database.executeFast("CREATE TABLE params(id INTEGER PRIMARY KEY, seq INTEGER, pts INTEGER, date INTEGER, qts INTEGER, lsv INTEGER, sg INTEGER, pbytes BLOB)").stepThis().dispose(); + database.executeFast("INSERT INTO params VALUES(1, 0, 0, 0, 0, 0, 0, NULL)").stepThis().dispose(); + } else { + cursor = database.queryFinalized("SELECT seq, pts, date, qts, lsv, sg, pbytes FROM params WHERE id = 1"); + if (cursor.next()) { + lastSeqValue = cursor.intValue(0); + lastPtsValue = cursor.intValue(1); + lastDateValue = cursor.intValue(2); + lastQtsValue = cursor.intValue(3); + lastSecretVersion = cursor.intValue(4); + secretG = cursor.intValue(5); + if (cursor.isNull(6)) { + secretPBytes = null; + } else { + secretPBytes = cursor.byteArrayValue(6); + if (secretPBytes != null && secretPBytes.length == 1) { + secretPBytes = null; + } + } + } + cursor.dispose(); + } } } catch (Exception e) { e.printStackTrace(); @@ -79,6 +124,13 @@ public class MessagesStorage { storageQueue.postRunnable(new Runnable() { @Override public void run() { + lastDateValue = 0; + lastSeqValue = 0; + lastPtsValue = 0; + lastQtsValue = 0; + lastSecretVersion = 0; + secretPBytes = null; + secretG = 0; if (database != null) { database.close(); database = null; @@ -88,15 +140,15 @@ public class MessagesStorage { cacheFile = null; } try { - File old = new File(Utilities.applicationContext.getFilesDir(), "cache.db"); + File old = new File(ApplicationLoader.applicationContext.getFilesDir(), "cache.db"); if (old.exists()) { old.delete(); } - old = new File(Utilities.applicationContext.getFilesDir(), "cache2.db"); + old = new File(ApplicationLoader.applicationContext.getFilesDir(), "cache2.db"); if (old.exists()) { old.delete(); } - old = new File(Utilities.applicationContext.getFilesDir(), "cache3.db"); + old = new File(ApplicationLoader.applicationContext.getFilesDir(), "cache3.db"); if (old.exists()) { old.delete(); } @@ -108,6 +160,47 @@ public class MessagesStorage { }); } + public void saveSecretParams(final int lsv, final int sg, final byte[] pbytes) { + storageQueue.postRunnable(new Runnable() { + @Override + public void run() { + try { + SQLitePreparedStatement state = database.executeFast("UPDATE params SET lsv = ?, sg = ?, pbytes = ? WHERE id = 1"); + state.bindInteger(1, lsv); + state.bindInteger(2, sg); + if (pbytes != null) { + state.bindByteArray(3, pbytes); + } else { + state.bindByteArray(3, new byte[1]); + } + state.step(); + state.dispose(); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + + public void saveDiffParams(final int seq, final int pts, final int date, final int qts) { + storageQueue.postRunnable(new Runnable() { + @Override + public void run() { + try { + SQLitePreparedStatement state = database.executeFast("UPDATE params SET seq = ?, pts = ?, date = ?, qts = ? WHERE id = 1"); + state.bindInteger(1, seq); + state.bindInteger(2, pts); + state.bindInteger(3, date); + state.bindInteger(4, qts); + state.step(); + state.dispose(); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + } + public void putWallpapers(final ArrayList wallPapers) { storageQueue.postRunnable(new Runnable() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java b/TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java index 1c5b14a3..17f9e519 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/UserConfig.java @@ -8,8 +8,12 @@ package org.telegram.messenger; +import android.content.Context; +import android.content.SharedPreferences; + import org.telegram.TL.TLClassStore; import org.telegram.TL.TLRPC; +import org.telegram.ui.ApplicationLoader; import java.io.File; import java.io.FileOutputStream; @@ -18,17 +22,10 @@ public class UserConfig { public static TLRPC.User currentUser; public static int clientUserId = 0; public static boolean clientActivated = false; - public static int lastDateValue = 0; - public static int lastPtsValue = 0; - public static int lastQtsValue = 0; - public static int lastSeqValue = 0; public static boolean registeredForPush = false; public static String pushString = ""; public static int lastSendMessageId = -1; public static int lastLocalId = -1; - public static int lastSecretVersion = 0; - public static byte[] secretPBytes = null; - public static int secretG = 0; public static String contactsHash = ""; public static String importHash = ""; private final static Integer sync = 1; @@ -43,64 +40,58 @@ public class UserConfig { return id; } - public static void saveConfig() { + public static void saveConfig(boolean withFile) { synchronized (sync) { SerializedData data = new SerializedData(); if (currentUser != null) { - data.writeInt32(1); + data.writeInt32(2); currentUser.serializeToStream(data); clientUserId = currentUser.id; clientActivated = true; - data.writeInt32(lastDateValue); - data.writeInt32(lastPtsValue); - data.writeInt32(lastSeqValue); - data.writeBool(registeredForPush); - data.writeString(pushString); - data.writeInt32(lastSendMessageId); - data.writeInt32(lastLocalId); - data.writeString(contactsHash); - data.writeString(importHash); - data.writeBool(saveIncomingPhotos); - data.writeInt32(lastQtsValue); - data.writeInt32(lastSecretVersion); - if (secretPBytes != null) { - data.writeInt32(1); - data.writeByteArray(secretPBytes); - } else { - data.writeInt32(0); - } - data.writeInt32(secretG); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("userconfing", Context.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean("registeredForPush", registeredForPush); + editor.putString("pushString", pushString); + editor.putInt("lastSendMessageId", lastSendMessageId); + editor.putInt("lastLocalId", lastLocalId); + editor.putString("contactsHash", contactsHash); + editor.putString("importHash", importHash); + editor.putBoolean("saveIncomingPhotos", saveIncomingPhotos); + editor.commit(); } else { data.writeInt32(0); } - try { - File configFile = new File(Utilities.applicationContext.getFilesDir(), "user.dat"); - if (!configFile.exists()) { - configFile.createNewFile(); + if (withFile) { + try { + File configFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "user.dat"); + if (!configFile.exists()) { + configFile.createNewFile(); + } + FileOutputStream stream = new FileOutputStream(configFile); + stream.write(data.toByteArray()); + stream.close(); + } catch (Exception e) { + e.printStackTrace(); } - FileOutputStream stream = new FileOutputStream(configFile); - stream.write(data.toByteArray()); - stream.close(); - } catch (Exception e) { - e.printStackTrace(); } } } public static void loadConfig() { synchronized (sync) { - File configFile = new File(Utilities.applicationContext.getFilesDir(), "user.dat"); + File configFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "user.dat"); if (configFile.exists()) { try { SerializedData data = new SerializedData(configFile); - if (data.readInt32() != 0) { + int ver = data.readInt32(); + if (ver == 1) { int constructor = data.readInt32(); currentUser = (TLRPC.TL_userSelf)TLClassStore.Instance().TLdeserialize(data, constructor); clientUserId = currentUser.id; clientActivated = true; - lastDateValue = data.readInt32(); - lastPtsValue = data.readInt32(); - lastSeqValue = data.readInt32(); + MessagesStorage.lastDateValue = data.readInt32(); + MessagesStorage.lastPtsValue = data.readInt32(); + MessagesStorage.lastSeqValue = data.readInt32(); registeredForPush = data.readBool(); pushString = data.readString(); lastSendMessageId = data.readInt32(); @@ -115,13 +106,27 @@ public class UserConfig { currentUser.status.expires = currentUser.status.was_online; } } - lastQtsValue = data.readInt32(); - lastSecretVersion = data.readInt32(); + MessagesStorage.lastQtsValue = data.readInt32(); + MessagesStorage.lastSecretVersion = data.readInt32(); int val = data.readInt32(); if (val == 1) { - secretPBytes = data.readByteArray(); + MessagesStorage.secretPBytes = data.readByteArray(); } - secretG = data.readInt32(); + MessagesStorage.secretG = data.readInt32(); + } else if (ver == 2) { + int constructor = data.readInt32(); + currentUser = (TLRPC.TL_userSelf)TLClassStore.Instance().TLdeserialize(data, constructor); + clientUserId = currentUser.id; + clientActivated = true; + + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("userconfing", Context.MODE_PRIVATE); + registeredForPush = preferences.getBoolean("registeredForPush", false); + pushString = preferences.getString("pushString", ""); + lastSendMessageId = preferences.getInt("lastSendMessageId", -1); + lastLocalId = preferences.getInt("lastLocalId", -1); + contactsHash = preferences.getString("contactsHash", ""); + importHash = preferences.getString("importHash", ""); + saveIncomingPhotos = preferences.getBoolean("saveIncomingPhotos", false); } } catch (Exception e) { e.printStackTrace(); @@ -134,15 +139,12 @@ public class UserConfig { clientUserId = 0; clientActivated = false; currentUser = null; - lastDateValue = 0; - lastSeqValue = 0; - lastPtsValue = 0; registeredForPush = false; contactsHash = ""; lastLocalId = -1; importHash = ""; lastSendMessageId = -1; saveIncomingPhotos = false; - saveConfig(); + saveConfig(true); } } diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java index 85559499..5918636a 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java @@ -18,6 +18,7 @@ import android.os.Environment; import android.os.Handler; import android.text.Html; import android.text.SpannableStringBuilder; +import android.text.format.DateFormat; import android.util.AttributeSet; import android.util.Log; import android.view.View; @@ -25,6 +26,7 @@ import android.view.inputmethod.InputMethodManager; import org.telegram.TL.TLClassStore; import org.telegram.TL.TLObject; +import org.telegram.ui.ApplicationLoader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; @@ -50,7 +52,6 @@ import java.util.zip.GZIPInputStream; import javax.crypto.Cipher; public class Utilities { - public static Context applicationContext; public static Handler applicationHandler; private final static Integer lock = 1; @@ -77,10 +78,10 @@ public class Utilities { public static File getCacheDir() { if (externalCacheNotAvailableState == 1 || externalCacheNotAvailableState == 0 && Environment.getExternalStorageState().startsWith(Environment.MEDIA_MOUNTED)) { externalCacheNotAvailableState = 1; - return applicationContext.getExternalCacheDir(); + return ApplicationLoader.applicationContext.getExternalCacheDir(); } externalCacheNotAvailableState = 2; - return applicationContext.getCacheDir(); + return ApplicationLoader.applicationContext.getCacheDir(); } public static TPFactorizedValue getFactorizedValue(long what) { @@ -230,7 +231,7 @@ public class Utilities { synchronized (cache) { if (!cache.containsKey(assetPath)) { try { - Typeface t = Typeface.createFromAsset(applicationContext.getAssets(), + Typeface t = Typeface.createFromAsset(ApplicationLoader.applicationContext.getAssets(), assetPath); cache.put(assetPath, t); } catch (Exception e) { @@ -304,11 +305,19 @@ public class Utilities { formatterYearMax = FastDateFormat.getInstance("dd.MM.yyyy", locale); chatDate = FastDateFormat.getInstance("d MMMM", locale); chatFullDate = FastDateFormat.getInstance("d MMMM yyyy", locale); - if (lang != null && lang.toLowerCase().equals("ar")) { - formatterDay = FastDateFormat.getInstance("h:mm a", locale); + if (lang != null) { + if (DateFormat.is24HourFormat(ApplicationLoader.applicationContext)) { + formatterDay = FastDateFormat.getInstance("HH:mm", locale); + } else { + if (lang.toLowerCase().equals("ar")) { + formatterDay = FastDateFormat.getInstance("h:mm a", locale); + } else { + formatterDay = FastDateFormat.getInstance("h:mm a", Locale.US); + } + } } else { - formatterDay = FastDateFormat.getInstance("h:mm a", Locale.US);} - + formatterDay = FastDateFormat.getInstance("h:mm a", Locale.US); + } } public static String formatDateChat(long date) { @@ -335,7 +344,7 @@ public class Utilities { if (dateDay == day && year == dateYear) { return formatterDay.format(new Date(date * 1000)); } else if (dateDay + 1 == day && year == dateYear) { - return applicationContext.getResources().getString(R.string.Yesterday); + return ApplicationLoader.applicationContext.getResources().getString(R.string.Yesterday); } else if (year == dateYear) { return formatterMonth.format(new Date(date * 1000)); } else { @@ -352,13 +361,13 @@ public class Utilities { int dateYear = rightNow.get(Calendar.YEAR); if (dateDay == day && year == dateYear) { - return String.format("%s %s", applicationContext.getResources().getString(R.string.TodayAt), formatterDay.format(new Date(date * 1000))); + return String.format("%s %s", ApplicationLoader.applicationContext.getResources().getString(R.string.TodayAt), formatterDay.format(new Date(date * 1000))); } else if (dateDay + 1 == day && year == dateYear) { - return String.format("%s %s", applicationContext.getResources().getString(R.string.YesterdayAt), formatterDay.format(new Date(date * 1000))); + return String.format("%s %s", ApplicationLoader.applicationContext.getResources().getString(R.string.YesterdayAt), formatterDay.format(new Date(date * 1000))); } else if (year == dateYear) { - return String.format("%s %s %s", formatterMonth.format(new Date(date * 1000)), applicationContext.getResources().getString(R.string.OtherAt), formatterDay.format(new Date(date * 1000))); + return String.format("%s %s %s", formatterMonth.format(new Date(date * 1000)), ApplicationLoader.applicationContext.getResources().getString(R.string.OtherAt), formatterDay.format(new Date(date * 1000))); } else { - return String.format("%s %s %s", formatterYear.format(new Date(date * 1000)), applicationContext.getResources().getString(R.string.OtherAt), formatterDay.format(new Date(date * 1000))); + return String.format("%s %s %s", formatterYear.format(new Date(date * 1000)), ApplicationLoader.applicationContext.getResources().getString(R.string.OtherAt), formatterDay.format(new Date(date * 1000))); } } @@ -401,7 +410,7 @@ public class Utilities { public static void RunOnUIThread(Runnable runnable) { synchronized (lock) { if (applicationHandler == null) { - applicationHandler = new Handler(applicationContext.getMainLooper()); + applicationHandler = new Handler(ApplicationLoader.applicationContext.getMainLooper()); } applicationHandler.post(runnable); } @@ -419,18 +428,25 @@ public class Utilities { R.drawable.user_placeholder_orange}; public static int[] arrGroupsAvatars = { - R.drawable.group_placeholder_red, R.drawable.group_placeholder_green, - R.drawable.group_placeholder_yellow, + R.drawable.group_placeholder_red, R.drawable.group_placeholder_blue, - R.drawable.group_placeholder_purple, - R.drawable.group_placeholder_pink, - R.drawable.group_placeholder_cyan, - R.drawable.group_placeholder_orange}; + R.drawable.group_placeholder_yellow}; public static int getColorIndex(int id) { + int[] arr; + if (id >= 0) { + arr = arrUsersAvatars; + } else { + arr = arrGroupsAvatars; + } try { - String str = String.format(Locale.US, "%d%d", id, UserConfig.clientUserId); + String str; + if (id >= 0) { + str = String.format(Locale.US, "%d%d", id, UserConfig.clientUserId); + } else { + str = String.format(Locale.US, "%d", id); + } if (str.length() > 15) { str = str.substring(0, 15); } @@ -440,11 +456,11 @@ public class Utilities { if (b < 0) { b += 256; } - return Math.abs(b) % arrColors.length; + return Math.abs(b) % arr.length; } catch (Exception e) { e.printStackTrace(); } - return id % arrColors.length; + return id % arr.length; } public static int getColorForId(int id) { @@ -462,7 +478,7 @@ public class Utilities { } public static int getGroupAvatarForId(int id) { - return arrGroupsAvatars[getColorIndex(id)]; + return arrGroupsAvatars[getColorIndex(-id)]; } public static String MD5(String md5) { @@ -488,7 +504,7 @@ public class Utilities { File f = new File(fromPath); Uri contentUri = Uri.fromFile(f); mediaScanIntent.setData(contentUri); - applicationContext.sendBroadcast(mediaScanIntent); + ApplicationLoader.applicationContext.sendBroadcast(mediaScanIntent); } public static void addMediaToGallery(Uri uri) { @@ -497,13 +513,13 @@ public class Utilities { } Intent mediaScanIntent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE); mediaScanIntent.setData(uri); - applicationContext.sendBroadcast(mediaScanIntent); + ApplicationLoader.applicationContext.sendBroadcast(mediaScanIntent); } private static File getAlbumDir() { File storageDir = null; if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) { - storageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), applicationContext.getResources().getString(R.string.AppName)); + storageDir = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES), ApplicationLoader.applicationContext.getResources().getString(R.string.AppName)); if (storageDir != null) { if (! storageDir.mkdirs()) { if (! storageDir.exists()){ @@ -578,7 +594,7 @@ public class Utilities { /* String fileName = "VID" + id + ".mp4"; - return new File(Utilities.applicationContext.getCacheDir(), fileName); + return new File(ApplicationLoader.applicationContext.getCacheDir(), fileName); */ } catch (Exception e) { e.printStackTrace(); diff --git a/TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java b/TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java index 7e662b9e..d54d201b 100644 --- a/TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java +++ b/TMessagesProj/src/main/java/org/telegram/objects/MessageObject.java @@ -16,6 +16,7 @@ import org.telegram.messenger.MessagesController; import org.telegram.messenger.R; import org.telegram.messenger.UserConfig; import org.telegram.messenger.Utilities; +import org.telegram.ui.ApplicationLoader; import java.util.AbstractMap; import java.util.ArrayList; @@ -42,57 +43,57 @@ public class MessageObject { fromUser = MessagesController.Instance.users.get(message.from_id); } if (message.action instanceof TLRPC.TL_messageActionChatCreate) { - messageText = Utilities.applicationContext.getResources().getString(R.string.ActionCreateGroup).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionCreateGroup).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } else if (message.action instanceof TLRPC.TL_messageActionChatDeleteUser) { if (message.action.user_id == message.from_id) { - messageText = Utilities.applicationContext.getResources().getString(R.string.ActionLeftUser).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionLeftUser).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } else { TLRPC.User who = users.get(message.action.user_id); - String str = Utilities.applicationContext.getResources().getString(R.string.ActionKickUser); + String str = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionKickUser); messageText = str.replace("un2", Utilities.formatName(who.first_name, who.last_name)).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } } else if (message.action instanceof TLRPC.TL_messageActionChatAddUser) { TLRPC.User whoUser = users.get(message.action.user_id); - String str = Utilities.applicationContext.getResources().getString(R.string.ActionAddUser); + String str = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionAddUser); messageText = str.replace("un2", Utilities.formatName(whoUser.first_name, whoUser.last_name)).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } else if (message.action instanceof TLRPC.TL_messageActionChatEditPhoto) { photoThumbs = new ArrayList(); for (TLRPC.PhotoSize size : message.action.photo.sizes) { photoThumbs.add(new PhotoObject(size)); } - messageText = Utilities.applicationContext.getResources().getString(R.string.ActionChangedPhoto).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionChangedPhoto).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } else if (message.action instanceof TLRPC.TL_messageActionChatEditTitle) { - messageText = Utilities.applicationContext.getResources().getString(R.string.ActionChangedTitle).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)).replace("un2", message.action.title); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionChangedTitle).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)).replace("un2", message.action.title); } else if (message.action instanceof TLRPC.TL_messageActionChatDeletePhoto) { - messageText = Utilities.applicationContext.getResources().getString(R.string.ActionRemovedPhoto).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.ActionRemovedPhoto).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name)); } else if (message.action instanceof TLRPC.TL_messageActionTTLChange) { if (message.action.ttl != 0) { String timeString; if (message.action.ttl == 2) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime2s); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime2s); } else if (message.action.ttl == 5) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime5s); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime5s); } else if (message.action.ttl == 60) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime1m); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime1m); } else if (message.action.ttl == 60 * 60) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime1h); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime1h); } else if (message.action.ttl == 60 * 60 * 24) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime1d); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime1d); } else if (message.action.ttl == 60 * 60 * 24 * 7) { - timeString = Utilities.applicationContext.getResources().getString(R.string.MessageLifetime1w); + timeString = ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetime1w); } else { timeString = String.format("%d", message.action.ttl); } if (message.from_id == UserConfig.clientUserId) { - messageText = String.format(Utilities.applicationContext.getResources().getString(R.string.MessageLifetimeChangedOutgoing), timeString); + messageText = String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetimeChangedOutgoing), timeString); } else { - messageText = String.format(Utilities.applicationContext.getResources().getString(R.string.MessageLifetimeChanged), fromUser.first_name, timeString); + messageText = String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetimeChanged), fromUser.first_name, timeString); } } else { if (message.from_id == UserConfig.clientUserId) { - messageText = String.format(Utilities.applicationContext.getResources().getString(R.string.MessageLifetimeRemoved), Utilities.applicationContext.getResources().getString(R.string.FromYou)); + messageText = String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetimeRemoved), ApplicationLoader.applicationContext.getResources().getString(R.string.FromYou)); } else { - messageText = String.format(Utilities.applicationContext.getResources().getString(R.string.MessageLifetimeRemoved), fromUser.first_name); + messageText = String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.MessageLifetimeRemoved), fromUser.first_name); } } } @@ -107,7 +108,7 @@ public class MessageObject { imagePreview = obj.image; } } - messageText = Utilities.applicationContext.getResources().getString(R.string.AttachPhoto); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.AttachPhoto); } else if (message.media instanceof TLRPC.TL_messageMediaVideo) { photoThumbs = new ArrayList(); PhotoObject obj = new PhotoObject(message.media.video.thumb); @@ -115,11 +116,11 @@ public class MessageObject { if (imagePreview == null && obj.image != null) { imagePreview = obj.image; } - messageText = Utilities.applicationContext.getResources().getString(R.string.AttachVideo); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.AttachVideo); } else if (message.media instanceof TLRPC.TL_messageMediaGeo) { - messageText = Utilities.applicationContext.getResources().getString(R.string.AttachLocation); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.AttachLocation); } else if (message.media instanceof TLRPC.TL_messageMediaContact) { - messageText = Utilities.applicationContext.getResources().getString(R.string.AttachContact); + messageText = ApplicationLoader.applicationContext.getResources().getString(R.string.AttachContact); } } else { messageText = message.message; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java index 627eed72..cb32f204 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationActivity.java @@ -76,7 +76,6 @@ public class ApplicationActivity extends SherlockFragmentActivity implements Not } } setContentView(R.layout.application_layout); - notificationView = (NotificationView) getLayoutInflater().inflate(R.layout.notification_layout, null); shadowView = findViewById(R.id.shadow); NotificationCenter.Instance.addObserver(this, 1234); NotificationCenter.Instance.addObserver(this, 658); @@ -342,6 +341,9 @@ public class ApplicationActivity extends SherlockFragmentActivity implements Not @Override protected void onResume() { super.onResume(); + if (notificationView == null && getLayoutInflater() != null) { + notificationView = (NotificationView) getLayoutInflater().inflate(R.layout.notification_layout, null); + } fixLayout(); checkForCrashes(); checkForUpdates(); @@ -389,7 +391,7 @@ public class ApplicationActivity extends SherlockFragmentActivity implements Not WindowManager manager = (WindowManager) getSystemService(WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); int rotation = display.getRotation(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; int height; int currentActionBarHeight = getSupportActionBar().getHeight(); @@ -575,7 +577,7 @@ public class ApplicationActivity extends SherlockFragmentActivity implements Not ApplicationLoader.fragmentsStack.remove(ApplicationLoader.fragmentsStack.size() - 1); current.onFragmentDestroy(); } - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (animations) { if (bySwipe) { @@ -614,7 +616,7 @@ public class ApplicationActivity extends SherlockFragmentActivity implements Not BaseFragment prev = ApplicationLoader.fragmentsStack.get(ApplicationLoader.fragmentsStack.size() - 2); FragmentManager fm = getSupportFragmentManager(); FragmentTransaction fTrans = fm.beginTransaction(); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (animations) { if (bySwipe) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java index 986b4c1a..219b7e17 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ApplicationLoader.java @@ -47,6 +47,7 @@ public class ApplicationLoader extends Application { private static final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000; public static long lastPauseTime; public static Bitmap cachedWallpaper = null; + public static Context applicationContext; public static ApplicationLoader Instance = null; @@ -60,18 +61,19 @@ public class ApplicationLoader extends Application { java.lang.System.setProperty("java.net.preferIPv4Stack", "true"); java.lang.System.setProperty("java.net.preferIPv6Addresses", "false"); - Utilities.applicationContext = getApplicationContext(); + applicationContext = getApplicationContext(); + Utilities.getTypeface("fonts/rlight.ttf"); UserConfig.loadConfig(); SharedPreferences preferences = getSharedPreferences("Notifications", MODE_PRIVATE); if (UserConfig.currentUser != null) { int value = preferences.getInt("version", 0); if (value != 15) { UserConfig.contactsHash = ""; - UserConfig.lastDateValue = 0; - UserConfig.lastPtsValue = 0; - UserConfig.lastSeqValue = 0; - UserConfig.lastQtsValue = 0; - UserConfig.saveConfig(); + MessagesStorage.lastDateValue = 0; + MessagesStorage.lastPtsValue = 0; + MessagesStorage.lastSeqValue = 0; + MessagesStorage.lastQtsValue = 0; + UserConfig.saveConfig(false); MessagesStorage.Instance.cleanUp(); ArrayList users = new ArrayList(); users.add(UserConfig.currentUser); @@ -80,6 +82,8 @@ public class ApplicationLoader extends Application { SharedPreferences.Editor editor = preferences.edit(); editor.putInt("version", 15); editor.commit(); + } else { + MessagesStorage init = MessagesStorage.Instance; } MessagesController.Instance.users.put(UserConfig.clientUserId, UserConfig.currentUser); } else { @@ -102,7 +106,7 @@ public class ApplicationLoader extends Application { if (checkPlayServices()) { gcm = GoogleCloudMessaging.getInstance(this); - regid = getRegistrationId(Utilities.applicationContext); + regid = getRegistrationId(applicationContext); if (regid.length() == 0) { registerInBackground(); @@ -171,11 +175,11 @@ public class ApplicationLoader extends Application { String msg; try { if (gcm == null) { - gcm = GoogleCloudMessaging.getInstance(Utilities.applicationContext); + gcm = GoogleCloudMessaging.getInstance(applicationContext); } regid = gcm.register(SENDER_ID); sendRegistrationIdToBackend(true); - storeRegistrationId(Utilities.applicationContext, regid); + storeRegistrationId(applicationContext, regid); return true; } catch (IOException ex) { ex.printStackTrace(); @@ -191,7 +195,7 @@ public class ApplicationLoader extends Application { public void run() { UserConfig.pushString = regid; UserConfig.registeredForPush = !isNew; - UserConfig.saveConfig(); + UserConfig.saveConfig(false); MessagesController.Instance.registerForPush(regid); } }); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 15e67bf3..be1a0394 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -281,7 +281,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa NotificationCenter.Instance.addObserver(this, 997); loading = true; MessagesController.Instance.loadMessages(dialog_id, 0, 30, 0, true, 0, classGuid); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); fontSize = preferences.getInt("fons_size", 16); return true; } @@ -360,7 +360,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ImageView backgroundImage = (ImageView) fragmentView.findViewById(R.id.background_image); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); int selectedBackground = preferences.getInt("selectedBackground", 1000001); int selectedColor = preferences.getInt("selectedColor", 0); if (selectedColor != 0) { @@ -371,7 +371,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (selectedBackground == 1000001) { backgroundImage.setImageResource(R.drawable.background_hd); } else { - File toFile = new File(Utilities.applicationContext.getFilesDir(), "wallpaper.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); if (toFile.exists()) { if (ApplicationLoader.cachedWallpaper != null) { backgroundImage.setImageBitmap(ApplicationLoader.cachedWallpaper); @@ -419,11 +419,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } if (isCustomTheme) { - centerProgress.setIndeterminateDrawable(Utilities.applicationContext.getResources().getDrawable(R.drawable.loading_custom_animation)); + centerProgress.setIndeterminateDrawable(ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.loading_custom_animation)); emptyView.setBackgroundResource(R.drawable.day_box_custom); } else { emptyView.setBackgroundResource(R.drawable.day_box); - centerProgress.setIndeterminateDrawable(Utilities.applicationContext.getResources().getDrawable(R.drawable.loading_animation)); + centerProgress.setIndeterminateDrawable(ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.loading_animation)); } emptyView.setPadding((int)(10 * displayDensity), (int)(26 * displayDensity), (int)(10 * displayDensity), 0); @@ -681,7 +681,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa Utilities.hideKeyboard(parentActivity.getCurrentFocus()); } } - parentActivity.invalidateOptionsMenu(); + if (parentActivity != null) { + parentActivity.invalidateOptionsMenu(); + } } private void addToLoadingFile(String path, ProgressBar bar) { @@ -833,15 +835,13 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } if (currentChat != null) { - currentChat = MessagesController.Instance.chats.get(currentChat.id); actionBar.setTitle(Html.fromHtml("" + currentChat.title + "")); if (title != null) { title.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0); title.setCompoundDrawablePadding(0); } } else if (currentUser != null) { - currentUser = MessagesController.Instance.users.get(currentUser.id); - if (currentUser.id != 333000 && !MessagesController.Instance.contactsByPhones.containsKey(currentUser.phone)) { + if (currentUser.id != 333000 && MessagesController.Instance.contactsDict.get(currentUser.id) == null) { if (currentUser.phone != null && currentUser.phone.length() != 0) { actionBar.setTitle(Html.fromHtml("" + PhoneFormat.Instance.format("+" + currentUser.phone) + "")); } else { @@ -1044,12 +1044,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa return; } Bitmap thumb = ThumbnailUtils.createVideoThumbnail(videoPath, MediaStore.Video.Thumbnails.MINI_KIND); - TLRPC.PhotoSize size; - if (currentEncryptedChat == null) { - size = FileLoader.scaleAndSaveImage(thumb, 320, 320, 87, false); - } else { - size = FileLoader.scaleAndSaveImage(thumb, 90, 90, 55, true); - } + TLRPC.PhotoSize size = FileLoader.scaleAndSaveImage(thumb, 90, 90, 55, currentEncryptedChat != null); if (size == null) { return; } @@ -1064,7 +1059,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa video.size = (int)temp.length(); } UserConfig.lastLocalId--; - UserConfig.saveConfig(); + UserConfig.saveConfig(false); MediaPlayer mp = MediaPlayer.create(parentActivity, Uri.fromFile(new File(videoPath))); video.duration = (int)Math.ceil(mp.getDuration() / 1000.0f); @@ -1293,7 +1288,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } } } else if (id == MessagesController.closeChats) { - if (messsageEditText.isFocused()) { + if (messsageEditText != null && messsageEditText.isFocused()) { Utilities.hideKeyboard(messsageEditText); } removeSelfFromStack(); @@ -1481,7 +1476,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (currentUser == null) { topPanel.setVisibility(View.GONE); } else { - if (currentUser.phone != null && currentUser.phone.length() != 0 && MessagesController.Instance.contactsByPhones.get(currentUser.phone) != null) { + if (currentUser.phone != null && currentUser.phone.length() != 0 && MessagesController.Instance.contactsDict.get(currentUser.id) != null) { topPanel.setVisibility(View.GONE); } else { topPanel.setVisibility(View.VISIBLE); @@ -1657,7 +1652,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ((ApplicationActivity)parentActivity).showActionBar(); ((ApplicationActivity)parentActivity).updateActionBar(); fixLayout(); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); String lastMessageText = preferences.getString("dialog_" + dialog_id, null); if (lastMessageText != null) { SharedPreferences.Editor editor = preferences.edit(); @@ -1708,7 +1703,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa MessagesController.Instance.openned_dialog_id = 0; if (messsageEditText != null && messsageEditText.length() != 0) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putString("dialog_" + dialog_id, messsageEditText.getText().toString()); editor.commit(); @@ -1725,12 +1720,12 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa chatListView.getViewTreeObserver().removeOnPreDrawListener(this); return false; } - WindowManager manager = (WindowManager) Utilities.applicationContext.getSystemService(Activity.WINDOW_SERVICE); + WindowManager manager = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Activity.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -2198,7 +2193,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa public boolean isGoogleMapsInstalled() { try { - ApplicationInfo info = Utilities.applicationContext.getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0 ); + ApplicationInfo info = ApplicationLoader.applicationContext.getPackageManager().getApplicationInfo("com.google.android.apps.maps", 0 ); return true; } catch(PackageManager.NameNotFoundException e) { AlertDialog.Builder builder = new AlertDialog.Builder(parentActivity); @@ -2216,9 +2211,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } }); builder.setNegativeButton(R.string.Cancel, null); - AlertDialog dialog = builder.create(); - dialog.setCanceledOnTouchOutside(true); - dialog.show(); + visibleDialog = builder.create(); + visibleDialog.setCanceledOnTouchOutside(true); + visibleDialog.show(); return false; } } @@ -2417,9 +2412,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa ProgressBar progressBar = (ProgressBar)view.findViewById(R.id.progress); progressBar.setIndeterminate(true); if (isCustomTheme) { - progressBar.setIndeterminateDrawable(Utilities.applicationContext.getResources().getDrawable(R.drawable.loading_custom_animation)); + progressBar.setIndeterminateDrawable(ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.loading_custom_animation)); } else { - progressBar.setIndeterminateDrawable(Utilities.applicationContext.getResources().getDrawable(R.drawable.loading_animation)); + progressBar.setIndeterminateDrawable(ApplicationLoader.applicationContext.getResources().getDrawable(R.drawable.loading_animation)); } } return view; @@ -2755,7 +2750,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa } int placeHolderId = Utilities.getUserAvatarForId(contactUser.id); contactAvatar.setImage(photo, "50_50", placeHolderId); - if (contactUser.id != UserConfig.clientUserId && !MessagesController.Instance.contactsByPhones.containsKey(contactUser.phone)) { + if (contactUser.id != UserConfig.clientUserId && MessagesController.Instance.contactsDict.get(contactUser.id) == null) { addContactView.setVisibility(View.VISIBLE); } else { addContactView.setVisibility(View.GONE); @@ -3234,6 +3229,19 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa if (forwardedUserText != null) { forwardedUserText.setTypeface(typeface); + forwardedUserText.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + TLRPC.User fwdUser = MessagesController.Instance.users.get(message.messageOwner.fwd_from_id); + if (fwdUser != null && fwdUser.id != UserConfig.clientUserId) { + UserProfileActivity fragment = new UserProfileActivity(); + Bundle args = new Bundle(); + args.putInt("user_id", fwdUser.id); + fragment.setArguments(args); + ((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + fwdUser.id, false); + } + } + }); } if (videoTimeText != null) { videoTimeText.setTypeface(typeface); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java index 2e40ec34..655c0945 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileActivity.java @@ -225,7 +225,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen ((ApplicationActivity)parentActivity).presentFragment(fragment, "user_" + user_id, false); } else { if (size + 7 == i) { - if (info.participants.size() < 100) { + if (info.participants.size() < 200) { openAddMenu(); } else { kickUser(null); @@ -375,7 +375,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -539,7 +539,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen int count = 6; if (info != null && !(info instanceof TLRPC.TL_chatParticipantsForbidden)) { count += info.participants.size() + 2; - if (info.participants.size() < 100) { + if (info.participants.size() < 200) { count++; } } @@ -673,7 +673,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen TextView textView = (TextView)view.findViewById(R.id.settings_row_text); View divider = view.findViewById(R.id.settings_row_divider); if (i == 2) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = mContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); String key = "notify_" + (-chat_id); boolean value = preferences.getBoolean(key, true); ImageView checkButton = (ImageView)view.findViewById(R.id.settings_row_check_button); @@ -696,7 +696,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen detailTextView.setTypeface(typeface); View divider = view.findViewById(R.id.settings_row_divider); if (i == 3) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = mContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); String name = preferences.getString("sound_chat_" + chat_id, getStringEntry(R.string.Default)); if (name.equals("NoSound")) { detailTextView.setText(getStringEntry(R.string.NoSound)); @@ -836,7 +836,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen return 4; } else { if (size + 7 == i) { - if (info != null && info.participants.size() < 100) { + if (info != null && info.participants.size() < 200) { return 5; } else { return 6; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java index e44f5462..b03d157a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatProfileChangeNameActivity.java @@ -111,7 +111,7 @@ public class ChatProfileChangeNameActivity extends BaseFragment { int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -173,7 +173,7 @@ public class ChatProfileChangeNameActivity extends BaseFragment { } ((ApplicationActivity)parentActivity).updateActionBar(); fixLayout(); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (!animations) { firstNameField.requestFocus(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java index b81d9458..1cb3181d 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactAddActivity.java @@ -219,7 +219,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent ((ApplicationActivity)parentActivity).updateActionBar(); fixLayout(); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (!animations) { firstNameField.requestFocus(); @@ -245,7 +245,7 @@ public class ContactAddActivity extends BaseFragment implements NotificationCent int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java index aeccad8c..4bc7be29 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ContactsActivity.java @@ -34,6 +34,8 @@ import com.actionbarsherlock.view.Menu; import com.actionbarsherlock.view.MenuInflater; import com.actionbarsherlock.view.MenuItem; import com.actionbarsherlock.widget.SearchView; + +import org.telegram.PhoneFormat.PhoneFormat; import org.telegram.TL.TLRPC; import org.telegram.messenger.ConnectionsManager; import org.telegram.messenger.MessagesController; @@ -231,7 +233,8 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (usePhone == null) { usePhone = phone; } - TLRPC.TL_contact cLocal = MessagesController.Instance.contactsByPhones.get(phone); + String cleanPhone = PhoneFormat.stripExceptNumbers(usePhone); + TLRPC.TL_contact cLocal = MessagesController.Instance.contactsByPhones.get(cleanPhone); if (cLocal != null) { if (cLocal.user_id == UserConfig.clientUserId) { return; @@ -257,7 +260,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter @Override public void onClick(DialogInterface dialogInterface, int i) { try { - String number = "+" + arg1; + String number = arg1; Intent intent = new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)); intent.putExtra("sms_body", getStringEntry(R.string.InviteText)); startActivity(intent); @@ -347,7 +350,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -529,7 +532,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter if (s.length() != 0) { searchWas = true; if (listView != null) { - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; listView.setPadding((int)(density * 16), listView.getPaddingTop(), (int)(density * 16), listView.getPaddingBottom()); listView.setAdapter(searchListViewAdapter); if(android.os.Build.VERSION.SDK_INT >= 11) { @@ -562,7 +565,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter searchWas = false; ViewGroup group = (ViewGroup)listView.getParent(); listView.setAdapter(listViewAdapter); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (!isRTL) { listView.setPadding((int)(density * 16), listView.getPaddingTop(), (int)(density * 30), listView.getPaddingBottom()); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java index f97573f7..ca6dcc57 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GalleryImageViewer.java @@ -179,7 +179,7 @@ public class GalleryImageViewer extends AbstractGalleryActivity implements Notif localPagerAdapter = new LocalPagerAdapter(imagesArr, imagesByIds); } - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; mViewPager.setPageMargin((int)(20 * density)); mViewPager.setOffscreenPageLimit(1); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java index 89834dfa..5ef20f1b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateActivity.java @@ -161,7 +161,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen } else { doneTextView.setText(getStringEntry(R.string.Done) + " (" + selectedContacts.size() + ")"); } - countTextView.setText(selectedContacts.size() + "/100"); + countTextView.setText(selectedContacts.size() + "/200"); listView.invalidateViews(); } else { search = true; @@ -219,7 +219,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen userSelectEditText.setSelection(text.length()); ignoreChange = false; } else { - if (selectedContacts.size() == 100) { + if (selectedContacts.size() == 200) { return; } ignoreChange = true; @@ -232,7 +232,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen } else { doneTextView.setText(getStringEntry(R.string.Done) + " (" + selectedContacts.size() + ")"); } - countTextView.setText(selectedContacts.size() + "/100"); + countTextView.setText(selectedContacts.size() + "/200"); if (searching || searchWas) { searching = false; searchWas = false; @@ -280,7 +280,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java index 1bf9c03c..1a49035a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/GroupCreateFinalActivity.java @@ -156,7 +156,7 @@ public class GroupCreateFinalActivity extends BaseFragment implements Notificati int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java index 38168c43..4e28d1ec 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IdenticonActivity.java @@ -133,7 +133,7 @@ public class IdenticonActivity extends BaseFragment { int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -154,7 +154,7 @@ public class IdenticonActivity extends BaseFragment { TextView title = (TextView)parentActivity.findViewById(R.id.abs__action_bar_title); if (title == null) { - final int subtitleId = Utilities.applicationContext.getResources().getIdentifier("action_bar_title", "id", "android"); + final int subtitleId = ApplicationLoader.applicationContext.getResources().getIdentifier("action_bar_title", "id", "android"); title = (TextView)parentActivity.findViewById(subtitleId); } if (title != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java index 3fcfbfc6..6a002bfe 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/IntroActivity.java @@ -261,7 +261,7 @@ public class IntroActivity extends SherlockFragmentActivity { WindowManager manager = (WindowManager)getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); int rotation = display.getRotation(); - density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; FrameLayout.LayoutParams params = (FrameLayout.LayoutParams)parentSlidingView.getLayoutParams(); FrameLayout.LayoutParams buttonParams = (FrameLayout.LayoutParams)startMessagingButton.getLayoutParams(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java index 6d7c49da..ca7819af 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LaunchActivity.java @@ -54,10 +54,12 @@ public class LaunchActivity extends PausableActivity { cursor.close(); } } - if (path.startsWith("file:")) { - path = path.replace("file://", ""); + if (path != null) { + if (path.startsWith("file:")) { + path = path.replace("file://", ""); + } + NotificationCenter.Instance.addToMemCache(533, path); } - NotificationCenter.Instance.addToMemCache(533, path); } else if (intent.getType().startsWith("video/")) { String path = intent.getParcelableExtra(Intent.EXTRA_STREAM).toString(); if (path.startsWith("content:")) { @@ -68,10 +70,12 @@ public class LaunchActivity extends PausableActivity { cursor.close(); } } - if (path.startsWith("file:")) { - path = path.replace("file://", ""); + if (path != null) { + if (path.startsWith("file:")) { + path = path.replace("file://", ""); + } + NotificationCenter.Instance.addToMemCache(534, path); } - NotificationCenter.Instance.addToMemCache(534, path); } else if (intent.getType().equals("text/plain")) { String text = intent.getStringExtra(Intent.EXTRA_TEXT); if (text.length() != 0) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java index 738831f1..dfb0b040 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LocationActivity.java @@ -227,7 +227,7 @@ public class LocationActivity extends BaseFragment implements LocationListener, bottomView = fragmentView.findViewById(R.id.location_bottom_view); sendButton = (TextView)fragmentView.findViewById(R.id.location_send_button); - getFragmentManager().beginTransaction().replace(R.id.map_view, mapFragment).commit(); + getChildFragmentManager().beginTransaction().replace(R.id.map_view, mapFragment).commit(); } else { ViewGroup parent = (ViewGroup)fragmentView.getParent(); if (parent != null) { @@ -305,14 +305,13 @@ public class LocationActivity extends BaseFragment implements LocationListener, if (isGPSEnabled || isNetworkEnabled) { if (isGPSEnabled) { - locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000 * 3 * 1, 0, this); + locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 1000 * 3 * 1, 1, this); if (locationManager != null) { location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); } } if (location == null && isNetworkEnabled) { - long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; - locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 3 * 1, 0, this); + locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 1000 * 3 * 1, 1, this); if (locationManager != null) { location = locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); } @@ -341,9 +340,9 @@ public class LocationActivity extends BaseFragment implements LocationListener, if (userLocation != null && distanceTextView != null) { float distance = location.distanceTo(userLocation); if (distance < 1000) { - distanceTextView.setText(String.format("%d %s", (int)(distance), Utilities.applicationContext.getString(R.string.MetersAway))); + distanceTextView.setText(String.format("%d %s", (int)(distance), ApplicationLoader.applicationContext.getString(R.string.MetersAway))); } else { - distanceTextView.setText(String.format("%.2f %s", distance / 1000.0f, Utilities.applicationContext.getString(R.string.KMetersAway))); + distanceTextView.setText(String.format("%.2f %s", distance / 1000.0f, ApplicationLoader.applicationContext.getString(R.string.KMetersAway))); } } } else { @@ -365,8 +364,13 @@ public class LocationActivity extends BaseFragment implements LocationListener, } @Override - public void onLocationChanged(Location location) { - positionMarker(location); + public void onLocationChanged(final Location location) { + Utilities.RunOnUIThread(new Runnable() { + @Override + public void run() { + positionMarker(location); + } + }); } @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index b17d9953..10a8c9f8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -76,7 +76,7 @@ public class LoginActivity extends SherlockFragmentActivity implements NonSwipea AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setTitle(LoginActivity.this.getString(R.string.AppName)); builder.setMessage(message); - builder.setPositiveButton(Utilities.applicationContext.getString(R.string.OK), null); + builder.setPositiveButton(ApplicationLoader.applicationContext.getString(R.string.OK), null); builder.show().setCanceledOnTouchOutside(true); } } @@ -160,7 +160,7 @@ public class LoginActivity extends SherlockFragmentActivity implements NonSwipea super.onCreate(savedInstanceState); setContentView(R.layout.login_layout); - Utilities.applicationContext = this.getApplicationContext(); + ApplicationLoader.applicationContext = this.getApplicationContext(); ConnectionsManager inst = ConnectionsManager.Instance; Typeface typeface = Utilities.getTypeface("fonts/rlight.ttf"); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java index c69dcf66..76542809 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MediaActivity.java @@ -296,7 +296,7 @@ public class MediaActivity extends BaseFragment implements NotificationCenter.No int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java index c7bff81c..a86fe1f1 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/MessagesActivity.java @@ -92,6 +92,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter NotificationCenter.Instance.addObserver(this, MessagesController.reloadSearchResults); NotificationCenter.Instance.addObserver(this, MessagesController.userPrintUpdateAll); NotificationCenter.Instance.addObserver(this, MessagesController.encryptedChatUpdated); + NotificationCenter.Instance.addObserver(this, MessagesController.contactsDidLoaded); NotificationCenter.Instance.addObserver(this, 1234); if (getArguments() != null) { onlySelect = getArguments().getBoolean("onlySelect", false); @@ -109,6 +110,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter NotificationCenter.Instance.removeObserver(this, MessagesController.reloadSearchResults); NotificationCenter.Instance.removeObserver(this, MessagesController.userPrintUpdateAll); NotificationCenter.Instance.removeObserver(this, MessagesController.encryptedChatUpdated); + NotificationCenter.Instance.removeObserver(this, MessagesController.contactsDidLoaded); NotificationCenter.Instance.removeObserver(this, 1234); delegate = null; } @@ -328,7 +330,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter view = (ImageView)parentActivity.findViewById(com.actionbarsherlock.R.id.abs__home); } if (view != null) { - view.setPadding((int)(Utilities.applicationContext.getResources().getDisplayMetrics().density * 6), 0, (int)(Utilities.applicationContext.getResources().getDisplayMetrics().density * 6), 0); + view.setPadding((int)(ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density * 6), 0, (int)(ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density * 6), 0); } actionBar.setHomeButtonEnabled(false); actionBar.setDisplayShowTitleEnabled(true); @@ -420,6 +422,10 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter if (messagesListView != null) { updateVisibleRows(); } + } else if (id == MessagesController.contactsDidLoaded) { + if (messagesListView != null) { + updateVisibleRows(); + } } } @@ -453,7 +459,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter WindowManager manager = (WindowManager) parentActivity.getSystemService(Context.WINDOW_SERVICE); Display display = manager.getDefaultDisplay(); int rotation = display.getRotation(); - density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); @@ -1043,8 +1049,8 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter nameTextView.setText(chat.title); nameTextView.setTextColor(0xff000000); } else if (user != null) { - if (user.id != 333000 && !MessagesController.Instance.contactsByPhones.containsKey(user.phone)) { - if (MessagesController.Instance.contactsByPhones.isEmpty() && MessagesController.Instance.loadingContacts) { + if (user.id != 333000 && MessagesController.Instance.contactsDict.get(user.id) == null) { + if (MessagesController.Instance.contactsDict.size() == 0 && MessagesController.Instance.loadingContacts) { nameTextView.setTextColor(0xff000000); nameTextView.setText(Utilities.formatName(user.first_name, user.last_name)); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentPhone.java b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentPhone.java index 6a0db631..0f178d45 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentPhone.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentPhone.java @@ -183,7 +183,7 @@ public class ScreenSlidePageFragmentPhone extends SlideFragment implements Adapt } }); - ArrayAdapter dataAdapter = new ArrayAdapter(Utilities.applicationContext, R.layout.login_country_textview, countriesArray); + ArrayAdapter dataAdapter = new ArrayAdapter(ApplicationLoader.applicationContext, R.layout.login_country_textview, countriesArray); dataAdapter.setDropDownViewResource(R.layout.login_country_dropdown); countrySpinner.setAdapter(dataAdapter); @@ -205,7 +205,7 @@ public class ScreenSlidePageFragmentPhone extends SlideFragment implements Adapt String country = "RU"; try { - TelephonyManager telephonyManager = (TelephonyManager)Utilities.applicationContext.getSystemService(Context.TELEPHONY_SERVICE); + TelephonyManager telephonyManager = (TelephonyManager)ApplicationLoader.applicationContext.getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager != null) { country = telephonyManager.getSimCountryIso().toUpperCase(); } @@ -215,7 +215,7 @@ public class ScreenSlidePageFragmentPhone extends SlideFragment implements Adapt if (country == null || country.length() == 0) { try { - Locale current = Utilities.applicationContext.getResources().getConfiguration().locale; + Locale current = ApplicationLoader.applicationContext.getResources().getConfiguration().locale; country = current.getCountry().toUpperCase(); } catch (Exception e) { e.printStackTrace(); @@ -299,8 +299,8 @@ public class ScreenSlidePageFragmentPhone extends SlideFragment implements Adapt TLRPC.TL_auth_sendCode req = new TLRPC.TL_auth_sendCode(); String phone = "" + codeField.getText() + phoneField.getText(); phone = phone.replace("+", ""); - req.api_hash = "5bce48dc7d331e62c955669eb7233217"; - req.api_id = 2458; + req.api_hash = "eb06d4abfb49dc3eeb1aeb98ae0f581e"; + req.api_id = 6; req.sms_type = 0; req.phone_number = phone; req.lang_code = Locale.getDefault().getCountry(); @@ -330,11 +330,11 @@ public class ScreenSlidePageFragmentPhone extends SlideFragment implements Adapt } else { if (error.text != null) { if (error.text.contains("PHONE_NUMBER_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidPhoneNumber)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidPhoneNumber)); } else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidCode)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidCode)); } else if (error.text.contains("PHONE_CODE_EXPIRED")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.CodeExpired)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.CodeExpired)); } else { delegate.needShowAlert(error.text); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentRegister.java b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentRegister.java index 40ce8e9b..7ecefe53 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentRegister.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentRegister.java @@ -196,7 +196,7 @@ public class ScreenSlidePageFragmentRegister extends SlideFragment { UserConfig.currentUser = user; UserConfig.clientActivated = true; UserConfig.clientUserId = user.id; - UserConfig.saveConfig(); + UserConfig.saveConfig(true); ArrayList users = new ArrayList(); users.add(user); MessagesStorage.Instance.putUsersAndChats(users, null, true, true); @@ -208,15 +208,15 @@ public class ScreenSlidePageFragmentRegister extends SlideFragment { }); } else { if (error.text.contains("PHONE_NUMBER_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidPhoneNumber)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidPhoneNumber)); } else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidCode)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidCode)); } else if (error.text.contains("PHONE_CODE_EXPIRED")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.CodeExpired)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.CodeExpired)); } else if (error.text.contains("FIRSTNAME_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.FirstName)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.FirstName)); } else if (error.text.contains("LASTNAME_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.LastName)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.LastName)); } else { delegate.needShowAlert(error.text); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentSms.java b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentSms.java index f2753545..3fc0bf55 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentSms.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ScreenSlidePageFragmentSms.java @@ -119,7 +119,7 @@ public class ScreenSlidePageFragmentSms extends SlideFragment implements Notific registered = params.get("registered"); String number = PhoneFormat.Instance.format(phone); - confirmTextView.setText(Html.fromHtml(String.format(Utilities.applicationContext.getResources().getString(R.string.SentSmsCode) + " %s", number))); + confirmTextView.setText(Html.fromHtml(String.format(ApplicationLoader.applicationContext.getResources().getString(R.string.SentSmsCode) + " %s", number))); Utilities.showKeyboard(codeField); codeField.requestFocus(); @@ -129,7 +129,7 @@ public class ScreenSlidePageFragmentSms extends SlideFragment implements Notific timeTimer.cancel(); timeTimer = null; } - timeText.setText(String.format("%s 1:00", Utilities.applicationContext.getResources().getString(R.string.CallText))); + timeText.setText(String.format("%s 1:00", ApplicationLoader.applicationContext.getResources().getString(R.string.CallText))); lastCurrentTime = System.currentTimeMillis(); timeTimer = new Timer(); timeTimer.schedule(new TimerTask() { @@ -145,9 +145,9 @@ public class ScreenSlidePageFragmentSms extends SlideFragment implements Notific if (time >= 1000) { int minutes = time / 1000 / 60; int seconds = time / 1000 - minutes * 60; - timeText.setText(String.format("%s %d:%02d", Utilities.applicationContext.getResources().getString(R.string.CallText), minutes, seconds)); + timeText.setText(String.format("%s %d:%02d", ApplicationLoader.applicationContext.getResources().getString(R.string.CallText), minutes, seconds)); } else { - timeText.setText(Utilities.applicationContext.getResources().getString(R.string.Calling)); + timeText.setText(ApplicationLoader.applicationContext.getResources().getString(R.string.Calling)); if (timeTimer != null) { timeTimer.cancel(); timeTimer = null; @@ -201,7 +201,7 @@ public class ScreenSlidePageFragmentSms extends SlideFragment implements Notific UserConfig.currentUser = res.user; UserConfig.clientActivated = true; UserConfig.clientUserId = res.user.id; - UserConfig.saveConfig(); + UserConfig.saveConfig(true); ArrayList users = new ArrayList(); users.add(UserConfig.currentUser); MessagesStorage.Instance.putUsersAndChats(users, null, true, true); @@ -229,11 +229,11 @@ public class ScreenSlidePageFragmentSms extends SlideFragment implements Notific }); } else { if (error.text.contains("PHONE_NUMBER_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidPhoneNumber)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidPhoneNumber)); } else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.InvalidCode)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.InvalidCode)); } else if (error.text.contains("PHONE_CODE_EXPIRED")) { - delegate.needShowAlert(Utilities.applicationContext.getString(R.string.CodeExpired)); + delegate.needShowAlert(ApplicationLoader.applicationContext.getString(R.string.CodeExpired)); } else { delegate.needShowAlert(error.text); } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java index 661f0c50..f4c77af2 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsActivity.java @@ -140,7 +140,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter builder.setItems(new CharSequence[]{String.format("%d", 16), String.format("%d", 17), String.format("%d", 18), String.format("%d", 19), String.format("%d", 20)}, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putInt("fons_size", 16 + which); editor.commit(); @@ -152,7 +152,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter builder.setNegativeButton(getStringEntry(R.string.Cancel), null); builder.show().setCanceledOnTouchOutside(true); } else if (i == enableAnimationsRow) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); SharedPreferences.Editor editor = preferences.edit(); editor.putBoolean("view_animations", !animations); @@ -270,7 +270,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -504,7 +504,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter divider.setVisibility(View.VISIBLE); ImageView checkButton = (ImageView)view.findViewById(R.id.settings_row_check_button); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (animations) { checkButton.setImageResource(R.drawable.btn_check_on); @@ -559,10 +559,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter detailTextView.setTypeface(typeface); View divider = view.findViewById(R.id.settings_row_divider); if (i == textSizeRow) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); int size = preferences.getInt("fons_size", 16); detailTextView.setText(String.format("%d", size)); - textView.setText(Utilities.applicationContext.getString(R.string.TextSize)); + textView.setText(ApplicationLoader.applicationContext.getString(R.string.TextSize)); divider.setVisibility(View.VISIBLE); } } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java index 17fd49a0..8d7bb912 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsBlockedUsers.java @@ -305,7 +305,7 @@ public class SettingsBlockedUsers extends BaseFragment implements NotificationCe int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java index 939966b8..0a66e665 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsChangeNameActivity.java @@ -73,7 +73,7 @@ public class SettingsChangeNameActivity extends BaseFragment { int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -130,7 +130,7 @@ public class SettingsChangeNameActivity extends BaseFragment { fixLayout(); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean animations = preferences.getBoolean("view_animations", true); if (!animations) { firstNameField.requestFocus(); @@ -226,7 +226,7 @@ public class SettingsChangeNameActivity extends BaseFragment { user.first_name = req.first_name; user.last_name = req.last_name; } - UserConfig.saveConfig(); + UserConfig.saveConfig(true); NotificationCenter.Instance.postNotificationName(MessagesController.updateInterfaces, MessagesController.UPDATE_MASK_ALL); ConnectionsManager.Instance.performRpc(req, new RPCRequest.RPCRequestDelegate() { @Override diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java index 7cdf37c5..61911f70 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsNotificationsActivity.java @@ -65,7 +65,7 @@ public class SettingsNotificationsActivity extends BaseFragment { @Override public void onItemClick(AdapterView adapterView, View view, int i, long l) { if (i == 1 || i == 6) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabled = false; if (i == 1) { @@ -96,7 +96,7 @@ public class SettingsNotificationsActivity extends BaseFragment { } ConnectionsManager.Instance.performRpc(req, null, null, true, RPCRequest.RPCRequestClassGeneric); } else if (i == 2 || i == 7) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabledAll = true; boolean enabled = true; @@ -130,7 +130,7 @@ public class SettingsNotificationsActivity extends BaseFragment { } ConnectionsManager.Instance.performRpc(req, null, null, true, RPCRequest.RPCRequestClassGeneric); } else if (i == 3 || i == 8) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabled; if (i == 3) { @@ -143,7 +143,7 @@ public class SettingsNotificationsActivity extends BaseFragment { editor.commit(); listView.invalidateViews(); } else if (i == 4 || i == 9) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); Intent tmpIntent = new Intent(RingtoneManager.ACTION_RINGTONE_PICKER); tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_TYPE, RingtoneManager.TYPE_NOTIFICATION); tmpIntent.putExtra(RingtoneManager.EXTRA_RINGTONE_SHOW_DEFAULT, false); @@ -196,7 +196,7 @@ public class SettingsNotificationsActivity extends BaseFragment { return; } reseting = false; - SharedPreferences preferences = inflaterActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.clear(); editor.commit(); @@ -208,21 +208,21 @@ public class SettingsNotificationsActivity extends BaseFragment { } }, null, true, RPCRequest.RPCRequestClassGeneric); } else if (i == 11) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabled = preferences.getBoolean("EnableInAppSounds", true); editor.putBoolean("EnableInAppSounds", !enabled); editor.commit(); listView.invalidateViews(); } else if (i == 12) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabled = preferences.getBoolean("EnableInAppVibrate", true); editor.putBoolean("EnableInAppVibrate", !enabled); editor.commit(); listView.invalidateViews(); } else if (i == 13) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); boolean enabled = preferences.getBoolean("EnableInAppPreview", true); editor.putBoolean("EnableInAppPreview", !enabled); @@ -260,7 +260,7 @@ public class SettingsNotificationsActivity extends BaseFragment { } } - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); if (requestCode == 4) { @@ -342,7 +342,7 @@ public class SettingsNotificationsActivity extends BaseFragment { int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -387,7 +387,7 @@ public class SettingsNotificationsActivity extends BaseFragment { @Override public boolean isEnabled(int i) { - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean enabledAll = preferences.getBoolean("EnableAll", true); return !(i != 1 && !enabledAll && i != 13) && (i > 0 && i < 5 || i > 5 && i < 10 || i > 10 && i < 14 || i == 15); } @@ -439,7 +439,7 @@ public class SettingsNotificationsActivity extends BaseFragment { View divider = view.findViewById(R.id.settings_row_divider); ImageView checkButton = (ImageView)view.findViewById(R.id.settings_row_check_button); - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean enabled = false; boolean enabledAll = preferences.getBoolean("EnableAll", true); @@ -506,7 +506,7 @@ public class SettingsNotificationsActivity extends BaseFragment { TextView textView = (TextView)view.findViewById(R.id.settings_row_text); TextView textViewDetail = (TextView)view.findViewById(R.id.settings_row_text_detail); View divider = view.findViewById(R.id.settings_row_divider); - SharedPreferences preferences = parentActivity.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); boolean enabledAll = preferences.getBoolean("EnableAll", true); if (i == 4 || i == 9) { if (i == 4) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java index ccfc14c4..643dc5a9 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/SettingsWallpapersActivity.java @@ -73,7 +73,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica NotificationCenter.Instance.addObserver(this, FileLoader.FileLoadProgressChanged); NotificationCenter.Instance.addObserver(this, MessagesStorage.wallpapersDidLoaded); - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); selectedBackground = preferences.getInt("selectedBackground", 1000001); selectedColor = preferences.getInt("selectedColor", 0); MessagesStorage.Instance.getWallpapers(); @@ -94,7 +94,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica if (fragmentView == null) { fragmentView = inflater.inflate(R.layout.settings_wallpapers_layout, container, false); listAdapter = new ListAdapter(parentActivity); - density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; progressBar = (ProgressBar)fragmentView.findViewById(R.id.action_progress); backgroundImage = (ImageView)fragmentView.findViewById(R.id.background_image); @@ -154,7 +154,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica TLRPC.PhotoSize size = PhotoObject.getClosestPhotoSizeWithSize(wallPaper.sizes, (int) (320 * density), (int) (480 * density)); String fileName = size.location.volume_id + "_" + size.location.local_id + ".jpg"; File f = new File(Utilities.getCacheDir(), fileName); - File toFile = new File(Utilities.applicationContext.getFilesDir(), "wallpaper.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); try { done = Utilities.copyFile(f, toFile); } catch (Exception e) { @@ -166,7 +166,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica } if (done) { - SharedPreferences preferences = Utilities.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE); SharedPreferences.Editor editor = preferences.edit(); editor.putInt("selectedBackground", selectedBackground); editor.putInt("selectedColor", selectedColor); @@ -195,7 +195,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica Utilities.addMediaToGallery(currentPicturePath); try { Bitmap bitmap = FileLoader.loadBitmap(currentPicturePath, (int)(320 * density), (int)(480 * density)); - File toFile = new File(Utilities.applicationContext.getFilesDir(), "wallpaper.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); selectedBackground = -1; @@ -218,7 +218,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica try { Bitmap bitmap = FileLoader.loadBitmap(imageFilePath, (int)(320 * density), (int)(480 * density)); - File toFile = new File(Utilities.applicationContext.getFilesDir(), "wallpaper.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); FileOutputStream stream = new FileOutputStream(toFile); bitmap.compress(Bitmap.CompressFormat.JPEG, 87, stream); selectedBackground = -1; @@ -269,7 +269,7 @@ public class SettingsWallpapersActivity extends BaseFragment implements Notifica backgroundImage.setBackgroundColor(0); selectedColor = 0; } else if (selectedBackground == -1) { - File toFile = new File(Utilities.applicationContext.getFilesDir(), "wallpaper.jpg"); + File toFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "wallpaper.jpg"); if (toFile.exists()) { backgroundImage.setImageURI(Uri.fromFile(toFile)); } else { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java index 0291a2e9..8b1ca36c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/UserProfileActivity.java @@ -399,7 +399,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen int rotation = display.getRotation(); int height; int currentActionBarHeight = parentActivity.getSupportActionBar().getHeight(); - float density = Utilities.applicationContext.getResources().getDisplayMetrics().density; + float density = ApplicationLoader.applicationContext.getResources().getDisplayMetrics().density; if (currentActionBarHeight != 48 * density && currentActionBarHeight != 40 * density) { height = currentActionBarHeight; } else { @@ -415,7 +415,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen if (dialog_id != 0) { TextView title = (TextView)parentActivity.findViewById(R.id.abs__action_bar_title); if (title == null) { - final int subtitleId = Utilities.applicationContext.getResources().getIdentifier("action_bar_title", "id", "android"); + final int subtitleId = ApplicationLoader.applicationContext.getResources().getIdentifier("action_bar_title", "id", "android"); title = (TextView)parentActivity.findViewById(subtitleId); } if (title != null) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java index 259fbab9..9d6857aa 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/AvatarUpdater.java @@ -118,10 +118,15 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg } else if (requestCode == 1) { Uri imageUri = data.getData(); Cursor cursor = null; - if (parentFragment != null) { - cursor = parentFragment.getSherlockActivity().getContentResolver().query(imageUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); - } else if (parentActivity != null) { - cursor = parentActivity.getContentResolver().query(imageUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); + try { + if (parentFragment != null) { + cursor = parentFragment.getSherlockActivity().getContentResolver().query(imageUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); + } else if (parentActivity != null) { + cursor = parentActivity.getContentResolver().query(imageUri, new String[]{android.provider.MediaStore.Images.ImageColumns.DATA}, null, null, null); + } + } catch (Exception e) { + e.printStackTrace(); + return; } if (cursor == null) { return; @@ -149,7 +154,7 @@ public class AvatarUpdater implements NotificationCenter.NotificationCenterDeleg delegate.didUploadedPhoto(null, smallPhoto, bigPhoto); } } else { - UserConfig.saveConfig(); + UserConfig.saveConfig(false); uploadingAvatar = Utilities.getCacheDir() + "/" + bigPhoto.location.volume_id + "_" + bigPhoto.location.local_id + ".jpg"; NotificationCenter.Instance.addObserver(AvatarUpdater.this, FileLoader.FileDidUpload); NotificationCenter.Instance.addObserver(AvatarUpdater.this, FileLoader.FileDidFailUpload); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java index d0768a12..3d5274cb 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/BaseFragment.java @@ -17,8 +17,8 @@ import android.view.animation.AnimationUtils; import com.actionbarsherlock.app.SherlockFragment; import com.actionbarsherlock.app.SherlockFragmentActivity; import org.telegram.messenger.ConnectionsManager; -import org.telegram.messenger.Utilities; import org.telegram.ui.ApplicationActivity; +import org.telegram.ui.ApplicationLoader; public class BaseFragment extends SherlockFragment { public int animationType = 0; @@ -90,10 +90,11 @@ public class BaseFragment extends SherlockFragment { public void onFragmentDestroy() { ConnectionsManager.Instance.cancelRpcsForClassGuid(classGuid); removeParentOnDestroy = true; + isFinish = true; } public String getStringEntry(int res) { - return Utilities.applicationContext.getString(res); + return ApplicationLoader.applicationContext.getString(res); } public void onAnimationStart() { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java b/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java index 840422f3..d69a27c7 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Views/NotificationView.java @@ -29,6 +29,7 @@ import org.telegram.messenger.NotificationCenter; import org.telegram.messenger.R; import org.telegram.messenger.Utilities; import org.telegram.objects.MessageObject; +import org.telegram.ui.ApplicationLoader; import java.util.Locale; import java.util.Timer; @@ -119,11 +120,11 @@ public class NotificationView extends LinearLayout { } }); - notificationParentView = new FrameLayout(Utilities.applicationContext); + notificationParentView = new FrameLayout(getContext()); notificationParentView.addView(this); notificationParentView.setFocusable(false); setFocusable(false); - WindowManager wm = (WindowManager)Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + final WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); notificationLayoutParams = new WindowManager.LayoutParams(); notificationLayoutParams.height = 90; notificationLayoutParams.format = PixelFormat.TRANSLUCENT; @@ -131,11 +132,11 @@ public class NotificationView extends LinearLayout { notificationLayoutParams.gravity = Gravity.CLIP_HORIZONTAL | Gravity.TOP; notificationLayoutParams.type = WindowManager.LayoutParams.TYPE_SYSTEM_ERROR; notificationLayoutParams.flags = WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS | WindowManager.LayoutParams.FLAG_WATCH_OUTSIDE_TOUCH | WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE; - notificationLayoutParams.y = -300; isVisible = false; wm.addView(notificationParentView, notificationLayoutParams); + notificationParentView.setVisibility(View.INVISIBLE); - animHide = AnimationUtils.loadAnimation(Utilities.applicationContext, R.anim.slide_up); + animHide = AnimationUtils.loadAnimation(ApplicationLoader.applicationContext, R.anim.slide_up); animHide.setAnimationListener(new Animation.AnimationListener() { public void onAnimationStart(Animation animation) { onScreen = false; @@ -147,14 +148,13 @@ public class NotificationView extends LinearLayout { public void onAnimationEnd(Animation animation) { setVisibility(GONE); - WindowManager wm = (WindowManager)Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + WindowManager wm = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); isVisible = false; - notificationLayoutParams.y = -300; - wm.updateViewLayout(notificationParentView, notificationLayoutParams); + notificationParentView.setVisibility(View.INVISIBLE); } }); - animShow = AnimationUtils.loadAnimation(Utilities.applicationContext, R.anim.slide_down); + animShow = AnimationUtils.loadAnimation(ApplicationLoader.applicationContext, R.anim.slide_down); animShow.setAnimationListener(new Animation.AnimationListener() { public void onAnimationStart(Animation animation) { setVisibility(VISIBLE); @@ -237,10 +237,9 @@ public class NotificationView extends LinearLayout { } if (!onScreen) { - WindowManager wm = (WindowManager)Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + WindowManager wm = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); isVisible = true; - notificationLayoutParams.y = 0; - wm.updateViewLayout(notificationParentView, notificationLayoutParams); + notificationParentView.setVisibility(View.VISIBLE); startAnimation(animShow); } } @@ -261,10 +260,9 @@ public class NotificationView extends LinearLayout { onScreen = false; setVisibility(GONE); if (notificationParentView != null && notificationParentView.getParent() != null) { - WindowManager wm = (WindowManager)Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + WindowManager wm = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); isVisible = false; - notificationLayoutParams.y = -300; - wm.updateViewLayout(notificationParentView, notificationLayoutParams); + notificationParentView.setVisibility(View.INVISIBLE); } } } @@ -276,7 +274,7 @@ public class NotificationView extends LinearLayout { notificationParentView.removeView(this); try { if (notificationParentView.getParent() != null) { - WindowManager wm = (WindowManager)Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + WindowManager wm = (WindowManager)ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); wm.removeViewImmediate(notificationParentView); } } catch (Exception e) { @@ -322,7 +320,7 @@ public class NotificationView extends LinearLayout { if (notificationParentView != null) { notificationLayoutParams.height = height + (int)(2 * density); if (notificationParentView.getParent() != null) { - WindowManager wm = (WindowManager) Utilities.applicationContext.getSystemService(Context.WINDOW_SERVICE); + WindowManager wm = (WindowManager) ApplicationLoader.applicationContext.getSystemService(Context.WINDOW_SERVICE); wm.updateViewLayout(notificationParentView, notificationLayoutParams); } } diff --git a/TMessagesProj/src/main/res/layout-ar/notification_layout.xml b/TMessagesProj/src/main/res/layout-ar/notification_layout.xml index 010d4593..ddd9fd6a 100644 --- a/TMessagesProj/src/main/res/layout-ar/notification_layout.xml +++ b/TMessagesProj/src/main/res/layout-ar/notification_layout.xml @@ -29,7 +29,6 @@ android:gravity="right|center" android:textSize="15dp" android:textColor="#000000" - android:text="Nikolay Kudashov" android:id="@+id/name_text_view" android:paddingTop="4dp" android:ellipsize="end" @@ -41,7 +40,6 @@ android:gravity="right|center" android:textColor="#000000" android:textSize="15dp" - android:text="Hello" android:id="@+id/message_text_view" android:paddingTop="24dp" android:ellipsize="end" diff --git a/TMessagesProj/src/main/res/layout-ar/settings_name_layout.xml b/TMessagesProj/src/main/res/layout-ar/settings_name_layout.xml index fa416044..af4e964a 100644 --- a/TMessagesProj/src/main/res/layout-ar/settings_name_layout.xml +++ b/TMessagesProj/src/main/res/layout-ar/settings_name_layout.xml @@ -24,6 +24,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginRight="14dp" + android:layout_marginLeft="4dp" android:layout_marginTop="2dp" android:layout_weight="1.0" android:gravity="right"> diff --git a/TMessagesProj/src/main/res/layout/chat_group_incoming_forward_layout.xml b/TMessagesProj/src/main/res/layout/chat_group_incoming_forward_layout.xml index 6bf08628..f05733ed 100644 --- a/TMessagesProj/src/main/res/layout/chat_group_incoming_forward_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_group_incoming_forward_layout.xml @@ -64,7 +64,7 @@ android:textSize="16dp" android:linksClickable="false" android:layout_marginBottom="8dp" - android:autoLink="web" + android:autoLink="web|email" android:descendantFocusability="afterDescendants" android:layout_marginTop="53dp" android:layout_gravity="top" diff --git a/TMessagesProj/src/main/res/layout/chat_group_incoming_text_layout.xml b/TMessagesProj/src/main/res/layout/chat_group_incoming_text_layout.xml index dedc4e34..cb696cb0 100644 --- a/TMessagesProj/src/main/res/layout/chat_group_incoming_text_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_group_incoming_text_layout.xml @@ -42,7 +42,7 @@ android:layout_height="wrap_content" android:textSize="16dp" android:layout_marginBottom="8dp" - android:autoLink="web" + android:autoLink="web|email" android:linksClickable="false" android:layout_marginTop="18dp" android:textColor="#000000" diff --git a/TMessagesProj/src/main/res/layout/chat_incoming_forward_layout.xml b/TMessagesProj/src/main/res/layout/chat_incoming_forward_layout.xml index d807ec2a..28e5c491 100644 --- a/TMessagesProj/src/main/res/layout/chat_incoming_forward_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_incoming_forward_layout.xml @@ -42,7 +42,7 @@ android:layout_height="wrap_content" android:textSize="16dp" android:layout_marginBottom="8dp" - android:autoLink="web" + android:autoLink="web|email" android:linksClickable="false" android:layout_marginTop="34dp" android:descendantFocusability="afterDescendants" diff --git a/TMessagesProj/src/main/res/layout/chat_incoming_text_layout.xml b/TMessagesProj/src/main/res/layout/chat_incoming_text_layout.xml index b57ac9e1..140adbe0 100644 --- a/TMessagesProj/src/main/res/layout/chat_incoming_text_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_incoming_text_layout.xml @@ -22,7 +22,7 @@ android:layout_height="wrap_content" android:textSize="16dp" android:layout_marginBottom="8dp" - android:autoLink="web" + android:autoLink="web|email" android:linksClickable="false" android:layout_gravity="top" android:textColor="#000000"/> diff --git a/TMessagesProj/src/main/res/layout/chat_outgoing_forward_layout.xml b/TMessagesProj/src/main/res/layout/chat_outgoing_forward_layout.xml index a47b7d28..fb02429e 100644 --- a/TMessagesProj/src/main/res/layout/chat_outgoing_forward_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_outgoing_forward_layout.xml @@ -43,7 +43,7 @@ android:linksClickable="false" android:layout_marginTop="34dp" android:layout_marginBottom="8dp" - android:autoLink="web" + android:autoLink="web|email" android:descendantFocusability="afterDescendants" android:layout_gravity="top" android:textColor="#000000"/> diff --git a/TMessagesProj/src/main/res/layout/chat_outgoing_text_layout.xml b/TMessagesProj/src/main/res/layout/chat_outgoing_text_layout.xml index 56acbbed..8f2fa500 100644 --- a/TMessagesProj/src/main/res/layout/chat_outgoing_text_layout.xml +++ b/TMessagesProj/src/main/res/layout/chat_outgoing_text_layout.xml @@ -20,7 +20,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:textSize="16dp" - android:autoLink="web" + android:autoLink="web|email" android:linksClickable="false" android:layout_gravity="top" android:textColor="#000000" diff --git a/TMessagesProj/src/main/res/layout/notification_layout.xml b/TMessagesProj/src/main/res/layout/notification_layout.xml index 3cac90c0..905f3272 100644 --- a/TMessagesProj/src/main/res/layout/notification_layout.xml +++ b/TMessagesProj/src/main/res/layout/notification_layout.xml @@ -28,7 +28,6 @@ android:gravity="left|center" android:textSize="15dp" android:textColor="#000000" - android:text="Nikolay Kudashov" android:id="@+id/name_text_view" android:paddingTop="4dp" android:ellipsize="end" @@ -39,7 +38,6 @@ android:gravity="left|center" android:textColor="#000000" android:textSize="15dp" - android:text="Hello" android:id="@+id/message_text_view" android:paddingTop="24dp" android:ellipsize="end" diff --git a/TMessagesProj/src/main/res/layout/settings_name_layout.xml b/TMessagesProj/src/main/res/layout/settings_name_layout.xml index 94c50862..7221e6c4 100644 --- a/TMessagesProj/src/main/res/layout/settings_name_layout.xml +++ b/TMessagesProj/src/main/res/layout/settings_name_layout.xml @@ -25,6 +25,7 @@ android:layout_height="wrap_content" android:layout_marginLeft="14dp" android:layout_marginTop="2dp" + android:layout_marginRight="4dp" android:layout_weight="1.0"> ساعة يوم أسبوع + لديك رسالة جديدة إبحث عن جهات الاتصال diff --git a/TMessagesProj/src/main/res/values/strings.xml b/TMessagesProj/src/main/res/values/strings.xml index 2013b729..b870f385 100644 --- a/TMessagesProj/src/main/res/values/strings.xml +++ b/TMessagesProj/src/main/res/values/strings.xml @@ -89,6 +89,7 @@ 1 hour 1 day 1 week + You have a new message Search contacts @@ -265,4 +266,4 @@ CACHE_TAG - + \ No newline at end of file