mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
Cleanup.
This commit is contained in:
@@ -79,8 +79,6 @@ public class LocaleController {
|
||||
private String languageOverride;
|
||||
private boolean changingConfiguration = false;
|
||||
|
||||
private HashMap<String, String> translitChars;
|
||||
|
||||
private class TimeZoneChangedReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
@@ -902,580 +900,6 @@ public class LocaleController {
|
||||
}
|
||||
*/
|
||||
|
||||
public static String formatUserStatus(TLRPC.User user) {
|
||||
if (user != null && user.status != null && user.status.expires == 0) {
|
||||
if (user.status instanceof TLRPC.TL_userStatusRecently) {
|
||||
user.status.expires = -100;
|
||||
} else if (user.status instanceof TLRPC.TL_userStatusLastWeek) {
|
||||
user.status.expires = -101;
|
||||
} else if (user.status instanceof TLRPC.TL_userStatusLastMonth) {
|
||||
user.status.expires = -102;
|
||||
}
|
||||
}
|
||||
if (user != null && user.status != null && user.status.expires <= 0) {
|
||||
if (MessagesController.getInstance().onlinePrivacy.containsKey(user.id)) {
|
||||
return getString("Online", R.string.Online);
|
||||
}
|
||||
}
|
||||
if (user == null || user.status == null || user.status.expires == 0 ) {
|
||||
return getString("ALongTimeAgo", R.string.ALongTimeAgo);
|
||||
} else {
|
||||
int currentTime = ConnectionsManager.getInstance().getCurrentTime();
|
||||
if (user.status.expires > currentTime) {
|
||||
return getString("Online", R.string.Online);
|
||||
} else {
|
||||
if (user.status.expires == -1) {
|
||||
return getString("Invisible", R.string.Invisible);
|
||||
} else if (user.status.expires == -100) {
|
||||
return getString("Lately", R.string.Lately);
|
||||
} else if (user.status.expires == -101) {
|
||||
return getString("WithinAWeek", R.string.WithinAWeek);
|
||||
} else if (user.status.expires == -102) {
|
||||
return getString("WithinAMonth", R.string.WithinAMonth);
|
||||
} else {
|
||||
return formatDateOnline(user.status.expires);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getTranslitString(String src) {
|
||||
if (translitChars == null) {
|
||||
translitChars = new HashMap<>(520);
|
||||
translitChars.put("ȼ", "c");
|
||||
translitChars.put("ᶇ", "n");
|
||||
translitChars.put("ɖ", "d");
|
||||
translitChars.put("ỿ", "y");
|
||||
translitChars.put("ᴓ", "o");
|
||||
translitChars.put("ø", "o");
|
||||
translitChars.put("ḁ", "a");
|
||||
translitChars.put("ʯ", "h");
|
||||
translitChars.put("ŷ", "y");
|
||||
translitChars.put("ʞ", "k");
|
||||
translitChars.put("ừ", "u");
|
||||
translitChars.put("ꜳ", "aa");
|
||||
translitChars.put("ij", "ij");
|
||||
translitChars.put("ḽ", "l");
|
||||
translitChars.put("ɪ", "i");
|
||||
translitChars.put("ḇ", "b");
|
||||
translitChars.put("ʀ", "r");
|
||||
translitChars.put("ě", "e");
|
||||
translitChars.put("ffi", "ffi");
|
||||
translitChars.put("ơ", "o");
|
||||
translitChars.put("ⱹ", "r");
|
||||
translitChars.put("ồ", "o");
|
||||
translitChars.put("ǐ", "i");
|
||||
translitChars.put("ꝕ", "p");
|
||||
translitChars.put("ý", "y");
|
||||
translitChars.put("ḝ", "e");
|
||||
translitChars.put("ₒ", "o");
|
||||
translitChars.put("ⱥ", "a");
|
||||
translitChars.put("ʙ", "b");
|
||||
translitChars.put("ḛ", "e");
|
||||
translitChars.put("ƈ", "c");
|
||||
translitChars.put("ɦ", "h");
|
||||
translitChars.put("ᵬ", "b");
|
||||
translitChars.put("ṣ", "s");
|
||||
translitChars.put("đ", "d");
|
||||
translitChars.put("ỗ", "o");
|
||||
translitChars.put("ɟ", "j");
|
||||
translitChars.put("ẚ", "a");
|
||||
translitChars.put("ɏ", "y");
|
||||
translitChars.put("л", "l");
|
||||
translitChars.put("ʌ", "v");
|
||||
translitChars.put("ꝓ", "p");
|
||||
translitChars.put("fi", "fi");
|
||||
translitChars.put("ᶄ", "k");
|
||||
translitChars.put("ḏ", "d");
|
||||
translitChars.put("ᴌ", "l");
|
||||
translitChars.put("ė", "e");
|
||||
translitChars.put("ё", "yo");
|
||||
translitChars.put("ᴋ", "k");
|
||||
translitChars.put("ċ", "c");
|
||||
translitChars.put("ʁ", "r");
|
||||
translitChars.put("ƕ", "hv");
|
||||
translitChars.put("ƀ", "b");
|
||||
translitChars.put("ṍ", "o");
|
||||
translitChars.put("ȣ", "ou");
|
||||
translitChars.put("ǰ", "j");
|
||||
translitChars.put("ᶃ", "g");
|
||||
translitChars.put("ṋ", "n");
|
||||
translitChars.put("ɉ", "j");
|
||||
translitChars.put("ǧ", "g");
|
||||
translitChars.put("dz", "dz");
|
||||
translitChars.put("ź", "z");
|
||||
translitChars.put("ꜷ", "au");
|
||||
translitChars.put("ǖ", "u");
|
||||
translitChars.put("ᵹ", "g");
|
||||
translitChars.put("ȯ", "o");
|
||||
translitChars.put("ɐ", "a");
|
||||
translitChars.put("ą", "a");
|
||||
translitChars.put("õ", "o");
|
||||
translitChars.put("ɻ", "r");
|
||||
translitChars.put("ꝍ", "o");
|
||||
translitChars.put("ǟ", "a");
|
||||
translitChars.put("ȴ", "l");
|
||||
translitChars.put("ʂ", "s");
|
||||
translitChars.put("fl", "fl");
|
||||
translitChars.put("ȉ", "i");
|
||||
translitChars.put("ⱻ", "e");
|
||||
translitChars.put("ṉ", "n");
|
||||
translitChars.put("ï", "i");
|
||||
translitChars.put("ñ", "n");
|
||||
translitChars.put("ᴉ", "i");
|
||||
translitChars.put("ʇ", "t");
|
||||
translitChars.put("ẓ", "z");
|
||||
translitChars.put("ỷ", "y");
|
||||
translitChars.put("ȳ", "y");
|
||||
translitChars.put("ṩ", "s");
|
||||
translitChars.put("ɽ", "r");
|
||||
translitChars.put("ĝ", "g");
|
||||
translitChars.put("в", "v");
|
||||
translitChars.put("ᴝ", "u");
|
||||
translitChars.put("ḳ", "k");
|
||||
translitChars.put("ꝫ", "et");
|
||||
translitChars.put("ī", "i");
|
||||
translitChars.put("ť", "t");
|
||||
translitChars.put("ꜿ", "c");
|
||||
translitChars.put("ʟ", "l");
|
||||
translitChars.put("ꜹ", "av");
|
||||
translitChars.put("û", "u");
|
||||
translitChars.put("æ", "ae");
|
||||
translitChars.put("и", "i");
|
||||
translitChars.put("ă", "a");
|
||||
translitChars.put("ǘ", "u");
|
||||
translitChars.put("ꞅ", "s");
|
||||
translitChars.put("ᵣ", "r");
|
||||
translitChars.put("ᴀ", "a");
|
||||
translitChars.put("ƃ", "b");
|
||||
translitChars.put("ḩ", "h");
|
||||
translitChars.put("ṧ", "s");
|
||||
translitChars.put("ₑ", "e");
|
||||
translitChars.put("ʜ", "h");
|
||||
translitChars.put("ẋ", "x");
|
||||
translitChars.put("ꝅ", "k");
|
||||
translitChars.put("ḋ", "d");
|
||||
translitChars.put("ƣ", "oi");
|
||||
translitChars.put("ꝑ", "p");
|
||||
translitChars.put("ħ", "h");
|
||||
translitChars.put("ⱴ", "v");
|
||||
translitChars.put("ẇ", "w");
|
||||
translitChars.put("ǹ", "n");
|
||||
translitChars.put("ɯ", "m");
|
||||
translitChars.put("ɡ", "g");
|
||||
translitChars.put("ɴ", "n");
|
||||
translitChars.put("ᴘ", "p");
|
||||
translitChars.put("ᵥ", "v");
|
||||
translitChars.put("ū", "u");
|
||||
translitChars.put("ḃ", "b");
|
||||
translitChars.put("ṗ", "p");
|
||||
translitChars.put("ь", "");
|
||||
translitChars.put("å", "a");
|
||||
translitChars.put("ɕ", "c");
|
||||
translitChars.put("ọ", "o");
|
||||
translitChars.put("ắ", "a");
|
||||
translitChars.put("ƒ", "f");
|
||||
translitChars.put("ǣ", "ae");
|
||||
translitChars.put("ꝡ", "vy");
|
||||
translitChars.put("ff", "ff");
|
||||
translitChars.put("ᶉ", "r");
|
||||
translitChars.put("ô", "o");
|
||||
translitChars.put("ǿ", "o");
|
||||
translitChars.put("ṳ", "u");
|
||||
translitChars.put("ȥ", "z");
|
||||
translitChars.put("ḟ", "f");
|
||||
translitChars.put("ḓ", "d");
|
||||
translitChars.put("ȇ", "e");
|
||||
translitChars.put("ȕ", "u");
|
||||
translitChars.put("п", "p");
|
||||
translitChars.put("ȵ", "n");
|
||||
translitChars.put("ʠ", "q");
|
||||
translitChars.put("ấ", "a");
|
||||
translitChars.put("ǩ", "k");
|
||||
translitChars.put("ĩ", "i");
|
||||
translitChars.put("ṵ", "u");
|
||||
translitChars.put("ŧ", "t");
|
||||
translitChars.put("ɾ", "r");
|
||||
translitChars.put("ƙ", "k");
|
||||
translitChars.put("ṫ", "t");
|
||||
translitChars.put("ꝗ", "q");
|
||||
translitChars.put("ậ", "a");
|
||||
translitChars.put("н", "n");
|
||||
translitChars.put("ʄ", "j");
|
||||
translitChars.put("ƚ", "l");
|
||||
translitChars.put("ᶂ", "f");
|
||||
translitChars.put("д", "d");
|
||||
translitChars.put("ᵴ", "s");
|
||||
translitChars.put("ꞃ", "r");
|
||||
translitChars.put("ᶌ", "v");
|
||||
translitChars.put("ɵ", "o");
|
||||
translitChars.put("ḉ", "c");
|
||||
translitChars.put("ᵤ", "u");
|
||||
translitChars.put("ẑ", "z");
|
||||
translitChars.put("ṹ", "u");
|
||||
translitChars.put("ň", "n");
|
||||
translitChars.put("ʍ", "w");
|
||||
translitChars.put("ầ", "a");
|
||||
translitChars.put("lj", "lj");
|
||||
translitChars.put("ɓ", "b");
|
||||
translitChars.put("ɼ", "r");
|
||||
translitChars.put("ò", "o");
|
||||
translitChars.put("ẘ", "w");
|
||||
translitChars.put("ɗ", "d");
|
||||
translitChars.put("ꜽ", "ay");
|
||||
translitChars.put("ư", "u");
|
||||
translitChars.put("ᶀ", "b");
|
||||
translitChars.put("ǜ", "u");
|
||||
translitChars.put("ẹ", "e");
|
||||
translitChars.put("ǡ", "a");
|
||||
translitChars.put("ɥ", "h");
|
||||
translitChars.put("ṏ", "o");
|
||||
translitChars.put("ǔ", "u");
|
||||
translitChars.put("ʎ", "y");
|
||||
translitChars.put("ȱ", "o");
|
||||
translitChars.put("ệ", "e");
|
||||
translitChars.put("ế", "e");
|
||||
translitChars.put("ĭ", "i");
|
||||
translitChars.put("ⱸ", "e");
|
||||
translitChars.put("ṯ", "t");
|
||||
translitChars.put("ᶑ", "d");
|
||||
translitChars.put("ḧ", "h");
|
||||
translitChars.put("ṥ", "s");
|
||||
translitChars.put("ë", "e");
|
||||
translitChars.put("ᴍ", "m");
|
||||
translitChars.put("ö", "o");
|
||||
translitChars.put("é", "e");
|
||||
translitChars.put("ı", "i");
|
||||
translitChars.put("ď", "d");
|
||||
translitChars.put("ᵯ", "m");
|
||||
translitChars.put("ỵ", "y");
|
||||
translitChars.put("я", "ya");
|
||||
translitChars.put("ŵ", "w");
|
||||
translitChars.put("ề", "e");
|
||||
translitChars.put("ứ", "u");
|
||||
translitChars.put("ƶ", "z");
|
||||
translitChars.put("ĵ", "j");
|
||||
translitChars.put("ḍ", "d");
|
||||
translitChars.put("ŭ", "u");
|
||||
translitChars.put("ʝ", "j");
|
||||
translitChars.put("ж", "zh");
|
||||
translitChars.put("ê", "e");
|
||||
translitChars.put("ǚ", "u");
|
||||
translitChars.put("ġ", "g");
|
||||
translitChars.put("ṙ", "r");
|
||||
translitChars.put("ƞ", "n");
|
||||
translitChars.put("ъ", "");
|
||||
translitChars.put("ḗ", "e");
|
||||
translitChars.put("ẝ", "s");
|
||||
translitChars.put("ᶁ", "d");
|
||||
translitChars.put("ķ", "k");
|
||||
translitChars.put("ᴂ", "ae");
|
||||
translitChars.put("ɘ", "e");
|
||||
translitChars.put("ợ", "o");
|
||||
translitChars.put("ḿ", "m");
|
||||
translitChars.put("ꜰ", "f");
|
||||
translitChars.put("а", "a");
|
||||
translitChars.put("ẵ", "a");
|
||||
translitChars.put("ꝏ", "oo");
|
||||
translitChars.put("ᶆ", "m");
|
||||
translitChars.put("ᵽ", "p");
|
||||
translitChars.put("ц", "ts");
|
||||
translitChars.put("ữ", "u");
|
||||
translitChars.put("ⱪ", "k");
|
||||
translitChars.put("ḥ", "h");
|
||||
translitChars.put("ţ", "t");
|
||||
translitChars.put("ᵱ", "p");
|
||||
translitChars.put("ṁ", "m");
|
||||
translitChars.put("á", "a");
|
||||
translitChars.put("ᴎ", "n");
|
||||
translitChars.put("ꝟ", "v");
|
||||
translitChars.put("è", "e");
|
||||
translitChars.put("ᶎ", "z");
|
||||
translitChars.put("ꝺ", "d");
|
||||
translitChars.put("ᶈ", "p");
|
||||
translitChars.put("м", "m");
|
||||
translitChars.put("ɫ", "l");
|
||||
translitChars.put("ᴢ", "z");
|
||||
translitChars.put("ɱ", "m");
|
||||
translitChars.put("ṝ", "r");
|
||||
translitChars.put("ṽ", "v");
|
||||
translitChars.put("ũ", "u");
|
||||
translitChars.put("ß", "ss");
|
||||
translitChars.put("т", "t");
|
||||
translitChars.put("ĥ", "h");
|
||||
translitChars.put("ᵵ", "t");
|
||||
translitChars.put("ʐ", "z");
|
||||
translitChars.put("ṟ", "r");
|
||||
translitChars.put("ɲ", "n");
|
||||
translitChars.put("à", "a");
|
||||
translitChars.put("ẙ", "y");
|
||||
translitChars.put("ỳ", "y");
|
||||
translitChars.put("ᴔ", "oe");
|
||||
translitChars.put("ы", "i");
|
||||
translitChars.put("ₓ", "x");
|
||||
translitChars.put("ȗ", "u");
|
||||
translitChars.put("ⱼ", "j");
|
||||
translitChars.put("ẫ", "a");
|
||||
translitChars.put("ʑ", "z");
|
||||
translitChars.put("ẛ", "s");
|
||||
translitChars.put("ḭ", "i");
|
||||
translitChars.put("ꜵ", "ao");
|
||||
translitChars.put("ɀ", "z");
|
||||
translitChars.put("ÿ", "y");
|
||||
translitChars.put("ǝ", "e");
|
||||
translitChars.put("ǭ", "o");
|
||||
translitChars.put("ᴅ", "d");
|
||||
translitChars.put("ᶅ", "l");
|
||||
translitChars.put("ù", "u");
|
||||
translitChars.put("ạ", "a");
|
||||
translitChars.put("ḅ", "b");
|
||||
translitChars.put("ụ", "u");
|
||||
translitChars.put("к", "k");
|
||||
translitChars.put("ằ", "a");
|
||||
translitChars.put("ᴛ", "t");
|
||||
translitChars.put("ƴ", "y");
|
||||
translitChars.put("ⱦ", "t");
|
||||
translitChars.put("з", "z");
|
||||
translitChars.put("ⱡ", "l");
|
||||
translitChars.put("ȷ", "j");
|
||||
translitChars.put("ᵶ", "z");
|
||||
translitChars.put("ḫ", "h");
|
||||
translitChars.put("ⱳ", "w");
|
||||
translitChars.put("ḵ", "k");
|
||||
translitChars.put("ờ", "o");
|
||||
translitChars.put("î", "i");
|
||||
translitChars.put("ģ", "g");
|
||||
translitChars.put("ȅ", "e");
|
||||
translitChars.put("ȧ", "a");
|
||||
translitChars.put("ẳ", "a");
|
||||
translitChars.put("щ", "sch");
|
||||
translitChars.put("ɋ", "q");
|
||||
translitChars.put("ṭ", "t");
|
||||
translitChars.put("ꝸ", "um");
|
||||
translitChars.put("ᴄ", "c");
|
||||
translitChars.put("ẍ", "x");
|
||||
translitChars.put("ủ", "u");
|
||||
translitChars.put("ỉ", "i");
|
||||
translitChars.put("ᴚ", "r");
|
||||
translitChars.put("ś", "s");
|
||||
translitChars.put("ꝋ", "o");
|
||||
translitChars.put("ỹ", "y");
|
||||
translitChars.put("ṡ", "s");
|
||||
translitChars.put("nj", "nj");
|
||||
translitChars.put("ȁ", "a");
|
||||
translitChars.put("ẗ", "t");
|
||||
translitChars.put("ĺ", "l");
|
||||
translitChars.put("ž", "z");
|
||||
translitChars.put("ᵺ", "th");
|
||||
translitChars.put("ƌ", "d");
|
||||
translitChars.put("ș", "s");
|
||||
translitChars.put("š", "s");
|
||||
translitChars.put("ᶙ", "u");
|
||||
translitChars.put("ẽ", "e");
|
||||
translitChars.put("ẜ", "s");
|
||||
translitChars.put("ɇ", "e");
|
||||
translitChars.put("ṷ", "u");
|
||||
translitChars.put("ố", "o");
|
||||
translitChars.put("ȿ", "s");
|
||||
translitChars.put("ᴠ", "v");
|
||||
translitChars.put("ꝭ", "is");
|
||||
translitChars.put("ᴏ", "o");
|
||||
translitChars.put("ɛ", "e");
|
||||
translitChars.put("ǻ", "a");
|
||||
translitChars.put("ffl", "ffl");
|
||||
translitChars.put("ⱺ", "o");
|
||||
translitChars.put("ȋ", "i");
|
||||
translitChars.put("ᵫ", "ue");
|
||||
translitChars.put("ȡ", "d");
|
||||
translitChars.put("ⱬ", "z");
|
||||
translitChars.put("ẁ", "w");
|
||||
translitChars.put("ᶏ", "a");
|
||||
translitChars.put("ꞇ", "t");
|
||||
translitChars.put("ğ", "g");
|
||||
translitChars.put("ɳ", "n");
|
||||
translitChars.put("ʛ", "g");
|
||||
translitChars.put("ᴜ", "u");
|
||||
translitChars.put("ф", "f");
|
||||
translitChars.put("ẩ", "a");
|
||||
translitChars.put("ṅ", "n");
|
||||
translitChars.put("ɨ", "i");
|
||||
translitChars.put("ᴙ", "r");
|
||||
translitChars.put("ǎ", "a");
|
||||
translitChars.put("ſ", "s");
|
||||
translitChars.put("у", "u");
|
||||
translitChars.put("ȫ", "o");
|
||||
translitChars.put("ɿ", "r");
|
||||
translitChars.put("ƭ", "t");
|
||||
translitChars.put("ḯ", "i");
|
||||
translitChars.put("ǽ", "ae");
|
||||
translitChars.put("ⱱ", "v");
|
||||
translitChars.put("ɶ", "oe");
|
||||
translitChars.put("ṃ", "m");
|
||||
translitChars.put("ż", "z");
|
||||
translitChars.put("ĕ", "e");
|
||||
translitChars.put("ꜻ", "av");
|
||||
translitChars.put("ở", "o");
|
||||
translitChars.put("ễ", "e");
|
||||
translitChars.put("ɬ", "l");
|
||||
translitChars.put("ị", "i");
|
||||
translitChars.put("ᵭ", "d");
|
||||
translitChars.put("st", "st");
|
||||
translitChars.put("ḷ", "l");
|
||||
translitChars.put("ŕ", "r");
|
||||
translitChars.put("ᴕ", "ou");
|
||||
translitChars.put("ʈ", "t");
|
||||
translitChars.put("ā", "a");
|
||||
translitChars.put("э", "e");
|
||||
translitChars.put("ḙ", "e");
|
||||
translitChars.put("ᴑ", "o");
|
||||
translitChars.put("ç", "c");
|
||||
translitChars.put("ᶊ", "s");
|
||||
translitChars.put("ặ", "a");
|
||||
translitChars.put("ų", "u");
|
||||
translitChars.put("ả", "a");
|
||||
translitChars.put("ǥ", "g");
|
||||
translitChars.put("р", "r");
|
||||
translitChars.put("ꝁ", "k");
|
||||
translitChars.put("ẕ", "z");
|
||||
translitChars.put("ŝ", "s");
|
||||
translitChars.put("ḕ", "e");
|
||||
translitChars.put("ɠ", "g");
|
||||
translitChars.put("ꝉ", "l");
|
||||
translitChars.put("ꝼ", "f");
|
||||
translitChars.put("ᶍ", "x");
|
||||
translitChars.put("х", "h");
|
||||
translitChars.put("ǒ", "o");
|
||||
translitChars.put("ę", "e");
|
||||
translitChars.put("ổ", "o");
|
||||
translitChars.put("ƫ", "t");
|
||||
translitChars.put("ǫ", "o");
|
||||
translitChars.put("i̇", "i");
|
||||
translitChars.put("ṇ", "n");
|
||||
translitChars.put("ć", "c");
|
||||
translitChars.put("ᵷ", "g");
|
||||
translitChars.put("ẅ", "w");
|
||||
translitChars.put("ḑ", "d");
|
||||
translitChars.put("ḹ", "l");
|
||||
translitChars.put("ч", "ch");
|
||||
translitChars.put("œ", "oe");
|
||||
translitChars.put("ᵳ", "r");
|
||||
translitChars.put("ļ", "l");
|
||||
translitChars.put("ȑ", "r");
|
||||
translitChars.put("ȭ", "o");
|
||||
translitChars.put("ᵰ", "n");
|
||||
translitChars.put("ᴁ", "ae");
|
||||
translitChars.put("ŀ", "l");
|
||||
translitChars.put("ä", "a");
|
||||
translitChars.put("ƥ", "p");
|
||||
translitChars.put("ỏ", "o");
|
||||
translitChars.put("į", "i");
|
||||
translitChars.put("ȓ", "r");
|
||||
translitChars.put("dž", "dz");
|
||||
translitChars.put("ḡ", "g");
|
||||
translitChars.put("ṻ", "u");
|
||||
translitChars.put("ō", "o");
|
||||
translitChars.put("ľ", "l");
|
||||
translitChars.put("ẃ", "w");
|
||||
translitChars.put("ț", "t");
|
||||
translitChars.put("ń", "n");
|
||||
translitChars.put("ɍ", "r");
|
||||
translitChars.put("ȃ", "a");
|
||||
translitChars.put("ü", "u");
|
||||
translitChars.put("ꞁ", "l");
|
||||
translitChars.put("ᴐ", "o");
|
||||
translitChars.put("ớ", "o");
|
||||
translitChars.put("ᴃ", "b");
|
||||
translitChars.put("ɹ", "r");
|
||||
translitChars.put("ᵲ", "r");
|
||||
translitChars.put("ʏ", "y");
|
||||
translitChars.put("ᵮ", "f");
|
||||
translitChars.put("ⱨ", "h");
|
||||
translitChars.put("ŏ", "o");
|
||||
translitChars.put("ú", "u");
|
||||
translitChars.put("ṛ", "r");
|
||||
translitChars.put("ʮ", "h");
|
||||
translitChars.put("ó", "o");
|
||||
translitChars.put("ů", "u");
|
||||
translitChars.put("ỡ", "o");
|
||||
translitChars.put("ṕ", "p");
|
||||
translitChars.put("ᶖ", "i");
|
||||
translitChars.put("ự", "u");
|
||||
translitChars.put("ã", "a");
|
||||
translitChars.put("ᵢ", "i");
|
||||
translitChars.put("ṱ", "t");
|
||||
translitChars.put("ể", "e");
|
||||
translitChars.put("ử", "u");
|
||||
translitChars.put("í", "i");
|
||||
translitChars.put("ɔ", "o");
|
||||
translitChars.put("с", "s");
|
||||
translitChars.put("й", "i");
|
||||
translitChars.put("ɺ", "r");
|
||||
translitChars.put("ɢ", "g");
|
||||
translitChars.put("ř", "r");
|
||||
translitChars.put("ẖ", "h");
|
||||
translitChars.put("ű", "u");
|
||||
translitChars.put("ȍ", "o");
|
||||
translitChars.put("ш", "sh");
|
||||
translitChars.put("ḻ", "l");
|
||||
translitChars.put("ḣ", "h");
|
||||
translitChars.put("ȶ", "t");
|
||||
translitChars.put("ņ", "n");
|
||||
translitChars.put("ᶒ", "e");
|
||||
translitChars.put("ì", "i");
|
||||
translitChars.put("ẉ", "w");
|
||||
translitChars.put("б", "b");
|
||||
translitChars.put("ē", "e");
|
||||
translitChars.put("ᴇ", "e");
|
||||
translitChars.put("ł", "l");
|
||||
translitChars.put("ộ", "o");
|
||||
translitChars.put("ɭ", "l");
|
||||
translitChars.put("ẏ", "y");
|
||||
translitChars.put("ᴊ", "j");
|
||||
translitChars.put("ḱ", "k");
|
||||
translitChars.put("ṿ", "v");
|
||||
translitChars.put("ȩ", "e");
|
||||
translitChars.put("â", "a");
|
||||
translitChars.put("ş", "s");
|
||||
translitChars.put("ŗ", "r");
|
||||
translitChars.put("ʋ", "v");
|
||||
translitChars.put("ₐ", "a");
|
||||
translitChars.put("ↄ", "c");
|
||||
translitChars.put("ᶓ", "e");
|
||||
translitChars.put("ɰ", "m");
|
||||
translitChars.put("е", "e");
|
||||
translitChars.put("ᴡ", "w");
|
||||
translitChars.put("ȏ", "o");
|
||||
translitChars.put("č", "c");
|
||||
translitChars.put("ǵ", "g");
|
||||
translitChars.put("ĉ", "c");
|
||||
translitChars.put("ю", "yu");
|
||||
translitChars.put("ᶗ", "o");
|
||||
translitChars.put("ꝃ", "k");
|
||||
translitChars.put("ꝙ", "q");
|
||||
translitChars.put("г", "g");
|
||||
translitChars.put("ṑ", "o");
|
||||
translitChars.put("ꜱ", "s");
|
||||
translitChars.put("ṓ", "o");
|
||||
translitChars.put("ȟ", "h");
|
||||
translitChars.put("ő", "o");
|
||||
translitChars.put("ꜩ", "tz");
|
||||
translitChars.put("ẻ", "e");
|
||||
translitChars.put("о", "o");
|
||||
}
|
||||
StringBuilder dst = new StringBuilder(src.length());
|
||||
int len = src.length();
|
||||
for (int a = 0; a < len; a++) {
|
||||
String ch = src.substring(a, a + 1);
|
||||
String tch = translitChars.get(ch);
|
||||
if (tch != null) {
|
||||
dst.append(tch);
|
||||
} else {
|
||||
dst.append(ch);
|
||||
}
|
||||
}
|
||||
return dst.toString();
|
||||
}
|
||||
|
||||
abstract public static class PluralRules {
|
||||
abstract int quantityForNumber(int n);
|
||||
}
|
||||
|
||||
@@ -205,7 +205,6 @@ public class TLRPC {
|
||||
public String username;
|
||||
public String phone;
|
||||
public UserProfilePhoto photo;
|
||||
public UserStatus status;
|
||||
public int flags;
|
||||
public boolean self;
|
||||
public boolean contact;
|
||||
@@ -314,25 +313,6 @@ public class TLRPC {
|
||||
public static class TL_inputStickerSetEmpty extends InputStickerSet {
|
||||
}
|
||||
|
||||
public static class TL_inputStickerSetID extends InputStickerSet {
|
||||
}
|
||||
|
||||
public static class TL_inputStickerSetShortName extends InputStickerSet {
|
||||
}
|
||||
|
||||
public static class UserStatus extends TLObject {
|
||||
public int expires;
|
||||
}
|
||||
|
||||
public static class TL_userStatusLastWeek extends UserStatus {
|
||||
}
|
||||
|
||||
public static class TL_userStatusLastMonth extends UserStatus {
|
||||
}
|
||||
|
||||
public static class TL_userStatusRecently extends UserStatus {
|
||||
}
|
||||
|
||||
public static class InputEncryptedFile extends TLObject {
|
||||
public long id;
|
||||
public int parts;
|
||||
|
||||
@@ -286,15 +286,7 @@ public class ProfileSearchCell extends BaseCell {
|
||||
if (subLabel != null) {
|
||||
onlineString = subLabel;
|
||||
} else if (user != null) {
|
||||
/*if (user.bot) {
|
||||
onlineString = LocaleController.getString("Bot", R.string.Bot);
|
||||
} else*/ {
|
||||
onlineString = LocaleController.formatUserStatus(user);
|
||||
if (user != null && (user.id == UserConfig.getClientUserId() || user.status != null && user.status.expires > ConnectionsManager.getInstance().getCurrentTime())) {
|
||||
currentOnlinePaint = onlinePaint;
|
||||
onlineString = LocaleController.getString("Online", R.string.Online);
|
||||
}
|
||||
}
|
||||
onlineString = "ErrOnline";
|
||||
}
|
||||
|
||||
CharSequence onlineStringFinal = TextUtils.ellipsize(onlineString, currentOnlinePaint, onlineWidth - AndroidUtilities.dp(12), TextUtils.TruncateAt.END);
|
||||
@@ -385,9 +377,6 @@ public class ProfileSearchCell extends BaseCell {
|
||||
}
|
||||
if (!continueUpdate && (mask & MessagesController.UPDATE_MASK_STATUS) != 0 && user != null) {
|
||||
int newStatus = 0;
|
||||
if (user.status != null) {
|
||||
newStatus = user.status.expires;
|
||||
}
|
||||
if (newStatus != lastStatus) {
|
||||
continueUpdate = true;
|
||||
}
|
||||
@@ -416,11 +405,7 @@ public class ProfileSearchCell extends BaseCell {
|
||||
}
|
||||
|
||||
if (user != null) {
|
||||
if (user.status != null) {
|
||||
lastStatus = user.status.expires;
|
||||
} else {
|
||||
lastStatus = 0;
|
||||
}
|
||||
lastStatus = 0;
|
||||
lastName = user.first_name + user.last_name;
|
||||
} else if (chat != null) {
|
||||
lastName = chat.title;
|
||||
|
||||
@@ -133,6 +133,10 @@ import java.util.regex.Matcher;
|
||||
public class ChatActivity extends BaseFragment implements NotificationCenter.NotificationCenterDelegate, DialogsActivity.DialogsActivityDelegate,
|
||||
PhotoViewer.PhotoViewerProvider {
|
||||
|
||||
// the data
|
||||
private long dialog_id;
|
||||
public MrChat m_mrChat = new MrChat(0);
|
||||
|
||||
// the list view
|
||||
private RecyclerListView chatListView;
|
||||
private static final int ROWTYPE_MESSAGE_CELL = 0;
|
||||
@@ -143,8 +147,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private MessageObject unreadMessageObject;
|
||||
|
||||
// misc
|
||||
protected TLRPC.Chat currentChat;
|
||||
public MrChat m_mrChat = new MrChat(0);
|
||||
private FrameLayout bottomOverlay;
|
||||
protected ChatActivityEnterView chatActivityEnterView;
|
||||
private ActionBarMenuItem menuItem;
|
||||
@@ -161,7 +163,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private NumberTextView selectedMessagesCountTextView;
|
||||
private SimpleTextView actionModeTextView;
|
||||
private SimpleTextView actionModeSubTextView;
|
||||
private RecyclerListView.OnItemClickListener mentionsOnItemClickListener;
|
||||
private TextView muteMenuEntry;
|
||||
private boolean m_canMute;
|
||||
private FrameLayout pagedownButton;
|
||||
@@ -192,8 +193,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
private boolean openSearchKeyboard;
|
||||
|
||||
private AnimatorSet runningAnimation;
|
||||
|
||||
private MessageObject forwaringMessage;
|
||||
private boolean paused = true;
|
||||
private boolean wasPaused = false;
|
||||
@@ -205,13 +204,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
private boolean scrollToTopOnResume;
|
||||
private boolean forceScrollToTop;
|
||||
private boolean scrollToTopUnReadOnResume;
|
||||
private long dialog_id;
|
||||
|
||||
private HashMap<Integer, MessageObject>[] selectedMessagesIds = new HashMap[]{new HashMap<>(), new HashMap<>()};
|
||||
private HashMap<Integer, MessageObject>[] selectedMessagesCanCopyIds = new HashMap[]{new HashMap<>(), new HashMap<>()};
|
||||
|
||||
private int newUnreadMessageCount;
|
||||
|
||||
|
||||
private HashMap<String, ArrayList<MessageObject>> messagesByDays = new HashMap<>(); // used to add/remove date headlines
|
||||
private int maxMessageId = Integer.MAX_VALUE;
|
||||
private int minMessageId = Integer.MIN_VALUE;
|
||||
@@ -254,28 +252,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
private final static int id_chat_compose_panel = 1000;
|
||||
|
||||
RecyclerListView.OnItemLongClickListener onItemLongClickListener = new RecyclerListView.OnItemLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemClick(View view, int position) {
|
||||
if (!actionBar.isActionModeShowed()) {
|
||||
handleClick(view, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
RecyclerListView.OnItemClickListener onItemClickListener = new RecyclerListView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
if (actionBar.isActionModeShowed()) {
|
||||
processRowSelect(view);
|
||||
return;
|
||||
}
|
||||
handleClick(view, false);
|
||||
}
|
||||
};
|
||||
|
||||
public ChatActivity(Bundle args) {
|
||||
super(args);
|
||||
}
|
||||
@@ -284,8 +260,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
public boolean onFragmentCreate() {
|
||||
dialog_id = arguments.getInt("chat_id", 0);
|
||||
m_mrChat = MrMailbox.getChat((int)dialog_id);
|
||||
currentChat = new TLRPC.Chat();
|
||||
currentChat.id = (int)dialog_id;
|
||||
|
||||
startLoadFromMessageId = arguments.getInt("message_id", 0);
|
||||
scrollToTopOnResume = arguments.getBoolean("scrollToTopOnResume", false);
|
||||
@@ -1255,8 +1229,26 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
chatLayoutManager.setStackFromEnd(true);
|
||||
chatListView.setLayoutManager(chatLayoutManager);
|
||||
contentView.addView(chatListView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
|
||||
chatListView.setOnItemLongClickListener(onItemLongClickListener);
|
||||
chatListView.setOnItemClickListener(onItemClickListener);
|
||||
chatListView.setOnItemLongClickListener(new RecyclerListView.OnItemLongClickListener() {
|
||||
@Override
|
||||
public boolean onItemClick(View view, int position) {
|
||||
if (!actionBar.isActionModeShowed()) {
|
||||
handleClick(view, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
chatListView.setOnItemClickListener(new RecyclerListView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
if (actionBar.isActionModeShowed()) {
|
||||
processRowSelect(view);
|
||||
return;
|
||||
}
|
||||
handleClick(view, false);
|
||||
}
|
||||
});
|
||||
chatListView.setOnScrollListener(new RecyclerView.OnScrollListener() {
|
||||
|
||||
private float totalDy = 0;
|
||||
@@ -1628,8 +1620,8 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
mentionsAdapter.setParentFragment(this);
|
||||
mentionsAdapter.setChatInfo(info);
|
||||
mentionsAdapter.setNeedUsernames(currentChat != null);
|
||||
mentionListView.setOnItemClickListener(mentionsOnItemClickListener = new RecyclerListView.OnItemClickListener() {
|
||||
mentionsAdapter.setNeedUsernames(m_mrChat.getType()==MrChat.MR_CHAT_GROUP);
|
||||
mentionListView.setOnItemClickListener(new RecyclerListView.OnItemClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View view, int position) {
|
||||
Object object = mentionsAdapter.getItem(position);
|
||||
@@ -1742,7 +1734,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
|
||||
@Override
|
||||
public void onTextChanged(final CharSequence text, boolean bigChange) {
|
||||
MediaController.getInstance().setInputFieldHasText(text != null && text.length() != 0 || chatActivityEnterView.isEditingMessage());
|
||||
MediaController.getInstance().setInputFieldHasText(text != null && text.length() != 0);
|
||||
if (mentionsAdapter != null && text!=null ) {
|
||||
mentionsAdapter.searchUsernameOrHashtag(text.toString(), chatActivityEnterView.getCursorPosition(), messages);
|
||||
}
|
||||
@@ -1750,7 +1742,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
AndroidUtilities.cancelRunOnUIThread(waitingForCharaterEnterRunnable);
|
||||
waitingForCharaterEnterRunnable = null;
|
||||
}
|
||||
if (chatActivityEnterView.isMessageWebPageSearchEnabled() && (!chatActivityEnterView.isEditingMessage() || !chatActivityEnterView.isEditingCaption())) {
|
||||
if( chatActivityEnterView.isMessageWebPageSearchEnabled() ) {
|
||||
if (bigChange) {
|
||||
searchLinks(text, true);
|
||||
} else {
|
||||
@@ -3568,11 +3560,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
});
|
||||
}
|
||||
|
||||
if (chatActivityEnterView == null || !chatActivityEnterView.isEditingMessage()) {
|
||||
chatListView.setOnItemLongClickListener(onItemLongClickListener);
|
||||
chatListView.setOnItemClickListener(onItemClickListener);
|
||||
chatListView.setLongClickable(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3588,11 +3575,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
CharSequence draftMessage = null;
|
||||
if (chatActivityEnterView != null) {
|
||||
chatActivityEnterView.onPause();
|
||||
if (!chatActivityEnterView.isEditingMessage()) {
|
||||
CharSequence text = AndroidUtilities.getTrimmedString(chatActivityEnterView.getFieldText());
|
||||
if (!TextUtils.isEmpty(text) && !TextUtils.equals(text, "@gif")) {
|
||||
draftMessage = text;
|
||||
}
|
||||
CharSequence text = AndroidUtilities.getTrimmedString(chatActivityEnterView.getFieldText());
|
||||
if (!TextUtils.isEmpty(text) && !TextUtils.equals(text, "@gif")) {
|
||||
draftMessage = text;
|
||||
}
|
||||
chatActivityEnterView.setFieldFocused(false);
|
||||
}
|
||||
@@ -3970,9 +3955,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
object.imageReceiver = imageReceiver;
|
||||
object.thumb = imageReceiver.getBitmap();
|
||||
object.radius = imageReceiver.getRoundRadius();
|
||||
if (view instanceof ChatActionCell && currentChat != null) {
|
||||
object.dialogId = -currentChat.id;
|
||||
}
|
||||
object.dialogId = (int)dialog_id;
|
||||
return object;
|
||||
}
|
||||
}
|
||||
@@ -4129,7 +4112,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
||||
processRowSelect(cell);
|
||||
return;
|
||||
}
|
||||
if (chat != null && chat != currentChat) {
|
||||
if (chat != null && chat.id != dialog_id) {
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("chat_id", chat.id);
|
||||
if (postId != 0) {
|
||||
|
||||
@@ -647,7 +647,7 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
if ((int) dialog_id > 0) {
|
||||
currentUser = MessagesController.getInstance().getUser((int) dialog_id);
|
||||
}
|
||||
if (currentUser != null && (currentUser.id == UserConfig.getClientUserId() || currentUser.status != null && currentUser.status.expires < currentTime && !MessagesController.getInstance().onlinePrivacy.containsKey(currentUser.id))) {
|
||||
if (currentUser != null && (currentUser.id == UserConfig.getClientUserId() || currentUser.status != null && currentUser.status.expires_ < currentTime && !MessagesController.getInstance().onlinePrivacy.containsKey(currentUser.id))) {
|
||||
return;
|
||||
}
|
||||
lastTypingTimeSend = System.currentTimeMillis();
|
||||
@@ -1934,15 +1934,6 @@ public class ChatActivityEnterView extends FrameLayout implements NotificationCe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean isEditingMessage() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isEditingCaption() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasAudioToSend() {
|
||||
return audioToSendMessageObject != null;
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ import android.widget.Toast;
|
||||
|
||||
import com.b44t.messenger.AndroidUtilities;
|
||||
import com.b44t.messenger.ImageLoader;
|
||||
import com.b44t.messenger.MrChat;
|
||||
import com.b44t.messenger.MrContact;
|
||||
import com.b44t.messenger.MrMailbox;
|
||||
import com.b44t.messenger.exoplayer.AspectRatioFrameLayout;
|
||||
@@ -2628,7 +2629,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
|
||||
cropItem.setVisibility(obj instanceof MediaController.PhotoEntry || obj instanceof MediaController.SearchImage && ((MediaController.SearchImage) obj).type == 0 ? View.VISIBLE : View.GONE);
|
||||
if (parentChatActivity != null /*&& (parentChatActivity.currentEncryptedChat == null || AndroidUtilities.getPeerLayerVersion(parentChatActivity.currentEncryptedChat.layer) >= 46)*/) {
|
||||
mentionsAdapter.setChatInfo(parentChatActivity.info);
|
||||
mentionsAdapter.setNeedUsernames(parentChatActivity.currentChat != null);
|
||||
mentionsAdapter.setNeedUsernames(parentChatActivity.m_mrChat.getType()== MrChat.MR_CHAT_GROUP);
|
||||
//captionItem.setVisibility(cropItem.getVisibility());
|
||||
//captionEditText.setVisibility(cropItem.getVisibility());
|
||||
//needCaptionLayout = captionItem.getVisibility() == View.VISIBLE;
|
||||
|
||||
Reference in New Issue
Block a user