Commit ad0188ba authored by DrKLO's avatar DrKLO

Update locales, bug fixes

parent 01e0b7ae
......@@ -81,7 +81,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 250
versionCode 251
versionName "1.5.0"
}
}
......@@ -17,7 +17,7 @@ import java.util.Map;
public class SQLiteDatabase {
private final int sqliteHandle;
private final Map<String, SQLitePreparedStatement> preparedMap;
private final Map<String, SQLitePreparedStatement> preparedMap = new HashMap<String, SQLitePreparedStatement>();
private boolean isOpen = false;
private boolean inTransaction = false;
......@@ -28,7 +28,6 @@ public class SQLiteDatabase {
public SQLiteDatabase(String fileName) throws SQLiteException {
sqliteHandle = opendb(fileName, ApplicationLoader.applicationContext.getFilesDir().getPath());
isOpen = true;
preparedMap = new HashMap<String, SQLitePreparedStatement>();
}
public boolean tableExists(String tableName) throws SQLiteException {
......@@ -47,7 +46,7 @@ public class SQLiteDatabase {
}
}
public SQLitePreparedStatement executeFast(String sql) throws SQLiteException{
public SQLitePreparedStatement executeFast(String sql) throws SQLiteException {
return new SQLitePreparedStatement(this, sql, true);
}
......@@ -64,29 +63,6 @@ public class SQLiteDatabase {
}
}
public int executeIntOrThrow(String sql, Object... args) throws SQLiteException, SQLiteNoRowException {
checkOpened();
Integer val = executeInt(sql, args);
if (val != null) {
return val;
}
throw new SQLiteNoRowException();
}
public String executeString(String sql, Object... args) throws SQLiteException {
checkOpened();
SQLiteCursor cursor = query(sql, args);
try {
if (!cursor.next()) {
return null;
}
return cursor.stringValue(0);
} finally {
cursor.dispose();
}
}
public SQLiteCursor query(String sql, Object... args) throws SQLiteException {
checkOpened();
SQLitePreparedStatement stmt = preparedMap.get(sql);
......@@ -110,6 +86,7 @@ public class SQLiteDatabase {
for (SQLitePreparedStatement stmt : preparedMap.values()) {
stmt.finalizeQuery();
}
commitTransaction();
closedb(sqliteHandle);
} catch (SQLiteException e) {
FileLog.e("tmessages", e.getMessage(), e);
......@@ -139,6 +116,9 @@ public class SQLiteDatabase {
}
public void commitTransaction() {
if (!inTransaction) {
return;
}
inTransaction = false;
commitTransaction(sqliteHandle);
}
......
......@@ -334,7 +334,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
if (currentDatacenterId != 0 && UserConfig.clientActivated) {
if (currentDatacenterId != 0 && UserConfig.isClientActivated()) {
Datacenter datacenter = datacenterWithId(currentDatacenterId);
if (datacenter.authKey == null) {
currentDatacenterId = 0;
......@@ -632,7 +632,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
datacenter.pushConnection.connect();
generatePing(datacenter, true);
} else {
if (UserConfig.clientActivated && !UserConfig.registeredForInternalPush) {
if (UserConfig.isClientActivated() && !UserConfig.registeredForInternalPush) {
registerForPush();
}
}
......@@ -722,7 +722,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
updatingDcSettings = false;
}
}, null, true, RPCRequest.RPCRequestClassEnableUnauthorized | RPCRequest.RPCRequestClassGeneric, dcNum == 0 ? currentDatacenterId : dcNum);
}, null, true, RPCRequest.RPCRequestClassEnableUnauthorized | RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassWithoutLogin, dcNum == 0 ? currentDatacenterId : dcNum);
}
public long performRpc(final TLObject rpc, final RPCRequest.RPCRequestDelegate completionBlock, final RPCRequest.RPCProgressDelegate progressBlock, boolean requiresCompletion, int requestClass) {
......@@ -782,8 +782,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
return object;
}
public static volatile long nextCallToken = 0;
public static volatile long nextCallToken = 1;
long performRpc(final TLObject rpc, final RPCRequest.RPCRequestDelegate completionBlock, final RPCRequest.RPCProgressDelegate progressBlock, final RPCRequest.RPCQuickAckDelegate quickAckBlock, final boolean requiresCompletion, final int requestClass, final int datacenterId) {
if (!UserConfig.isClientActivated() && (requestClass & RPCRequest.RPCRequestClassWithoutLogin) == 0) {
FileLog.e("tmessages", "can't do request without login " + rpc);
return 0;
}
final long requestToken = nextCallToken++;
......@@ -819,6 +823,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
public void cancelRpc(final long token, final boolean notifyServer) {
if (token == 0) {
return;
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public void run() {
......@@ -1510,7 +1517,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
for (int num : unauthorizedDatacenterIds) {
if (num != currentDatacenterId && num != movingToDatacenterId && UserConfig.clientUserId != 0) {
if (num != currentDatacenterId && num != movingToDatacenterId && UserConfig.isClientActivated()) {
boolean notFound = true;
for (Action actor : actionQueue) {
if (actor instanceof ExportAuthorizationAction) {
......@@ -1786,7 +1793,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
saveSession();
}
}
}, null, true, RPCRequest.RPCRequestClassGeneric, datacenter.datacenterId);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassWithoutLogin, datacenter.datacenterId);
}
void messagesConfirmed(final long requestMsgId) {
......@@ -1918,11 +1925,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
saveSession();
if (datacenter.datacenterId == currentDatacenterId && UserConfig.clientActivated) {
if ((connection.transportRequestClass & RPCRequest.RPCRequestClassGeneric) != 0) {
MessagesController.getInstance().getDifference();
} else if ((connection.transportRequestClass & RPCRequest.RPCRequestClassPush) != 0) {
if (datacenter.datacenterId == currentDatacenterId && UserConfig.isClientActivated()) {
if ((connection.transportRequestClass & RPCRequest.RPCRequestClassPush) != 0) {
registerForPush();
} else if ((connection.transportRequestClass & RPCRequest.RPCRequestClassGeneric) != 0) {
MessagesController.getInstance().getDifference();
}
}
connection.addProcessedSession(newSession.unique_id);
......@@ -1947,7 +1954,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
connection.addProcessedMessageId(innerMessageId);
}
} else if (message instanceof TLRPC.TL_pong) {
if (UserConfig.clientActivated && !UserConfig.registeredForInternalPush && (connection.transportRequestClass & RPCRequest.RPCRequestClassPush) != 0) {
if (UserConfig.isClientActivated() && !UserConfig.registeredForInternalPush && (connection.transportRequestClass & RPCRequest.RPCRequestClassPush) != 0) {
registerForPush();
}
TLRPC.TL_pong pong = (TLRPC.TL_pong)message;
......@@ -2159,7 +2166,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
isError = true;
if (datacenter.datacenterId == currentDatacenterId || datacenter.datacenterId == movingToDatacenterId) {
if ((request.flags & RPCRequest.RPCRequestClassGeneric) != 0) {
if (UserConfig.clientActivated) {
if (UserConfig.isClientActivated()) {
UserConfig.clearConfig();
Utilities.RunOnUIThread(new Runnable() {
@Override
......@@ -2721,7 +2728,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
clearRequestsForRequestClass(RPCRequest.RPCRequestClassDownloadMedia, currentDatacenter);
clearRequestsForRequestClass(RPCRequest.RPCRequestClassUploadMedia, currentDatacenter);
if (UserConfig.clientUserId != 0) {
if (UserConfig.isClientActivated()) {
TLRPC.TL_auth_exportAuthorization exportAuthorization = new TLRPC.TL_auth_exportAuthorization();
exportAuthorization.dc_id = datacenterId;
......@@ -2732,7 +2739,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
movingAuthorization = (TLRPC.TL_auth_exportedAuthorization)response;
authorizeOnMovingDatacenter();
} else {
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public void run() {
moveToDatacenter(datacenterId);
......@@ -2740,7 +2747,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}, 1000);
}
}
}, null, true, RPCRequest.RPCRequestClassGeneric, currentDatacenterId);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassWithoutLogin, currentDatacenterId);
} else {
authorizeOnMovingDatacenter();
}
......@@ -2778,7 +2785,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (movingAuthorization != null) {
TLRPC.TL_auth_importAuthorization importAuthorization = new TLRPC.TL_auth_importAuthorization();
importAuthorization.id = UserConfig.clientUserId;
importAuthorization.id = UserConfig.getClientUserId();
importAuthorization.bytes = movingAuthorization.bytes;
performRpc(importAuthorization, new RPCRequest.RPCRequestDelegate() {
@Override
......@@ -2790,7 +2797,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
moveToDatacenter(movingToDatacenterId);
}
}
}, null, true, RPCRequest.RPCRequestClassGeneric, datacenter.datacenterId);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassWithoutLogin, datacenter.datacenterId);
} else {
authorizedOnMovingDatacenter();
}
......
......@@ -30,7 +30,8 @@ import java.util.concurrent.ConcurrentHashMap;
public class ContactsController {
private Account currentAccount;
public boolean loadingContacts = false;
private boolean loadingContacts = false;
private static final Integer loadContactsSync = 1;
private boolean ignoreChanges = false;
private boolean contactsSyncInProgress = false;
private final Integer observerLock = 1;
......@@ -118,10 +119,10 @@ public class ContactsController {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
Account[] accounts = am.getAccountsByType("org.telegram.account");
boolean recreateAccount = false;
if (UserConfig.currentUser != null) {
if (UserConfig.isClientActivated()) {
if (accounts.length == 1) {
Account acc = accounts[0];
if (!acc.name.equals(UserConfig.currentUser.phone)) {
if (!acc.name.equals(UserConfig.getCurrentUser().phone)) {
recreateAccount = true;
} else {
currentAccount = acc;
......@@ -139,9 +140,9 @@ public class ContactsController {
for (Account c : accounts) {
am.removeAccount(c, null, null);
}
if (UserConfig.currentUser != null) {
if (UserConfig.isClientActivated()) {
try {
currentAccount = new Account(UserConfig.currentUser.phone, "org.telegram.account");
currentAccount = new Account(UserConfig.getCurrentUser().phone, "org.telegram.account");
am.addAccountExplicitly(currentAccount, "", null);
} catch (Exception e) {
FileLog.e("tmessages", e);
......@@ -230,13 +231,20 @@ public class ContactsController {
}
public void readContacts() {
if (loadingContacts) {
return;
synchronized (loadContactsSync) {
if (loadingContacts) {
return;
}
loadingContacts = true;
}
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public void run() {
if (!contacts.isEmpty() || contactsLoaded) {
synchronized (loadContactsSync) {
loadingContacts = false;
}
return;
}
loadContacts(true, false);
......@@ -423,15 +431,15 @@ public class ContactsController {
public void run() {
boolean disableDeletion = true; //disable contacts deletion, because phone numbers can't be compared due to different numbers format
if (schedule) {
/*if (schedule) {
try {
AccountManager am = AccountManager.get(ApplicationLoader.applicationContext);
Account[] accounts = am.getAccountsByType("org.telegram.account");
boolean recreateAccount = false;
if (UserConfig.currentUser != null) {
if (UserConfig.isClientActivated()) {
if (accounts.length != 1) {
FileLog.e("tmessages", "detected account deletion!");
currentAccount = new Account(UserConfig.currentUser.phone, "org.telegram.account");
currentAccount = new Account(UserConfig.getCurrentUser().phone, "org.telegram.account");
am.addAccountExplicitly(currentAccount, "", null);
Utilities.RunOnUIThread(new Runnable() {
@Override
......@@ -444,7 +452,7 @@ public class ContactsController {
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
}*/
boolean request = requ;
if (request && first) {
......@@ -748,13 +756,16 @@ public class ContactsController {
});
}
public boolean isLoadingContacts() {
synchronized (loadContactsSync) {
return loadingContacts;
}
}
public void loadContacts(boolean fromCache, boolean cacheEmpty) {
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
loadingContacts = true;
}
});
synchronized (loadContactsSync) {
loadingContacts = true;
}
if (fromCache) {
FileLog.e("tmessages", "load contacts from cache");
MessagesStorage.getInstance().getContacts();
......@@ -776,7 +787,9 @@ public class ContactsController {
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
loadingContacts = false;
synchronized (loadContactsSync) {
loadingContacts = false;
}
NotificationCenter.getInstance().postNotificationName(MessagesController.contactsDidLoaded);
}
});
......@@ -800,8 +813,8 @@ public class ContactsController {
MessagesController.getInstance().users.putIfAbsent(user.id, user);
} else {
MessagesController.getInstance().users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
}
......@@ -840,7 +853,7 @@ public class ContactsController {
}
for (TLRPC.TL_contact contact : contactsArr) {
if (usersDict.get(contact.user_id) == null && contact.user_id != UserConfig.clientUserId) {
if (usersDict.get(contact.user_id) == null && contact.user_id != UserConfig.getClientUserId()) {
loadContacts(false, true);
FileLog.e("tmessages", "contacts are broken, load from server");
return;
......@@ -953,7 +966,9 @@ public class ContactsController {
usersSectionsDict = sectionsDict;
sortedUsersSectionsArray = sortedSectionsArray;
if (from != 2) {
loadingContacts = false;
synchronized (loadContactsSync) {
loadingContacts = false;
}
}
performWriteContactsToPhoneBook();
updateUnregisteredContacts(contactsArr);
......@@ -1180,7 +1195,7 @@ public class ContactsController {
private void performWriteContactsToPhoneBook() {
final ArrayList<TLRPC.TL_contact> contactsArray = new ArrayList<TLRPC.TL_contact>();
contactsArray.addAll(contacts);
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.photoBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
performWriteContactsToPhoneBookInternal(contactsArray);
......@@ -1237,7 +1252,7 @@ public class ContactsController {
}
for (final Integer uid : contactsTD) {
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.photoBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
deleteContactFromPhoneBook(uid);
......@@ -1467,7 +1482,7 @@ public class ContactsController {
// }
for (final TLRPC.User u : res.users) {
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.photoBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
addContactToPhoneBook(u, true);
......@@ -1533,7 +1548,7 @@ public class ContactsController {
return;
}
MessagesStorage.getInstance().deleteContacts(uids);
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.photoBookQueue.postRunnable(new Runnable() {
@Override
public void run() {
for (TLRPC.User user : users) {
......
......@@ -85,6 +85,6 @@ public class ExportAuthorizationAction extends Action {
}
}
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassEnableUnauthorized, datacenter.datacenterId);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassEnableUnauthorized | RPCRequest.RPCRequestClassWithoutLogin, datacenter.datacenterId);
}
}
......@@ -209,7 +209,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
ByteBuffer data = ByteBuffer.wrap(resPq.pq);
final long pqf = data.getLong();
final long messageIdf = messageId;
Utilities.globalQueue.postRunnable(new Runnable() {
new Thread(new Runnable() {
@Override
public void run() {
......@@ -281,7 +281,7 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
}
});
}
});
}).start();
} else {
FileLog.e("tmessages", "***** Error: invalid handshake nonce");
beginHandshake(false);
......
......@@ -1143,7 +1143,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
recordingAudio = new TLRPC.TL_audio();
recordingAudio.dc_id = Integer.MIN_VALUE;
recordingAudio.id = UserConfig.lastLocalId;
recordingAudio.user_id = UserConfig.clientUserId;
recordingAudio.user_id = UserConfig.getClientUserId();
UserConfig.lastLocalId--;
UserConfig.saveConfig(false);
......@@ -1352,7 +1352,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
final ProgressDialog finalProgress = progressDialog;
Utilities.globalQueue.postRunnable(new Runnable() {
new Thread(new Runnable() {
@Override
public void run() {
try {
......@@ -1427,7 +1427,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
});
}
}
});
}).start();
}
}
......
......@@ -781,7 +781,7 @@ public class MessagesStorage {
if (userData != null) {
SerializedData data = new SerializedData(userData);
TLRPC.User user = (TLRPC.User)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
if (user.id == UserConfig.clientUserId) {
if (user.id == UserConfig.getClientUserId()) {
continue;
}
if (user.status != null) {
......@@ -1018,7 +1018,7 @@ public class MessagesStorage {
String uids = "";
while (cursor.next()) {
int user_id = cursor.intValue(0);
if (user_id == UserConfig.clientUserId) {
if (user_id == UserConfig.getClientUserId()) {
continue;
}
TLRPC.TL_contact contact = new TLRPC.TL_contact();
......@@ -2484,7 +2484,7 @@ public class MessagesStorage {
ArrayList<TLRPC.EncryptedChat> encryptedChats = new ArrayList<TLRPC.EncryptedChat>();
try {
ArrayList<Integer> usersToLoad = new ArrayList<Integer>();
usersToLoad.add(UserConfig.clientUserId);
usersToLoad.add(UserConfig.getClientUserId());
ArrayList<Integer> chatsToLoad = new ArrayList<Integer>();
ArrayList<Integer> encryptedToLoad = new ArrayList<Integer>();
SQLiteCursor cursor = database.queryFinalized(String.format(Locale.US, "SELECT d.did, d.last_mid, d.unread_count, d.date, m.data, m.read_state, m.mid, m.send_state FROM dialogs as d LEFT JOIN messages as m ON d.last_mid = m.mid ORDER BY d.date DESC LIMIT %d,%d", offset, count));
......
......@@ -28,6 +28,7 @@ public class RPCRequest {
public static int RPCRequestClassFailOnServerErrors = 16;
public static int RPCRequestClassCanCompress = 32;
public static int RPCRequestClassPush = 64;
public static int RPCRequestClassWithoutLogin = 128;
static int RPCRequestClassTransportMask = (RPCRequestClassGeneric | RPCRequestClassDownloadMedia | RPCRequestClassUploadMedia);
......
......@@ -17,9 +17,7 @@ import org.telegram.ui.ApplicationLoader;
import java.io.File;
public class UserConfig {
public static TLRPC.User currentUser;
public static int clientUserId = 0;
public static boolean clientActivated = false;
private static TLRPC.User currentUser;
public static boolean registeredForPush = false;
public static boolean registeredForInternalPush = false;
public static String pushString = "";
......@@ -62,8 +60,6 @@ public class UserConfig {
if (withFile) {
SerializedData data = new SerializedData();
currentUser.serializeToStream(data);
clientUserId = currentUser.id;
clientActivated = true;
String userString = Base64.encodeToString(data.toByteArray(), Base64.DEFAULT);
editor.putString("user", userString);
}
......@@ -80,6 +76,30 @@ public class UserConfig {
}
}
public static boolean isClientActivated() {
synchronized (sync) {
return currentUser != null;
}
}
public static int getClientUserId() {
synchronized (sync) {
return currentUser != null ? currentUser.id : 0;
}
}
public static TLRPC.User getCurrentUser() {
synchronized (sync) {
return currentUser;
}
}
public static void setCurrentUser(TLRPC.User user) {
synchronized (sync) {
currentUser = user;
}
}
public static void loadConfig() {
synchronized (sync) {
final File configFile = new File(ApplicationLoader.applicationContext.getFilesDir(), "user.dat");
......@@ -90,8 +110,6 @@ public class UserConfig {
if (ver == 1) {
int constructor = data.readInt32();
currentUser = (TLRPC.TL_userSelf)TLClassStore.Instance().TLdeserialize(data, constructor);
clientUserId = currentUser.id;
clientActivated = true;
MessagesStorage.lastDateValue = data.readInt32();
MessagesStorage.lastPtsValue = data.readInt32();
MessagesStorage.lastSeqValue = data.readInt32();
......@@ -119,8 +137,6 @@ public class UserConfig {
} 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);
......@@ -164,21 +180,13 @@ public class UserConfig {
if (userBytes != null) {
SerializedData data = new SerializedData(userBytes);
currentUser = (TLRPC.TL_userSelf)TLClassStore.Instance().TLdeserialize(data, data.readInt32());
clientUserId = currentUser.id;
clientActivated = true;
}
}
if (currentUser == null) {
clientActivated = false;
clientUserId = 0;
}
}
}
}
public static void clearConfig() {
clientUserId = 0;
clientActivated = false;
currentUser = null;
registeredForInternalPush = false;
registeredForPush = false;
......
......@@ -87,6 +87,8 @@ public class Utilities {
public static volatile DispatchQueue stageQueue = new DispatchQueue("stageQueue");
public static volatile DispatchQueue globalQueue = new DispatchQueue("globalQueue");
public static volatile DispatchQueue searchQueue = new DispatchQueue("searchQueue");
public static volatile DispatchQueue photoBookQueue = new DispatchQueue("photoBookQueue");
public static int[] arrColors = {0xffee4928, 0xff41a903, 0xffe09602, 0xff0f94ed, 0xff8f3bf7, 0xfffc4380, 0xff00a1c4, 0xffeb7002};
public static int[] arrUsersAvatars = {
......@@ -668,7 +670,7 @@ public class Utilities {
try {
String str;
if (id >= 0) {
str = String.format(Locale.US, "%d%d", id, UserConfig.clientUserId);
str = String.format(Locale.US, "%d%d", id, UserConfig.getClientUserId());
} else {
str = String.format(Locale.US, "%d", id);
}
......
......@@ -107,7 +107,7 @@ public class MessageObject {
if (who != null && fromUser != null) {
if (isFromMe()) {
messageText = LocaleController.getString("ActionYouKickUser", R.string.ActionYouKickUser).replace("un2", Utilities.formatName(who.first_name, who.last_name));
} else if (message.action.user_id == UserConfig.clientUserId) {
} else if (message.action.user_id == UserConfig.getClientUserId()) {
messageText = LocaleController.getString("ActionKickUserYou", R.string.ActionKickUserYou).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name));
} else {
messageText = LocaleController.getString("ActionKickUser", R.string.ActionKickUser).replace("un2", Utilities.formatName(who.first_name, who.last_name)).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name));
......@@ -124,7 +124,7 @@ public class MessageObject {
if (whoUser != null && fromUser != null) {
if (isFromMe()) {
messageText = LocaleController.getString("ActionYouAddUser", R.string.ActionYouAddUser).replace("un2", Utilities.formatName(whoUser.first_name, whoUser.last_name));
} else if (message.action.user_id == UserConfig.clientUserId) {
} else if (message.action.user_id == UserConfig.getClientUserId()) {
messageText = LocaleController.getString("ActionAddUserYou", R.string.ActionAddUserYou).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name));
} else {
messageText = LocaleController.getString("ActionAddUser", R.string.ActionAddUser).replace("un2", Utilities.formatName(whoUser.first_name, whoUser.last_name)).replace("un1", Utilities.formatName(fromUser.first_name, fromUser.last_name));
......@@ -206,7 +206,7 @@ public class MessageObject {
}
} else if (message.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
String date = String.format("%s %s %s", LocaleController.formatterYear.format(((long)message.date) * 1000), LocaleController.getString("OtherAt", R.string.OtherAt), LocaleController.formatterDay.format(((long)message.date) * 1000));
messageText = LocaleController.formatString("NotificationUnrecognizedDevice", R.string.NotificationUnrecognizedDevice, UserConfig.currentUser.first_name, date, message.action.title, message.action.address);
messageText = LocaleController.formatString("NotificationUnrecognizedDevice", R.string.NotificationUnrecognizedDevice, UserConfig.getCurrentUser().first_name, date, message.action.title, message.action.address);
} else if (message.action instanceof TLRPC.TL_messageActionUserJoined) {
if (fromUser != null) {
messageText = LocaleController.formatString("NotificationContactJoined", R.string.NotificationContactJoined, Utilities.formatName(fromUser.first_name, fromUser.last_name));
......@@ -537,6 +537,6 @@ public class MessageObject {
}
public boolean isFromMe() {
return messageOwner.from_id == UserConfig.clientUserId;
return messageOwner.from_id == UserConfig.getClientUserId();
}
}
......@@ -72,7 +72,7 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
public void run() {
final ArrayList<TLRPC.TL_contact> contactsCopy = new ArrayList<TLRPC.TL_contact>();
contactsCopy.addAll(ContactsController.getInstance().contacts);
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.searchQueue.postRunnable(new Runnable() {
@Override
public void run() {
String q = query.trim().toLowerCase();
......@@ -87,7 +87,7 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
for (TLRPC.TL_contact contact : contactsCopy) {
TLRPC.User user = MessagesController.getInstance().users.get(contact.user_id);
if (user.first_name != null && user.first_name.toLowerCase().startsWith(q) || user.last_name != null && user.last_name.toLowerCase().startsWith(q)) {
if (user.id == UserConfig.clientUserId) {
if (user.id == UserConfig.getClientUserId()) {
continue;
}
resultArrayNames.add(Utilities.generateSearchName(user.first_name, user.last_name, q));
......
......@@ -93,7 +93,7 @@ public class ApplicationLoader extends Application {
}
UserConfig.loadConfig();
if (UserConfig.currentUser != null) {
if (UserConfig.getCurrentUser() != null) {
boolean changed = false;
SharedPreferences preferences = applicationContext.getSharedPreferences("Notifications", MODE_PRIVATE);
int v = preferences.getInt("v", 0);
......@@ -122,8 +122,8 @@ public class ApplicationLoader extends Application {
editor.commit();
}
MessagesController.getInstance().users.put(UserConfig.clientUserId, UserConfig.currentUser);
ConnectionsManager.getInstance().applyCountryPortNumber(UserConfig.currentUser.phone);
MessagesController.getInstance().users.put(UserConfig.getClientUserId(), UserConfig.getCurrentUser());
ConnectionsManager.getInstance().applyCountryPortNumber(UserConfig.getCurrentUser().phone);
ConnectionsManager.getInstance().initPushConnection();
}
......
......@@ -16,7 +16,6 @@ import android.text.Layout;
import android.text.StaticLayout;
import android.text.TextPaint;
import android.text.TextUtils;
import android.view.View;
import org.telegram.PhoneFormat.PhoneFormat;
import org.telegram.messenger.LocaleController;
......@@ -28,8 +27,6 @@ import org.telegram.messenger.UserConfig;
import org.telegram.messenger.Utilities;
import org.telegram.ui.Views.ImageReceiver;
import java.lang.ref.WeakReference;
public class ChatOrUserCell extends BaseCell {
private static TextPaint namePaint;
private static TextPaint nameEncryptedPaint;
......@@ -347,7 +344,7 @@ public class ChatOrUserCell extends BaseCell {
onlineString = subLabel;
} else {
onlineString = LocaleController.formatUserStatus(user);
if (user != null && (user.id == UserConfig.clientUserId || user.status != null && user.status.expires > ConnectionsManager.getInstance().getCurrentTime())) {
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);
}
......
......@@ -423,7 +423,7 @@ public class DialogCell extends BaseCell {
} else if (encryptedChat instanceof TLRPC.TL_encryptedChatDiscarded) {
messageString = LocaleController.getString("EncryptionRejected", R.string.EncryptionRejected);
} else if (encryptedChat instanceof TLRPC.TL_encryptedChat) {
if (encryptedChat.admin_id == UserConfig.clientUserId) {
if (encryptedChat.admin_id == UserConfig.getClientUserId()) {
if (user != null && user.first_name != null) {
messageString = LocaleController.formatString("EncryptedChatStartedOutgoing", R.string.EncryptedChatStartedOutgoing, user.first_name);
} else {
......@@ -547,7 +547,7 @@ public class DialogCell extends BaseCell {
nameString = chat.title;
} else if (user != null) {
if (user.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(user.id) == null) {
if (ContactsController.getInstance().contactsDict.size() == 0 && (!ContactsController.getInstance().contactsLoaded || ContactsController.getInstance().loadingContacts)) {
if (ContactsController.getInstance().contactsDict.size() == 0 && (!ContactsController.getInstance().contactsLoaded || ContactsController.getInstance().isLoadingContacts())) {
nameString = Utilities.formatName(user.first_name, user.last_name);
} else {
if (user.phone != null && user.phone.length() != 0) {
......
......@@ -686,7 +686,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
View v = contentView.findViewById(R.id.secret_placeholder);
v.setVisibility(View.VISIBLE);
if (currentEncryptedChat.admin_id == UserConfig.clientUserId) {
if (currentEncryptedChat.admin_id == UserConfig.getClientUserId()) {
if (currentUser.first_name.length() > 0) {
secretViewStatusTextView.setText(LocaleController.formatString("EncryptedPlaceholderTitleOutgoing", R.string.EncryptedPlaceholderTitleOutgoing, currentUser.first_name));
} else {
......@@ -1337,7 +1337,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
int currentTime = ConnectionsManager.getInstance().getCurrentTime();
for (TLRPC.TL_chatParticipant participant : info.participants) {
TLRPC.User user = MessagesController.getInstance().users.get(participant.user_id);
if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.clientUserId) && user.status.expires > 10000) {
if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
onlineCount++;
}
}
......@@ -1495,7 +1495,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (currentChat != null) {
actionBarLayer.setTitle(currentChat.title);
} else if (currentUser != null) {
if (currentUser.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(currentUser.id) == null && (ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().loadingContacts)) {
if (currentUser.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(currentUser.id) == null && (ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().isLoadingContacts())) {
if (currentUser.phone != null && currentUser.phone.length() != 0) {
actionBarLayer.setTitle(PhoneFormat.getInstance().format("+" + currentUser.phone));
} else {
......@@ -1782,7 +1782,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
}
TLRPC.TL_document document = new TLRPC.TL_document();
document.id = 0;
document.user_id = UserConfig.clientUserId;
document.user_id = UserConfig.getClientUserId();
document.date = ConnectionsManager.getInstance().getCurrentTime();
document.file_name = name;
document.size = (int)f.length();
......@@ -2517,7 +2517,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
|| currentUser instanceof TLRPC.TL_userEmpty || currentUser instanceof TLRPC.TL_userDeleted
|| (currentUser.phone != null && currentUser.phone.length() != 0 &&
ContactsController.getInstance().contactsDict.get(currentUser.id) != null &&
(ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().loadingContacts))) {
(ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().isLoadingContacts()))) {
topPanel.setVisibility(View.GONE);
} else {
topPanel.setVisibility(View.VISIBLE);
......@@ -2568,7 +2568,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
public void onClick(DialogInterface dialogInterface, int i) {
MessagesController.getInstance().hidenAddToContacts.put(currentUser.id, currentUser);
topPanel.setVisibility(View.GONE);
MessagesController.getInstance().sendMessage(UserConfig.currentUser, dialog_id);
MessagesController.getInstance().sendMessage(UserConfig.getCurrentUser(), dialog_id);
chatListView.post(new Runnable() {
@Override
public void run() {
......@@ -3137,7 +3137,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
activity.finishFragment();
TLRPC.TL_document document = new TLRPC.TL_document();
document.id = 0;
document.user_id = UserConfig.clientUserId;
document.user_id = UserConfig.getClientUserId();
document.date = ConnectionsManager.getInstance().getCurrentTime();
document.file_name = name;
document.size = (int)size;
......@@ -3573,7 +3573,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
((ChatBaseCell)view).delegate = new ChatBaseCell.ChatBaseCellDelegate() {
@Override
public void didPressedUserAvatar(ChatBaseCell cell, TLRPC.User user) {
if (user != null && user.id != UserConfig.clientUserId) {
if (user != null && user.id != UserConfig.getClientUserId()) {
Bundle args = new Bundle();
args.putInt("user_id", user.id);
presentFragment(new UserProfileActivity(args));
......@@ -3784,7 +3784,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 && ContactsController.getInstance().contactsDict.get(contactUser.id) == null) {
if (contactUser.id != UserConfig.getClientUserId() && ContactsController.getInstance().contactsDict.get(contactUser.id) == null) {
addContactView.setVisibility(View.VISIBLE);
} else {
addContactView.setVisibility(View.GONE);
......@@ -4090,7 +4090,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
processRowSelect(view);
return;
}
if (message.messageOwner.media.user_id != UserConfig.clientUserId) {
if (message.messageOwner.media.user_id != UserConfig.getClientUserId()) {
TLRPC.User user = null;
if (message.messageOwner.media.user_id != 0) {
user = MessagesController.getInstance().users.get(message.messageOwner.media.user_id);
......
......@@ -173,10 +173,10 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
public boolean onItemLongClick(AdapterView<?> adapterView, View view, int i, long l) {
if (i > membersSectionRow && i < addMemberRow) {
TLRPC.TL_chatParticipant user = info.participants.get(sortedUsers.get(i - membersSectionRow - 1));
if (user.user_id == UserConfig.clientUserId) {
if (user.user_id == UserConfig.getClientUserId()) {
return false;
}
if (info.admin_id != UserConfig.clientUserId && user.inviter_id != UserConfig.clientUserId) {
if (info.admin_id != UserConfig.getClientUserId() && user.inviter_id != UserConfig.getClientUserId()) {
return false;
}
selectedUser = user;
......@@ -240,7 +240,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
openAddMenu();
} else if (i > membersSectionRow && i < addMemberRow) {
int user_id = info.participants.get(sortedUsers.get(i - membersSectionRow - 1)).user_id;
if (user_id == UserConfig.clientUserId) {
if (user_id == UserConfig.getClientUserId()) {
return;
}
Bundle args = new Bundle();
......@@ -458,7 +458,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
int i = 0;
for (TLRPC.TL_chatParticipant participant : info.participants) {
TLRPC.User user = MessagesController.getInstance().users.get(participant.user_id);
if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.clientUserId) && user.status.expires > 10000) {
if (user != null && user.status != null && (user.status.expires > currentTime || user.id == UserConfig.getClientUserId()) && user.status.expires > 10000) {
onlineCount++;
}
sortedUsers.add(i);
......@@ -473,14 +473,14 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
Integer status1 = 0;
Integer status2 = 0;
if (user1 != null && user1.status != null) {
if (user1.id == UserConfig.clientUserId) {
if (user1.id == UserConfig.getClientUserId()) {
status1 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
} else {
status1 = user1.status.expires;
}
}
if (user2 != null && user2.status != null) {
if (user2.id == UserConfig.clientUserId) {
if (user2.id == UserConfig.getClientUserId()) {
status2 = ConnectionsManager.getInstance().getCurrentTime() + 50000;
} else {
status2 = user2.status.expires;
......@@ -535,7 +535,7 @@ public class ChatProfileActivity extends BaseFragment implements NotificationCen
} else {
NotificationCenter.getInstance().removeObserver(this, MessagesController.closeChats);
NotificationCenter.getInstance().postNotificationName(MessagesController.closeChats);
MessagesController.getInstance().deleteUserFromChat(chat_id, MessagesController.getInstance().users.get(UserConfig.clientUserId), info);
MessagesController.getInstance().deleteUserFromChat(chat_id, MessagesController.getInstance().users.get(UserConfig.getClientUserId()), info);
MessagesController.getInstance().deleteDialog(-chat_id, 0, false);
finishFragment();
}
......
......@@ -205,7 +205,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
if (searching && searchWas) {
TLRPC.User user = searchListViewAdapter.getItem(i);
if (user == null || user.id == UserConfig.clientUserId) {
if (user == null || user.id == UserConfig.getClientUserId()) {
return;
}
if (returnAsResult) {
......@@ -263,7 +263,7 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
}
if (user != null) {
if (user.id == UserConfig.clientUserId) {
if (user.id == UserConfig.getClientUserId()) {
return;
}
if (returnAsResult) {
......
......@@ -280,7 +280,7 @@ public class CountrySelectActivity extends BaseFragment {
}
private void processSearch(final String query) {
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.searchQueue.postRunnable(new Runnable() {
@Override
public void run() {
......
......@@ -382,7 +382,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
public void run() {
final ArrayList<TLRPC.TL_contact> contactsCopy = new ArrayList<TLRPC.TL_contact>();
contactsCopy.addAll(ContactsController.getInstance().contacts);
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.searchQueue.postRunnable(new Runnable() {
@Override
public void run() {
if (query.length() == 0) {
......@@ -397,7 +397,7 @@ public class GroupCreateActivity extends BaseFragment implements NotificationCen
for (TLRPC.TL_contact contact : contactsCopy) {
TLRPC.User user = MessagesController.getInstance().users.get(contact.user_id);
if (user.first_name.toLowerCase().startsWith(q) || user.last_name.toLowerCase().startsWith(q)) {
if (user.id == UserConfig.clientUserId) {
if (user.id == UserConfig.getClientUserId()) {
continue;
}
resultArrayNames.add(Utilities.generateSearchName(user.first_name, user.last_name, q));
......
......@@ -232,7 +232,7 @@ public class LanguageSelectActivity extends BaseFragment {
}
private void processSearch(final String query) {
Utilities.globalQueue.postRunnable(new Runnable() {
Utilities.searchQueue.postRunnable(new Runnable() {
@Override
public void run() {
......
......@@ -64,7 +64,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
protected void onCreate(Bundle savedInstanceState) {
ApplicationLoader.postInitApplication();
if (!UserConfig.clientActivated) {
if (!UserConfig.isClientActivated()) {
Intent intent = getIntent();
if (intent != null && intent.getAction() != null && (Intent.ACTION_SEND.equals(intent.getAction()) || intent.getAction().equals(Intent.ACTION_SEND_MULTIPLE))) {
super.onCreateFinish(savedInstanceState);
......@@ -101,7 +101,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
NotificationCenter.getInstance().addObserver(this, 703);
if (fragmentsStack.isEmpty()) {
if (!UserConfig.clientActivated) {
if (!UserConfig.isClientActivated()) {
addFragmentToStack(new LoginActivity());
} else {
addFragmentToStack(new MessagesActivity(null));
......@@ -417,7 +417,7 @@ public class LaunchActivity extends ActionBarActivity implements NotificationCen
}
if (push_user_id != 0) {
if (push_user_id == UserConfig.clientUserId) {
if (push_user_id == UserConfig.getClientUserId()) {
open_settings = 1;
} else {
Bundle args = new Bundle();
......
......@@ -10,6 +10,7 @@ package org.telegram.ui;
import android.animation.Animator;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
......@@ -34,6 +35,7 @@ import java.util.Set;
public class LoginActivity extends BaseFragment implements SlideView.SlideViewDelegate {
private int currentViewNum = 0;
private SlideView[] views = new SlideView[3];
private ProgressDialog progressDialog;
private final static int done_button = 1;
......@@ -205,29 +207,38 @@ public class LoginActivity extends BaseFragment implements SlideView.SlideViewDe
@Override
public void needShowAlert(final String text) {
if (text == null) {
if (text == null || getParentActivity() == null) {
return;
}
getParentActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(text);
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showAlertDialog(builder);
}
});
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setMessage(text);
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showAlertDialog(builder);
}
@Override
public void needShowProgress() {
Utilities.ShowProgressDialog(getParentActivity(), LocaleController.getString("Loading", R.string.Loading));
if (getParentActivity() == null || getParentActivity().isFinishing() || progressDialog != null) {
return;
}
progressDialog = new ProgressDialog(getParentActivity());
progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading));
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setCancelable(false);
progressDialog.show();
}
@Override
public void needHideProgress() {
Utilities.HideProgressDialog(getParentActivity());
if (progressDialog == null) {
return;
}
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
public void setPage(int page, boolean animated, Bundle params, boolean back) {
......
......@@ -57,6 +57,7 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
private boolean ignoreSelection = false;
private boolean ignoreOnTextChange = false;
private boolean ignoreOnPhoneChange = false;
private boolean nextPressed = false;
public LoginActivityPhoneView(Context context) {
super(context);
......@@ -319,6 +320,9 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
@Override
public void onNextPressed() {
if (nextPressed) {
return;
}
if (countryState == 1) {
delegate.needShowAlert(LocaleController.getString("ChooseCountry", R.string.ChooseCountry));
return;
......@@ -345,48 +349,47 @@ public class LoginActivityPhoneView extends SlideView implements AdapterView.OnI
final Bundle params = new Bundle();
params.putString("phone", "+" + codeField.getText() + phoneField.getText());
params.putString("phoneFormated", phone);
nextPressed = true;
delegate.needShowProgress();
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (error == null) {
final TLRPC.TL_auth_sentCode res = (TLRPC.TL_auth_sentCode)response;
params.putString("phoneHash", res.phone_code_hash);
params.putInt("calltime", res.send_call_timeout * 1000);
if (res.phone_registered) {
params.putString("registered", "true");
}
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
public void run(final TLObject response, final TLRPC.TL_error error) {
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
nextPressed = false;
if (error == null) {
final TLRPC.TL_auth_sentCode res = (TLRPC.TL_auth_sentCode)response;
params.putString("phoneHash", res.phone_code_hash);
params.putInt("calltime", res.send_call_timeout * 1000);
if (res.phone_registered) {
params.putString("registered", "true");
}
if (delegate != null) {
delegate.setPage(1, true, params, false);
}
}
});
} else {
if (delegate != null) {
if (error.text != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
delegate.needShowAlert(LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.contains("FLOOD_WAIT")) {
delegate.needShowAlert(LocaleController.getString("FloodWait", R.string.FloodWait));
} else {
delegate.needShowAlert(error.text);
} else {
if (delegate != null && error.text != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
delegate.needShowAlert(LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.startsWith("FLOOD_WAIT")) {
delegate.needShowAlert(LocaleController.getString("FloodWait", R.string.FloodWait));
} else {
delegate.needShowAlert(error.text);
}
}
}
if (delegate != null) {
delegate.needHideProgress();
}
}
}
if (delegate != null) {
delegate.needHideProgress();
}
});
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors | RPCRequest.RPCRequestClassWithoutLogin);
}
@Override
......
......@@ -39,6 +39,7 @@ public class LoginActivityRegisterView extends SlideView {
private String phoneHash;
private String phoneCode;
private Bundle currentParams;
private boolean nextPressed = false;
public LoginActivityRegisterView(Context context) {
super(context);
......@@ -122,32 +123,37 @@ public class LoginActivityRegisterView extends SlideView {
@Override
public void onNextPressed() {
if (nextPressed) {
return;
}
nextPressed = true;
TLRPC.TL_auth_signUp req = new TLRPC.TL_auth_signUp();
req.phone_code = phoneCode;
req.phone_code_hash = phoneHash;
req.phone_number = requestPhone;
req.first_name = firstNameField.getText().toString();
req.last_name = lastNameField.getText().toString();
delegate.needShowProgress();
if (delegate != null) {
delegate.needShowProgress();
}
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (delegate != null) {
delegate.needHideProgress();
}
if (error == null) {
final TLRPC.TL_auth_authorization res = (TLRPC.TL_auth_authorization)response;
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
public void run(final TLObject response, final TLRPC.TL_error error) {
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
nextPressed = false;
if (delegate != null) {
delegate.needHideProgress();
}
if (error == null) {
final TLRPC.TL_auth_authorization res = (TLRPC.TL_auth_authorization)response;
TLRPC.TL_userSelf user = (TLRPC.TL_userSelf)res.user;
UserConfig.clearConfig();
MessagesStorage.getInstance().cleanUp();
MessagesController.getInstance().cleanUp();
ConnectionsManager.getInstance().cleanUp();
UserConfig.currentUser = user;
UserConfig.clientActivated = true;
UserConfig.clientUserId = user.id;
UserConfig.setCurrentUser(user);
UserConfig.saveConfig(true);
ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
users.add(user);
......@@ -159,27 +165,27 @@ public class LoginActivityRegisterView extends SlideView {
delegate.needFinishActivity();
}
ConnectionsManager.getInstance().initPushConnection();
}
});
} else {
if (delegate != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
delegate.needShowAlert(LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.contains("FIRSTNAME_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidFirstName", R.string.InvalidFirstName));
} else if (error.text.contains("LASTNAME_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidLastName", R.string.InvalidLastName));
} else {
delegate.needShowAlert(error.text);
if (delegate != null) {
if (error.text.contains("PHONE_NUMBER_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
} else if (error.text.contains("PHONE_CODE_EMPTY") || error.text.contains("PHONE_CODE_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidCode", R.string.InvalidCode));
} else if (error.text.contains("PHONE_CODE_EXPIRED")) {
delegate.needShowAlert(LocaleController.getString("CodeExpired", R.string.CodeExpired));
} else if (error.text.contains("FIRSTNAME_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidFirstName", R.string.InvalidFirstName));
} else if (error.text.contains("LASTNAME_INVALID")) {
delegate.needShowAlert(LocaleController.getString("InvalidLastName", R.string.InvalidLastName));
} else {
delegate.needShowAlert(error.text);
}
}
}
}
}
});
}
}, null, true, RPCRequest.RPCRequestClassGeneric);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassWithoutLogin);
}
@Override
......
......@@ -324,7 +324,7 @@ public class MessagesActivity extends BaseFragment implements NotificationCenter
if (which == 0) {
MessagesController.getInstance().deleteDialog(selectedDialog, 0, true);
} else if (which == 1) {
MessagesController.getInstance().deleteUserFromChat((int) -selectedDialog, MessagesController.getInstance().users.get(UserConfig.clientUserId), null);
MessagesController.getInstance().deleteUserFromChat((int) -selectedDialog, MessagesController.getInstance().users.get(UserConfig.getClientUserId()), null);
MessagesController.getInstance().deleteDialog(selectedDialog, 0, false);
}
}
......
......@@ -1038,7 +1038,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (messageObject.messageOwner.to_id.chat_id != 0) {
currentDialogId = -messageObject.messageOwner.to_id.chat_id;
} else {
if (messageObject.messageOwner.to_id.user_id == UserConfig.clientUserId) {
if (messageObject.messageOwner.to_id.user_id == UserConfig.getClientUserId()) {
currentDialogId = messageObject.messageOwner.from_id;
} else {
currentDialogId = messageObject.messageOwner.to_id.user_id;
......@@ -1076,7 +1076,7 @@ public class PhotoViewer implements NotificationCenter.NotificationCenterDelegat
if (messageObject.messageOwner.to_id.chat_id != 0) {
currentDialogId = -messageObject.messageOwner.to_id.chat_id;
} else {
if (messageObject.messageOwner.to_id.user_id == UserConfig.clientUserId) {
if (messageObject.messageOwner.to_id.user_id == UserConfig.getClientUserId()) {
currentDialogId = messageObject.messageOwner.from_id;
} else {
currentDialogId = messageObject.messageOwner.to_id.user_id;
......
......@@ -127,15 +127,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (error == null) {
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
if (user == null) {
return;
}
MessagesController.getInstance().users.put(user.id, user);
} else {
UserConfig.currentUser = user;
UserConfig.setCurrentUser(user);
}
if (user == null) {
return;
......@@ -418,7 +418,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
if (fileLocation == null) {
return null;
}
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user != null && user.photo != null && user.photo.photo_big != null) {
TLRPC.FileLocation photoBig = user.photo.photo_big;
if (photoBig.local_id == fileLocation.local_id && photoBig.volume_id == fileLocation.volume_id && photoBig.dc_id == fileLocation.dc_id) {
......@@ -434,7 +434,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
object.viewY = coords[1] - Utilities.statusBarHeight;
object.parentView = listView;
object.imageReceiver = avatarImage.imageReceiver;
object.user_id = UserConfig.clientUserId;
object.user_id = UserConfig.getClientUserId();
object.thumb = object.imageReceiver.getBitmap();
object.size = -1;
return object;
......@@ -671,9 +671,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
CharSequence[] items;
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
}
if (user == null) {
return;
......@@ -691,7 +691,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == 0 && full) {
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user != null && user.photo != null && user.photo.photo_big != null) {
PhotoViewer.getInstance().openPhoto(user.photo.photo_big, SettingsActivity.this);
}
......@@ -703,28 +703,28 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
TLRPC.TL_photos_updateProfilePhoto req = new TLRPC.TL_photos_updateProfilePhoto();
req.id = new TLRPC.TL_inputPhotoEmpty();
req.crop = new TLRPC.TL_inputPhotoCropAuto();
UserConfig.currentUser.photo = new TLRPC.TL_userProfilePhotoEmpty();
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
UserConfig.getCurrentUser().photo = new TLRPC.TL_userProfilePhotoEmpty();
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
}
if (user == null) {
return;
}
if (user != null) {
user.photo = UserConfig.currentUser.photo;
user.photo = UserConfig.getCurrentUser().photo;
}
NotificationCenter.getInstance().postNotificationName(MessagesController.updateInterfaces, MessagesController.UPDATE_MASK_ALL);
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (error == null) {
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
MessagesController.getInstance().users.put(user.id, user);
} else {
UserConfig.currentUser = user;
UserConfig.setCurrentUser(user);
}
if (user == null) {
return;
......@@ -757,9 +757,9 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
textView = (TextView)view.findViewById(R.id.settings_name);
Typeface typeface = Utilities.getTypeface("fonts/rmedium.ttf");
textView.setTypeface(typeface);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
}
if (user != null) {
textView.setText(Utilities.formatName(user.first_name, user.last_name));
......@@ -804,7 +804,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
TextView textView = (TextView)view.findViewById(R.id.settings_row_text);
View divider = view.findViewById(R.id.settings_row_divider);
if (i == numberRow) {
TLRPC.User user = UserConfig.currentUser;
TLRPC.User user = UserConfig.getCurrentUser();
if (user != null && user.phone != null && user.phone.length() != 0) {
textView.setText(PhoneFormat.getInstance().format("+" + user.phone));
} else {
......@@ -898,10 +898,10 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
public void onClick(DialogInterface dialogInterface, int i) {
NotificationCenter.getInstance().postNotificationName(1234);
MessagesController.getInstance().unregistedPush();
MessagesController.getInstance().logOut();
UserConfig.clearConfig();
MessagesStorage.getInstance().cleanUp();
MessagesController.getInstance().cleanUp();
ConnectionsManager.getInstance().cleanUp();
UserConfig.clearConfig();
}
});
builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
......
......@@ -65,9 +65,9 @@ public class SettingsChangeNameActivity extends BaseFragment {
fragmentView = inflater.inflate(R.layout.settings_change_name_layout, container, false);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
}
firstNameField = (EditText)fragmentView.findViewById(R.id.first_name_field);
......@@ -126,12 +126,12 @@ public class SettingsChangeNameActivity extends BaseFragment {
private void saveName() {
TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
if (UserConfig.currentUser == null || lastNameField.getText() == null || firstNameField.getText() == null) {
if (UserConfig.getCurrentUser() == null || lastNameField.getText() == null || firstNameField.getText() == null) {
return;
}
UserConfig.currentUser.first_name = req.first_name = firstNameField.getText().toString();
UserConfig.currentUser.last_name = req.last_name = lastNameField.getText().toString();
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.clientUserId);
UserConfig.getCurrentUser().first_name = req.first_name = firstNameField.getText().toString();
UserConfig.getCurrentUser().last_name = req.last_name = lastNameField.getText().toString();
TLRPC.User user = MessagesController.getInstance().users.get(UserConfig.getClientUserId());
if (user != null) {
user.first_name = req.first_name;
user.last_name = req.last_name;
......
......@@ -64,7 +64,7 @@
<string name="NoFiles">لا يوجد ملفات بعد...</string>
<string name="FileUploadLimit">حجم الملف لا يمكن أن يكون أكبر من %1$s</string>
<string name="NotMounted">الذاكرة غير مثبتة</string>
<string name="UsbActive">نقل اليو إس بي مفعل</string>
<string name="UsbActive">نقل USB مفعل</string>
<string name="InternalStorage">الذاكرة الداخلية</string>
<string name="ExternalStorage">الذاكرة الخارجية</string>
<string name="SystemRoot">جذر النظام</string>
......@@ -94,7 +94,7 @@
<string name="Message">الرسالة</string>
<string name="TypeMessage">أكتب رسالة</string>
<string name="DOWNLOAD">تحميل</string>
<string name="Selected">محددة: %d</string>
<string name="Selected">تم تحديد : %d</string>
<string name="ShareMyContactInfo">شارك جهة الاتصال الخاصة بي</string>
<string name="AddToContacts">أضف لجهات الاتصال</string>
<string name="EncryptedPlaceholderTitleIncoming">%s قام بدعوتك لمحادثة سرية</string>
......@@ -108,7 +108,7 @@
<string name="FewNewMessages">%1$d رسائل جديدة</string>
<string name="YouWereKicked">لقد تم إخراجك من هذه المجموعة</string>
<string name="YouLeft">لقد قمت بمغادرة المجموعة</string>
<string name="DeleteThisGroup">حذف المجموعة</string>
<string name="DeleteThisGroup">حذف هذه المجموعة</string>
<string name="DeleteThisChat">حذف هذه الدردشة</string>
<string name="SlideToCancel">قم بالسحب للإلغاء</string>
<string name="SaveToDownloads">حفظ في الجهاز</string>
......@@ -133,7 +133,7 @@
<string name="NotificationMessagePhoto">%1$s قام بإرسال صورة لك</string>
<string name="NotificationMessageVideo">%1$s قام بإرسال مقطع مرئي لك</string>
<string name="NotificationMessageContact">%1$s قام بإرسال جهة اتصال لك</string>
<string name="NotificationMessageMap">%1$s قام بإرسال خريطة لك</string>
<string name="NotificationMessageMap">%1$s قام بإرسال موقع لك</string>
<string name="NotificationMessageDocument">%1$s قام بإرسال مستند لك</string>
<string name="NotificationMessageAudio">%1$s قام بإرسال مقطع صوتي لك</string>
<string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string>
......@@ -141,7 +141,7 @@
<string name="NotificationMessageGroupPhoto">%1$s قام بإرسال صورة للمجموعة %2$s</string>
<string name="NotificationMessageGroupVideo">%1$s قام بإرسال مقطع مرئي للمجموعة %2$s</string>
<string name="NotificationMessageGroupContact">%1$s قام بإرسال جهة اتصال للمجموعة %2$s</string>
<string name="NotificationMessageGroupMap">%1$s قام بإرسال خريطة للمجموعة %2$s</string>
<string name="NotificationMessageGroupMap">%1$s قام بإرسال موقع للمجموعة %2$s</string>
<string name="NotificationMessageGroupDocument">%1$s قام بإرسال مستند للمجموعة %2$s</string>
<string name="NotificationMessageGroupAudio">%1$s قام بإرسال مقطع صوتي للمجموعة %2$s</string>
<string name="NotificationInvitedToGroup">%1$s قام بدعوتك للمجموعة %2$s</string>
......@@ -250,14 +250,14 @@
<string name="SendByEnter">أرسل بزر الإدخال</string>
<string name="TerminateAllSessions">سجل الخروج من كافة الأجهزة الأخرى</string>
<string name="AutomaticPhotoDownload">تنزيل الصور تلقائيًا</string>
<string name="AutomaticAudioDownload">تنزيل رسائل الصوت تلقائيا</string>
<string name="AutomaticAudioDownload">تنزيل رسائل الصوت تلقائياً</string>
<string name="AutomaticPhotoDownloadGroups">المجموعات</string>
<string name="AutomaticPhotoDownloadPrivateChats">المحادثات</string>
<string name="Events">الأحداث</string>
<string name="ContactJoined">اشترك صديق في تيليجرام</string>
<string name="Pebble">PEBBLE</string>
<string name="Language">اللغة</string>
<string name="AskAQuestionInfo">نرجو الأخذ بالعلم أن الدعم الفني في تيليجرام يقوم به مجموعة من المتطوعين. نحاول الرد بسرعة قدر المستطاع، لكن ربما نستغرق القليل من الوقت.<![CDATA[<br><br>]]>يرجى الإطلاع على <![CDATA[<a href="http://telegram.org/faq/ar">صفحة الأسئلة الأكثر شيوعًا</a>]]>: يوجد بها حلول للمشاكل وإجابات لمعظم الأسئلة.</string>
<string name="AskAQuestionInfo">نرجو الأخذ بالعلم أن الدعم الفني في تيليجرام يقوم به مجموعة من المتطوعين. نحاول الرد بسرعة قدر المستطاع، لكن ربما نستغرق القليل من الوقت.<![CDATA[<br><br>]]>يرجى الإطلاع على <![CDATA[<a href="http://telegram.org/faq/ar">الأسئلة الشائعة عن تيليجرام</a>]]>: يوجد بها حلول للمشاكل وإجابات لمعظم الأسئلة.</string>
<string name="AskButton">اسأل أحد المتطوعين</string>
<string name="TelegramFaq">الأسئلة الشائعة عن تيليجرام</string>
<string name="TelegramFaqUrl">https://telegram.org/faq/ar</string>
......@@ -266,7 +266,7 @@
<string name="Enabled">تمكين</string>
<string name="Disabled">تعطيل</string>
<string name="NotificationsService">خدمة الإشعارات</string>
<string name="NotificationsServiceDisableInfo">إذا كانت خدمات Google play كافية بالنسبة لك لتلقي الإشعارات ، يمكنك تعطيل " خدمة الإشعارات " . ومع ذلك نحن نوصي بترك هذه الخدمة مفعلة للحفاظ على تشغيل التطبيق في الخلفية ، ولتلقي إشعارات الدردشة .</string>
<string name="NotificationsServiceDisableInfo">إذا كانت خدمات Google play كافية بالنسبة لك لتلقي الإشعارات ، يمكنك تعطيل \" خدمة الإشعارات \" . ومع ذلك نحن نوصي بترك هذه الخدمة مفعلة للحفاظ على تشغيل التطبيق في الخلفية ، ولتلقي إشعارات الدردشة .</string>
<string name="SortBy">فرز حسب</string>
<string name="ImportContacts">استيراد جهات الاتصال</string>
<string name="WiFiOnly">بواسطة WiFi فقط</string>
......@@ -317,7 +317,7 @@
<string name="OK">موافق</string>
<!--messages-->
<string name="ActionKickUser">un1 قام بإخراج un2</string>
<string name="ActionKickUser">un1 أزال un2</string>
<string name="ActionLeftUser">غادر المجموعة العضو un1</string>
<string name="ActionAddUser">un1 قام بإضافة un2</string>
<string name="ActionRemovedPhoto">تمت إزالة صورة المجموعة من قِبَل un1</string>
......@@ -333,7 +333,7 @@
<string name="ActionYouCreateGroup">لقد قمت بإنشاء المجموعة</string>
<string name="ActionKickUserYou">un1 قام بإخراجك</string>
<string name="ActionAddUserYou">un1 قام بإضافتك</string>
<string name="UnsuppotedMedia">نسخة تيليجرام التي تستخدمها لا تدعم هذه الرسالة</string>
<string name="UnsuppotedMedia">نسخة تيليجرام الموجودة لديك لا تدعم هذه الرسالة. الرجاء التحديث لأحدث نسخة:\nhttp://telegram.org/update</string>
<string name="AttachPhoto">صورة</string>
<string name="AttachVideo">مقطع مرئي</string>
<string name="AttachLocation">موقع</string>
......@@ -356,10 +356,10 @@
<string name="NoHandleAppInstalled">لا يوجد لديك تطبيق يمكنه فتح \'%1$s\'، يرجى تنزيل تطبيق مناسب للإستمرار</string>
<string name="InviteUser">هذا المستخدم ليس لديه تيليجرام بعد ، هل ترغب في دعوته الآن؟</string>
<string name="AreYouSure">هل أنت متأكد؟</string>
<string name="DeleteChatQuestion">هل تريد حذف هذه الدردشة؟</string>
<string name="AddContactQ">هل تريد إضافة جهة اتصال؟</string>
<string name="AddToTheGroup">إلى المجموعة؟ %1$s هل تريد إضافة</string>
<string name="ForwardMessagesTo">؟%1$s هل تريد إعادة توجيه الرسائل إلى</string>
<string name="DeleteChatQuestion">هل تريد حذف هذه الدردشة؟</string>
<!--Intro view-->
<string name="Page1Title">تيليجرام</string>
......
......@@ -94,7 +94,7 @@
<string name="Message">Messaggio</string>
<string name="TypeMessage">Scrivi il messaggio</string>
<string name="DOWNLOAD">Scarica</string>
<string name="Selected">Selezionato: %d</string>
<string name="Selected">Selezionati: %d</string>
<string name="ShareMyContactInfo">CONDIVIDI LE MIE INFORMAZIONI DI CONTATTO</string>
<string name="AddToContacts">AGGIUNGI AI CONTATTI</string>
<string name="EncryptedPlaceholderTitleIncoming">%s ti ha mandato un invito a una chat privata.</string>
......@@ -269,7 +269,7 @@
<string name="NotificationsServiceDisableInfo">Se i servizi di Google Play ti bastano per ricevere le notifiche, puoi disabilitare il Servizio notifiche. Tuttavia sarebbe meglio lasciarlo abilitato al fine di mantenere l\'applicazione attiva in background e ricevere notifiche istantanee.</string>
<string name="SortBy">Ordina per</string>
<string name="ImportContacts">Importa contatti</string>
<string name="WiFiOnly">solo tramite WiFi</string>
<string name="WiFiOnly">Solo tramite WiFi</string>
<string name="SortFirstName">Nome</string>
<string name="SortLastName">Cognome</string>
......@@ -292,8 +292,8 @@
<string name="SaveToGallery">Salva nella galleria</string>
<string name="Of">%1$d di %2$d</string>
<string name="Gallery">Galleria</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="AllPhotos">Tutte le foto</string>
<string name="NoPhotos">Ancora nessuna foto</string>
<!--button titles-->
<string name="Next">Avanti</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment