1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-06-30 10:14:04 +00:00

Update locales, bug fixes

This commit is contained in:
DrKLO 2014-06-13 14:42:21 +04:00
parent 01e0b7ae81
commit ad0188baea
36 changed files with 516 additions and 486 deletions

View File

@ -81,7 +81,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 250
versionCode 251
versionName "1.5.0"
}
}

View File

@ -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);
}

View File

@ -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();
}

View File

@ -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) {

View File

@ -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);
}
}

View File

@ -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);

View File

@ -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();
}
}

View File

@ -216,7 +216,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return null;
}
TLRPC.InputUser inputUser = null;
if (user.id == UserConfig.clientUserId) {
if (user.id == UserConfig.getClientUserId()) {
inputUser = new TLRPC.TL_inputUserSelf();
} else if (user instanceof TLRPC.TL_userForeign || user instanceof TLRPC.TL_userRequest) {
inputUser = new TLRPC.TL_inputUserForeign();
@ -249,7 +249,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (obj.messageOwner.to_id.chat_id != 0) {
uid = -obj.messageOwner.to_id.chat_id;
} else {
if (obj.messageOwner.to_id.user_id == UserConfig.clientUserId) {
if (obj.messageOwner.to_id.user_id == UserConfig.getClientUserId()) {
obj.messageOwner.to_id.user_id = obj.messageOwner.from_id;
}
uid = obj.messageOwner.to_id.user_id;
@ -467,8 +467,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
users.putIfAbsent(user.id, user);
} else {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
}
@ -722,8 +722,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -743,8 +743,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
users.putIfAbsent(user.id, user);
} else {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
}
@ -759,7 +759,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
checkDeletingTask();
if (UserConfig.clientUserId != 0) {
if (UserConfig.isClientActivated()) {
if (ApplicationLoader.lastPauseTime == 0) {
if (statusSettingState != 1 && (lastStatusUpdateTime == 0 || lastStatusUpdateTime <= System.currentTimeMillis() - 55000 || offlineSent)) {
statusSettingState = 1;
@ -1015,15 +1015,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User u : messagesRes.users) {
if (isCache) {
if (u.id == UserConfig.clientUserId || u.id / 1000 == 333) {
if (u.id == UserConfig.getClientUserId() || u.id / 1000 == 333) {
users.put(u.id, u);
} else {
users.putIfAbsent(u.id, u);
}
} else {
users.put(u.id, u);
if (u.id == UserConfig.clientUserId) {
UserConfig.currentUser = u;
if (u.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(u);
}
}
}
@ -1188,15 +1188,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User u : dialogsRes.users) {
if (isCache) {
if (u.id == UserConfig.clientUserId || u.id / 1000 == 333) {
if (u.id == UserConfig.getClientUserId() || u.id / 1000 == 333) {
users.put(u.id, u);
} else {
users.putIfAbsent(u.id, u);
}
} else {
users.put(u.id, u);
if (u.id == UserConfig.clientUserId) {
UserConfig.currentUser = u;
if (u.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(u);
}
}
}
@ -1256,15 +1256,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User u : dialogsRes.users) {
if (isCache) {
if (u.id == UserConfig.clientUserId || u.id / 1000 == 333) {
if (u.id == UserConfig.getClientUserId() || u.id / 1000 == 333) {
users.put(u.id, u);
} else {
users.putIfAbsent(u.id, u);
}
} else {
users.put(u.id, u);
if (u.id == UserConfig.clientUserId) {
UserConfig.currentUser = u;
if (u.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(u);
}
}
}
@ -1369,7 +1369,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else {
UserConfig.saveConfig(false);
TLRPC.TL_photo photo = new TLRPC.TL_photo();
photo.user_id = UserConfig.clientUserId;
photo.user_id = UserConfig.getClientUserId();
photo.date = ConnectionsManager.getInstance().getCurrentTime();
photo.sizes = sizes;
photo.caption = "";
@ -1625,11 +1625,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMsg.action = new TLRPC.TL_messageActionTTLChange();
newMsg.action.ttl = encryptedChat.ttl;
newMsg.local_id = newMsg.id = UserConfig.getNewMessageId();
newMsg.from_id = UserConfig.clientUserId;
newMsg.from_id = UserConfig.getClientUserId();
newMsg.unread = true;
newMsg.dialog_id = ((long)encryptedChat.id) << 32;
newMsg.to_id = new TLRPC.TL_peerUser();
if (encryptedChat.participant_id == UserConfig.clientUserId) {
if (encryptedChat.participant_id == UserConfig.getClientUserId()) {
newMsg.to_id.user_id = encryptedChat.admin_id;
} else {
newMsg.to_id.user_id = encryptedChat.participant_id;
@ -1674,11 +1674,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMsg.action.encryptedAction = action;
newMsg.local_id = newMsg.id = UserConfig.getNewMessageId();
newMsg.from_id = UserConfig.clientUserId;
newMsg.from_id = UserConfig.getClientUserId();
newMsg.unread = true;
newMsg.dialog_id = ((long)encryptedChat.id) << 32;
newMsg.to_id = new TLRPC.TL_peerUser();
if (encryptedChat.participant_id == UserConfig.clientUserId) {
if (encryptedChat.participant_id == UserConfig.getClientUserId()) {
newMsg.to_id.user_id = encryptedChat.admin_id;
} else {
newMsg.to_id.user_id = encryptedChat.participant_id;
@ -1796,7 +1796,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
return;
}
newMsg.local_id = newMsg.id = UserConfig.getNewMessageId();
newMsg.from_id = UserConfig.clientUserId;
newMsg.from_id = UserConfig.getClientUserId();
newMsg.unread = true;
newMsg.dialog_id = peer;
int lower_id = (int)peer;
@ -1828,7 +1828,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else {
encryptedChat = encryptedChats.get((int)(peer >> 32));
newMsg.to_id = new TLRPC.TL_peerUser();
if (encryptedChat.participant_id == UserConfig.clientUserId) {
if (encryptedChat.participant_id == UserConfig.getClientUserId()) {
newMsg.to_id.user_id = encryptedChat.admin_id;
} else {
newMsg.to_id.user_id = encryptedChat.participant_id;
@ -2560,12 +2560,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter
@Override
public void run(TLObject response, TLRPC.TL_error error) {
if (error == null) {
TLRPC.User user = users.get(UserConfig.clientUserId);
TLRPC.User user = users.get(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.currentUser;
user = UserConfig.getCurrentUser();
users.put(user.id, user);
} else {
UserConfig.currentUser = user;
UserConfig.setCurrentUser(user);
}
if (user == null) {
return;
@ -2677,8 +2677,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -2746,8 +2746,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -2769,7 +2769,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
TLRPC.TL_chatParticipant newPart = new TLRPC.TL_chatParticipant();
newPart.user_id = user.id;
newPart.inviter_id = UserConfig.clientUserId;
newPart.inviter_id = UserConfig.getClientUserId();
newPart.date = ConnectionsManager.getInstance().getCurrentTime();
info.participants.add(0, newPart);
MessagesStorage.getInstance().updateChatInfo(info.chat_id, info, true);
@ -2824,14 +2824,14 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
chats.put(chat.id, chat);
}
if (user.id != UserConfig.clientUserId) {
if (user.id != UserConfig.getClientUserId()) {
final ArrayList<MessageObject> messagesObj = new ArrayList<MessageObject>();
messagesObj.add(new MessageObject(res.message, users));
TLRPC.Chat chat = res.chats.get(0);
@ -2858,7 +2858,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
});
if (user.id != UserConfig.clientUserId) {
if (user.id != UserConfig.getClientUserId()) {
final ArrayList<TLRPC.Message> messages = new ArrayList<TLRPC.Message>();
messages.add(res.message);
MessagesStorage.getInstance().putMessages(messages, true, true);
@ -2903,8 +2903,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -2969,8 +2969,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -3023,9 +3023,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}, null, true, RPCRequest.RPCRequestClassGeneric);
}
}
TLRPC.TL_auth_logOut req2 = new TLRPC.TL_auth_logOut();
ConnectionsManager.getInstance().performRpc(req2, new RPCRequest.RPCRequestDelegate() {
public void logOut() {
TLRPC.TL_auth_logOut req = new TLRPC.TL_auth_logOut();
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
@ -3034,7 +3036,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
public void registerForPush(final String regid) {
if (regid == null || regid.length() == 0 || registeringForPush || UserConfig.clientUserId == 0) {
if (regid == null || regid.length() == 0 || registeringForPush || UserConfig.getClientUserId() == 0) {
return;
}
if (UserConfig.registeredForPush && regid.equals(UserConfig.pushString)) {
@ -3266,8 +3268,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
public void run() {
for (TLRPC.User user : res.users) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
for (TLRPC.Chat chat : res.chats) {
@ -3348,7 +3350,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (message.to_id.chat_id != 0) {
uid = -message.to_id.chat_id;
} else {
if (message.to_id.user_id == UserConfig.clientUserId) {
if (message.to_id.user_id == UserConfig.getClientUserId()) {
message.to_id.user_id = message.from_id;
}
uid = message.to_id.user_id;
@ -3476,7 +3478,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (printUpdate) {
NotificationCenter.getInstance().postNotificationName(updateInterfaces, UPDATE_MASK_USER_PRINT);
}
if (obj.messageOwner.from_id != UserConfig.clientUserId) {
if (obj.messageOwner.from_id != UserConfig.getClientUserId()) {
long dialog_id;
if (obj.messageOwner.to_id.chat_id != 0) {
dialog_id = -obj.messageOwner.to_id.chat_id;
@ -3539,7 +3541,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (printUpdate) {
NotificationCenter.getInstance().postNotificationName(updateInterfaces, UPDATE_MASK_USER_PRINT);
}
if (obj.messageOwner.from_id != UserConfig.clientUserId) {
if (obj.messageOwner.from_id != UserConfig.getClientUserId()) {
long dialog_id;
if (obj.messageOwner.to_id.chat_id != 0) {
dialog_id = -obj.messageOwner.to_id.chat_id;
@ -3702,8 +3704,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (usersArr != null) {
for (TLRPC.User user : usersArr) {
users.put(user.id, user);
if (user.id == UserConfig.clientUserId) {
UserConfig.currentUser = user;
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
}
}
}
@ -3737,7 +3739,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (upd.message.to_id.chat_id != 0) {
uid = -upd.message.to_id.chat_id;
} else {
if (upd.message.to_id.user_id == UserConfig.clientUserId) {
if (upd.message.to_id.user_id == UserConfig.getClientUserId()) {
upd.message.to_id.user_id = upd.message.from_id;
}
uid = upd.message.to_id.user_id;
@ -3749,7 +3751,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
arr.add(obj);
MessagesStorage.lastPtsValue = update.pts;
if (upd.message.from_id != UserConfig.clientUserId && upd.message.to_id != null) {
if (upd.message.from_id != UserConfig.getClientUserId() && upd.message.to_id != null) {
if (uid != openned_dialog_id || ApplicationLoader.lastPauseTime != 0) {
lastMessage = obj;
}
@ -3765,7 +3767,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else if (update instanceof TLRPC.TL_updateRestoreMessages) {
MessagesStorage.lastPtsValue = update.pts;
} else if (update instanceof TLRPC.TL_updateUserTyping || update instanceof TLRPC.TL_updateChatUserTyping) {
if (update.user_id != UserConfig.clientUserId) {
if (update.user_id != UserConfig.getClientUserId()) {
long uid = -update.chat_id;
if (uid == 0) {
uid = update.user_id;
@ -3845,7 +3847,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.date = update.date;
newMessage.from_id = update.user_id;
newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.to_id.user_id = UserConfig.clientUserId;
newMessage.to_id.user_id = UserConfig.getClientUserId();
newMessage.out = false;
newMessage.dialog_id = update.user_id;
@ -3857,15 +3859,12 @@ public class MessagesController implements NotificationCenter.NotificationCenter
messages.put(newMessage.dialog_id, arr);
}
arr.add(obj);
if (newMessage.from_id != UserConfig.clientUserId && newMessage.to_id != null) {
if (newMessage.from_id != UserConfig.getClientUserId() && newMessage.to_id != null) {
if (newMessage.dialog_id != openned_dialog_id || ApplicationLoader.lastPauseTime != 0) {
lastMessage = obj;
}
}
}
// if (!contactsIds.contains(update.user_id)) {
// contactsIds.add(update.user_id);
// }
} else if (update instanceof TLRPC.TL_updateContactLink) {
if (update.my_link instanceof TLRPC.TL_contacts_myLinkContact || update.my_link instanceof TLRPC.TL_contacts_myLinkRequested && update.my_link.contact) {
int idx = contactsIds.indexOf(-update.user_id);
@ -3897,7 +3896,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.date = update.date;
newMessage.from_id = 333000;
newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.to_id.user_id = UserConfig.clientUserId;
newMessage.to_id.user_id = UserConfig.getClientUserId();
newMessage.out = false;
newMessage.dialog_id = 333000;
@ -3909,7 +3908,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
messages.put(newMessage.dialog_id, arr);
}
arr.add(obj);
if (newMessage.from_id != UserConfig.clientUserId && newMessage.to_id != null) {
if (newMessage.from_id != UserConfig.getClientUserId() && newMessage.to_id != null) {
if (newMessage.dialog_id != openned_dialog_id || ApplicationLoader.lastPauseTime != 0) {
lastMessage = obj;
}
@ -3930,7 +3929,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
messages.put(uid, arr);
}
arr.add(obj);
if (message.from_id != UserConfig.clientUserId && message.to_id != null) {
if (message.from_id != UserConfig.getClientUserId() && message.to_id != null) {
if (uid != openned_dialog_id || ApplicationLoader.lastPauseTime != 0) {
lastMessage = obj;
}
@ -3978,7 +3977,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (newChat instanceof TLRPC.TL_encryptedChatRequested && existingChat == null) {
int user_id = newChat.participant_id;
if (user_id == UserConfig.clientUserId) {
if (user_id == UserConfig.getClientUserId()) {
user_id = newChat.admin_id;
}
TLRPC.User user = users.get(user_id);
@ -4273,7 +4272,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
private void showInAppNotification(MessageObject messageObject) {
if (!UserConfig.clientActivated) {
if (!UserConfig.isClientActivated()) {
return;
}
if (ApplicationLoader.lastPauseTime != 0) {
@ -4292,7 +4291,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
int user_id = messageObject.messageOwner.to_id.user_id;
if (user_id == 0) {
user_id = messageObject.messageOwner.from_id;
} else if (user_id == UserConfig.clientUserId) {
} else if (user_id == UserConfig.getClientUserId()) {
user_id = messageObject.messageOwner.from_id;
}
@ -4375,7 +4374,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
msg = LocaleController.formatString("NotificationContactNewPhoto", R.string.NotificationContactNewPhoto, Utilities.formatName(user.first_name, user.last_name));
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionLoginUnknownLocation) {
String date = String.format("%s %s %s", LocaleController.formatterYear.format(((long)messageObject.messageOwner.date) * 1000), LocaleController.getString("OtherAt", R.string.OtherAt), LocaleController.formatterDay.format(((long)messageObject.messageOwner.date) * 1000));
msg = LocaleController.formatString("NotificationUnrecognizedDevice", R.string.NotificationUnrecognizedDevice, UserConfig.currentUser.first_name, date, messageObject.messageOwner.action.title, messageObject.messageOwner.action.address);
msg = LocaleController.formatString("NotificationUnrecognizedDevice", R.string.NotificationUnrecognizedDevice, UserConfig.getCurrentUser().first_name, date, messageObject.messageOwner.action.title, messageObject.messageOwner.action.address);
}
} else {
if (messageObject.messageOwner.media instanceof TLRPC.TL_messageMediaEmpty) {
@ -4405,7 +4404,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (preferences.getBoolean("EnablePreviewGroup", true)) {
if (messageObject.messageOwner instanceof TLRPC.TL_messageService) {
if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatAddUser) {
if (messageObject.messageOwner.action.user_id == UserConfig.clientUserId) {
if (messageObject.messageOwner.action.user_id == UserConfig.getClientUserId()) {
msg = LocaleController.formatString("NotificationInvitedToGroup", R.string.NotificationInvitedToGroup, Utilities.formatName(user.first_name, user.last_name), chat.title);
} else {
TLRPC.User u2 = users.get(messageObject.messageOwner.action.user_id);
@ -4419,7 +4418,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatEditPhoto || messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatDeletePhoto) {
msg = LocaleController.formatString("NotificationEditedGroupPhoto", R.string.NotificationEditedGroupPhoto, Utilities.formatName(user.first_name, user.last_name), chat.title);
} else if (messageObject.messageOwner.action instanceof TLRPC.TL_messageActionChatDeleteUser) {
if (messageObject.messageOwner.action.user_id == UserConfig.clientUserId) {
if (messageObject.messageOwner.action.user_id == UserConfig.getClientUserId()) {
msg = LocaleController.formatString("NotificationGroupKickYou", R.string.NotificationGroupKickYou, Utilities.formatName(user.first_name, user.last_name), chat.title);
} else if (messageObject.messageOwner.action.user_id == user.id) {
msg = LocaleController.formatString("NotificationGroupLeftMember", R.string.NotificationGroupLeftMember, Utilities.formatName(user.first_name, user.last_name), chat.title);
@ -4684,7 +4683,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (object != null) {
int from_id = chat.admin_id;
if (from_id == UserConfig.clientUserId) {
if (from_id == UserConfig.getClientUserId()) {
from_id = chat.participant_id;
}
@ -4698,7 +4697,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.from_id = from_id;
newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.random_id = message.random_id;
newMessage.to_id.user_id = UserConfig.clientUserId;
newMessage.to_id.user_id = UserConfig.getClientUserId();
newMessage.out = false;
newMessage.unread = true;
newMessage.dialog_id = ((long)chat.id) << 32;
@ -4843,7 +4842,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newMessage.date = message.date;
newMessage.from_id = from_id;
newMessage.to_id = new TLRPC.TL_peerUser();
newMessage.to_id.user_id = UserConfig.clientUserId;
newMessage.to_id.user_id = UserConfig.getClientUserId();
newMessage.out = false;
newMessage.dialog_id = ((long)chat.id) << 32;
MessagesStorage.getInstance().updateEncryptedChatTTL(chat);

View File

@ -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));

View File

@ -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);

View File

@ -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;

View File

@ -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);
}

View File

@ -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();
}
}

View File

@ -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));

View File

@ -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();
}

View File

@ -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);
}

View File

@ -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) {

View File

@ -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);

View File

@ -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();
}

View File

@ -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) {

View File

@ -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() {

View File

@ -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));

View File

@ -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() {

View File

@ -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();

View File

@ -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) {

View File

@ -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

View File

@ -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

View File

@ -52,6 +52,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
private volatile int time = 60000;
private double lastCurrentTime;
private boolean waitingForSms = false;
private boolean nextPressed = false;
public LoginActivitySmsView(Context context) {
super(context);
@ -171,7 +172,7 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
@Override
public void run(TLObject response, TLRPC.TL_error error) {
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors | RPCRequest.RPCRequestClassWithoutLogin);
}
}
});
@ -181,6 +182,10 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
@Override
public void onNextPressed() {
if (nextPressed) {
return;
}
nextPressed = true;
waitingForSms = false;
Utilities.setWaitingForSms(false);
NotificationCenter.getInstance().removeObserver(this, 998);
@ -203,15 +208,16 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
}
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) {
TLRPC.TL_auth_authorization res = (TLRPC.TL_auth_authorization)response;
if (delegate == null) {
return;
}
@ -229,12 +235,10 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
MessagesStorage.getInstance().cleanUp();
MessagesController.getInstance().cleanUp();
ConnectionsManager.getInstance().cleanUp();
UserConfig.currentUser = res.user;
UserConfig.clientActivated = true;
UserConfig.clientUserId = res.user.id;
UserConfig.setCurrentUser(res.user);
UserConfig.saveConfig(true);
ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
users.add(UserConfig.currentUser);
users.add(res.user);
MessagesStorage.getInstance().putUsersAndChats(users, null, true, true);
MessagesController.getInstance().users.put(res.user.id, res.user);
ContactsController.getInstance().checkAppAccount();
@ -242,13 +246,8 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
delegate.needFinishActivity();
}
ConnectionsManager.getInstance().initPushConnection();
}
});
} else {
if (error.text.contains("PHONE_NUMBER_UNOCCUPIED") && registered == null) {
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
} else {
if (error.text.contains("PHONE_NUMBER_UNOCCUPIED") && registered == null) {
Bundle params = new Bundle();
params.putString("phoneFormated", requestPhone);
params.putString("phoneHash", phoneHash);
@ -264,62 +263,64 @@ public class LoginActivitySmsView extends SlideView implements NotificationCente
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
});
} else {
if (timeTimer == null) {
timeTimer = new Timer();
timeTimer.schedule(new TimerTask() {
@Override
public void run() {
double currentTime = System.currentTimeMillis();
double diff = currentTime - lastCurrentTime;
time -= diff;
lastCurrentTime = currentTime;
Utilities.RunOnUIThread(new Runnable() {
} else {
if (timeTimer == null) {
timeTimer = new Timer();
timeTimer.schedule(new TimerTask() {
@Override
public void run() {
if (time >= 1000) {
int minutes = time / 1000 / 60;
int seconds = time / 1000 - minutes * 60;
timeText.setText(String.format("%s %d:%02d", LocaleController.getString("CallText", R.string.CallText), minutes, seconds));
} else {
timeText.setText(LocaleController.getString("Calling", R.string.Calling));
synchronized(timerSync) {
if (timeTimer != null) {
timeTimer.cancel();
timeTimer = null;
double currentTime = System.currentTimeMillis();
double diff = currentTime - lastCurrentTime;
time -= diff;
lastCurrentTime = currentTime;
Utilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
if (time >= 1000) {
int minutes = time / 1000 / 60;
int seconds = time / 1000 - minutes * 60;
timeText.setText(String.format("%s %d:%02d", LocaleController.getString("CallText", R.string.CallText), minutes, seconds));
} else {
timeText.setText(LocaleController.getString("Calling", R.string.Calling));
synchronized(timerSync) {
if (timeTimer != null) {
timeTimer.cancel();
timeTimer = null;
}
}
TLRPC.TL_auth_sendCall req = new TLRPC.TL_auth_sendCall();
req.phone_number = requestPhone;
req.phone_code_hash = phoneHash;
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors | RPCRequest.RPCRequestClassWithoutLogin);
}
}
TLRPC.TL_auth_sendCall req = new TLRPC.TL_auth_sendCall();
req.phone_number = requestPhone;
req.phone_code_hash = phoneHash;
ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, TLRPC.TL_error error) {
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
}
});
}
});
}, 0, 1000);
}
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.startsWith("FLOOD_WAIT")) {
delegate.needShowAlert(LocaleController.getString("FloodWait", R.string.FloodWait));
} else {
delegate.needShowAlert(error.text);
}
}
}, 0, 1000);
}
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 {
delegate.needShowAlert(error.text);
}
}
}
}
});
}
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
}, null, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors | RPCRequest.RPCRequestClassWithoutLogin);
}
@Override

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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>

View File

@ -12,14 +12,14 @@
<!--signin view-->
<string name="YourPhone">Dein Telefon</string>
<string name="StartText">Bitte bestätige deine Landesvorwahl und deine Telefonnummer.</string>
<string name="ChooseCountry">Wähle dein Land</string>
<string name="ChooseCountry">Wähle ein Land</string>
<string name="WrongCountry">Falsche Landesvorwahl</string>
<!--code enter view-->
<string name="YourCode">Dein Code</string>
<string name="SentSmsCode">Wir haben dir eine SMS mit einem Aktivierungscode zugeschickt: </string>
<string name="SentSmsCode">Wir haben dir eine SMS mit einem Aktivierungscode zugeschickt</string>
<string name="CallText">Wir rufen dich an in</string>
<string name="Calling">Wir rufen dich an </string>
<string name="Calling">Wir rufen dich an…</string>
<string name="Code">Code</string>
<string name="WrongNumber">Falsche Nummer?</string>
@ -40,15 +40,15 @@
<string name="NewGroup">Neue Gruppe</string>
<string name="Yesterday">gestern</string>
<string name="NoResult">Keine Ergebnisse</string>
<string name="NoChats">Noch keine Chats </string>
<string name="NoChats">Noch keine Chats…</string>
<string name="NoChatsHelp">Beginne Telegram zu nutzen, indem du\neine neue Nachricht erstellst (rechte obere Ecke)\noder deine Kontakte aufrufst.</string>
<string name="WaitingForNetwork">Warte auf Verbindung </string>
<string name="Connecting">Verbinde </string>
<string name="Updating">Aktualisiere </string>
<string name="WaitingForNetwork">Warte auf Verbindung…</string>
<string name="Connecting">Verbinde…</string>
<string name="Updating">Aktualisiere…</string>
<string name="NewSecretChat">Neuer geheimer Chat</string>
<string name="AwaitingEncryption">Warte, bis %s online geht </string>
<string name="AwaitingEncryption">Warte, bis %s online geht…</string>
<string name="EncryptionRejected">Geheimen Chat abgelehnt</string>
<string name="EncryptionProcessing">Tausche Schlüssel aus </string>
<string name="EncryptionProcessing">Tausche Schlüssel aus…</string>
<string name="EncryptedChatStartedOutgoing">%s ist deinem geheimen Chat beigetreten.</string>
<string name="EncryptedChatStartedIncoming">Du bist dem geheimen Chat beigetreten.</string>
<string name="ClearHistory">Verlauf löschen</string>
@ -61,7 +61,7 @@
<string name="FreeOfTotal">Freier Speicher: %1$s von %2$s</string>
<string name="UnknownError">Unbekannter Fehler</string>
<string name="AccessError">Zugriffsfehler</string>
<string name="NoFiles">Noch keine Dateien </string>
<string name="NoFiles">Noch keine Dateien…</string>
<string name="FileUploadLimit">Die Datei darf nicht größer als %1$s sein</string>
<string name="NotMounted">Speicher nicht eingebunden</string>
<string name="UsbActive">USB-Transfer aktiv</string>
@ -72,10 +72,10 @@
<!--chat view-->
<string name="Invisible">unsichtbar</string>
<string name="Typing">schreibt </string>
<string name="Typing">schreibt…</string>
<string name="Attach">Anhängen</string>
<string name="IsTyping">schreibt</string>
<string name="AreTyping">tippen </string>
<string name="IsTyping">schreibt...</string>
<string name="AreTyping">tippen…</string>
<string name="AndMoreTyping">und %d weitere Personen</string>
<string name="GotAQuestion">Du hast eine Frage\nzu Telegram?</string>
<string name="ChatTakePhoto">Foto aufnehmen</string>
@ -83,7 +83,7 @@
<string name="ChatLocation">Standort</string>
<string name="ChatVideo">Video</string>
<string name="ChatDocument">Dokument</string>
<string name="NoMessages">Noch keine Nachrichten </string>
<string name="NoMessages">Noch keine Nachrichten…</string>
<string name="ViewPhoto">Foto anzeigen</string>
<string name="ViewLocation">Standort anzeigen</string>
<string name="ViewVideo">Video abspielen</string>
@ -100,7 +100,7 @@
<string name="EncryptedPlaceholderTitleIncoming">%s hat dich zu einem geheimen Chat eingeladen.</string>
<string name="EncryptedPlaceholderTitleOutgoing">Du hast %s zu einem geheimen Chat eingeladen.</string>
<string name="EncryptedDescriptionTitle">Geheime Chats:</string>
<string name="EncryptedDescription1">Verwenden Ende-zu-Ende-Verschlüsselung</string>
<string name="EncryptedDescription1">Verwenden End-to-End-Verschlüsselung</string>
<string name="EncryptedDescription2">Hinterlassen keine Spuren auf unseren Servern</string>
<string name="EncryptedDescription3">Haben einen Selbstzerstörungs-Timer</string>
<string name="EncryptedDescription4">Erlauben keine Weiterleitung von Nachrichten</string>
@ -111,8 +111,8 @@
<string name="DeleteThisGroup">Diese Gruppe löschen</string>
<string name="DeleteThisChat">Diesen Chat löschen</string>
<string name="SlideToCancel">WISCHEN UM ABZUBRECHEN</string>
<string name="SaveToDownloads">In Ordner Downloads speichern</string>
<string name="ApplyLocalizationFile">Sprachdatei benutzen</string>
<string name="SaveToDownloads">Im Ordner Downloads speichern</string>
<string name="ApplyLocalizationFile">Standort-Datei benutzen</string>
<!--notification-->
<string name="EncryptedChatRequested">Geheimen Chat angefordert</string>
@ -152,7 +152,7 @@
<string name="NotificationGroupKickYou">%1$s hat dich aus der Gruppe %2$s entfernt</string>
<string name="NotificationGroupLeftMember">%1$s hat die Gruppe %2$s verlassen</string>
<string name="NotificationContactJoined">%1$s benutzt jetzt Telegram!</string>
<string name="NotificationUnrecognizedDevice">%1$s,\n\nwir haben einen Zugriff auf dein Konto von einem neuen Gerät am %2$s erkannt.\n\nGerät: %3$s\nStandort: %4$s\n\nWenn du das nicht gewesen bist, kannst du in den Einstellungen alle Sitzungen beenden.\n\nDanke,\ndas Telegram Team</string>
<string name="NotificationUnrecognizedDevice">%1$s,\n\nwir haben einen Zugriff auf dein Konto von einem neuen Gerät am %2$s erkannt.\n\nGerät: %3$s\nStandort: %4$s\n\nWenn du das nicht warst, kannst du in den Einstellungen alle Sitzungen beenden.\n\nDanke,\ndas Telegram Team</string>
<string name="NotificationContactNewPhoto">%1$s hat das Profilbild geändert</string>
<!--contacts view-->
@ -163,13 +163,13 @@
<string name="YesterdayAt">gestern um</string>
<string name="OtherAt">um</string>
<string name="Online">online</string>
<string name="Offline">Offline</string>
<string name="Offline">offline</string>
<string name="LastSeen">zul. online</string>
<string name="LastSeenDate">zul. online</string>
<string name="InviteFriends">Freunde einladen</string>
<!--group create view-->
<string name="SendMessageTo">Sende Nachricht an </string>
<string name="SendMessageTo">Sende Nachricht an…</string>
<string name="EnterGroupNamePlaceholder">Gruppennamen eingeben</string>
<string name="MEMBER">MITGLIED</string>
<string name="GroupName">Gruppenname</string>
@ -236,7 +236,7 @@
<string name="InAppPreview">In-App-Vorschau</string>
<string name="Reset">ZURÜCKSETZEN</string>
<string name="ResetAllNotifications">Alle Benachrichtigungs-Einstellungen zurücksetzen</string>
<string name="UndoAllCustom">Setze alle benutzerdefinierten Einstellungen für Benachrichtigungen zurück</string>
<string name="UndoAllCustom">Setzt alle benutzerdefinierten Einstellungen für Benachrichtigungen zurück</string>
<string name="NotificationsAndSounds">Benachrichtigungen</string>
<string name="BlockedUsers">Blockierte Benutzer</string>
<string name="SaveIncomingPhotos">Speichere eingehende Bilder</string>
@ -257,7 +257,7 @@
<string name="ContactJoined">Kontakt ist Telegram beigetreten</string>
<string name="Pebble">PEBBLE</string>
<string name="Language">Sprache</string>
<string name="AskAQuestionInfo">Bedenke bitte, dass der Telegram Support von Freiwilligen geleistet wird. Wir versuchen so schnell wie möglich zu antworten. Dies kann jedoch manchmal etwas länger dauern.<![CDATA[<br><br>]]>Bitte schau in den <![CDATA[<a href="http://telegram.org/faq#general">Telegram FAQ</a>]]>: nach. Dort findest du Antworten auf die meisten Fragen und wichtige Tipps zur <![CDATA[<a href="http://telegram.org/faq#troubleshooting">Problemlösung</a>]]>.</string>
<string name="AskAQuestionInfo">Bedenke bitte, dass der Telegram Support von Freiwilligen geleistet wird. Wir versuchen so schnell wie möglich zu antworten. Dies kann jedoch manchmal etwas länger dauern.<![CDATA[<br><br>]]>Bitte schau in den <![CDATA[<a href="http://telegram.org/faq#general">Telegram FAQ</a>]]> nach. Dort findest du Antworten auf die meisten Fragen und wichtige Tipps zur <![CDATA[<a href="http://telegram.org/faq#troubleshooting">Problemlösung</a>]]>.</string>
<string name="AskButton">Frage einen Freiwilligen</string>
<string name="TelegramFaq">Telegram-FAQ</string>
<string name="TelegramFaqUrl">https://telegram.org/faq</string>
@ -265,7 +265,7 @@
<string name="IncorrectLocalization">Falsche Sprachdatei</string>
<string name="Enabled">Aktiviert</string>
<string name="Disabled">Deaktiviert</string>
<string name="NotificationsService">Benachrichtigungsdienst</string>
<string name="NotificationsService">Dienst für Benachrichtigungen</string>
<string name="NotificationsServiceDisableInfo">Sofern Google Play Dienste ausreichend für deine Benachrichtigungen sind, kannst du unseren Benachrichtigungsdienst abschalten. Wir empfehlen allerdings, unseren Dienst dauerhaft aktiviert zu lassen um über neue Nachrichten in Echtzeit informiert zu werden.</string>
<string name="SortBy">sortiert nach</string>
<string name="ImportContacts">Kontakte importieren</string>
@ -284,7 +284,7 @@
<string name="Hybrid">Hybrid</string>
<string name="MetersAway">m entfernt</string>
<string name="KMetersAway">km entfernt</string>
<string name="SendLocation">Sende Standort</string>
<string name="SendLocation">Standort senden</string>
<string name="ShareLocation">Teile Standort</string>
<!--photo gallery view-->
@ -333,7 +333,7 @@
<string name="ActionYouCreateGroup">Du hast die Gruppe erstellt</string>
<string name="ActionKickUserYou">un1 hat dich aus der Gruppe entfernt</string>
<string name="ActionAddUserYou">un1 hat dich hinzugefügt</string>
<string name="UnsuppotedMedia">Diese Nachricht wird auf deiner Version von Telegram nicht unterstützt. Bitte aktualisiere die App um sie zu sehen: http://telegram.org/update</string>
<string name="UnsuppotedMedia">Diese Nachricht wird von deiner Telegram-Version nicht unterstützt. Bitte aktualisiere die App um sie zu sehen: http://telegram.org/update</string>
<string name="AttachPhoto">Foto</string>
<string name="AttachVideo">Video</string>
<string name="AttachLocation">Standort</string>
@ -351,7 +351,7 @@
<string name="InvalidCode">Ungültiger Code</string>
<string name="InvalidFirstName">Ungültiger Vorname</string>
<string name="InvalidLastName">Ungültiger Nachname</string>
<string name="Loading">Lädt </string>
<string name="Loading">Lädt…</string>
<string name="NoPlayerInstalled">Du hast keinen Videoplayer. Bitte installiere einen um fortzufahren.</string>
<string name="NoHandleAppInstalled">Du hast keine App, die den Dokumententyp \'%1$s\' öffnen kann.</string>
<string name="InviteUser">Dieser Benutzer hat noch kein Telegram. Möchtest du ihn einladen?</string>
@ -373,7 +373,7 @@
<string name="Page2Message"><![CDATA[<b>Telegram</b>]]> stellt Nachrichten schneller zu als andere Anwendungen</string>
<string name="Page3Message"><![CDATA[<b>Telegram</b>]]> ist für immer kostenlos. Keine Werbung. Keine wiederkehrenden Kosten.</string>
<string name="Page4Message"><![CDATA[<b>Telegram</b>]]> schützt deine Nachrichten vor Hacker-Angriffen</string>
<string name="Page5Message"><![CDATA[<b>Telegram</b>]]> hat keine Grenzen in Sachen Größe deiner Chats und Medien</string>
<string name="Page5Message"><![CDATA[<b>Telegram</b>]]> unterstützt unbegrenzt große Chats und Mediendateien</string>
<string name="Page6Message"><![CDATA[<b>Telegram</b>]]> lässt sich von verschiedenen Geräten gleichzeitig nutzen</string>
<string name="Page7Message"><![CDATA[<b>Telegram</b>]]>-Nachrichten sind stark verschlüsselt und können sich selbst zerstören</string>
<string name="StartMessaging">Jetzt beginnen</string>

View File

@ -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>

View File

@ -10,22 +10,22 @@
<string name="LanguageCode">nl</string>
<!--signin view-->
<string name="YourPhone">Uw telefoon</string>
<string name="StartText">Bevestig uw landcode\nen voer uw telefoonnummer in.</string>
<string name="YourPhone">Je telefoon</string>
<string name="StartText">Bevestig je landcode\nen voer je telefoonnummer in.</string>
<string name="ChooseCountry">Kies een land</string>
<string name="WrongCountry">Onjuist landcode</string>
<!--code enter view-->
<string name="YourCode">Uw code</string>
<string name="SentSmsCode">We hebben een sms met een activatiecode verzonden naar uw telefoon</string>
<string name="CallText">We bellen u over</string>
<string name="Calling">We bellen u</string>
<string name="YourCode">Je code</string>
<string name="SentSmsCode">We hebben een sms met een activatiecode verzonden naar je telefoon</string>
<string name="CallText">We bellen je over</string>
<string name="Calling">We bellen je</string>
<string name="Code">Code</string>
<string name="WrongNumber">Verkeerde nummer?</string>
<string name="WrongNumber">Verkeerd nummer?</string>
<!--signup view-->
<string name="YourName">Uw naam</string>
<string name="RegisterText">Voer uw voor- en achternaam in</string>
<string name="YourName">Je naam</string>
<string name="RegisterText">Voer je voor- en achternaam in</string>
<!--<string name="RegisterText">Set up your name and picture</string>-->
<string name="FirstName">Voornaam (verplicht)</string>
<string name="LastName">Achternaam (optioneel)</string>
@ -50,7 +50,7 @@
<string name="EncryptionRejected">Privégesprek geannuleerd</string>
<string name="EncryptionProcessing">Encryptiesleutels uitwisselen…</string>
<string name="EncryptedChatStartedOutgoing">%s neemt nu deel aan het privégesprek.</string>
<string name="EncryptedChatStartedIncoming">U neemt nu deel aan het privégesprek.</string>
<string name="EncryptedChatStartedIncoming">Je neemt nu deel aan het privégesprek.</string>
<string name="ClearHistory">Geschiedenis wissen</string>
<string name="DeleteChat">Verwijderen en verlaten</string>
<string name="HiddenName">Verborgen naam</string>
@ -77,7 +77,7 @@
<string name="IsTyping">is aan het typen…</string>
<string name="AreTyping">zijn aan het typen…</string>
<string name="AndMoreTyping">en nog %d personen</string>
<string name="GotAQuestion">Hebt u een vraag\nover Telegram?</string>
<string name="GotAQuestion">Heb je een vraag\nover Telegram?</string>
<string name="ChatTakePhoto">Foto maken</string>
<string name="ChatGallery">Galerij</string>
<string name="ChatLocation">Locatie</string>
@ -97,8 +97,8 @@
<string name="Selected">Geselecteerd: %d</string>
<string name="ShareMyContactInfo">MIJN CONTACTGEGEVENS DELEN</string>
<string name="AddToContacts">TOEVOEGEN AAN CONTACTEN</string>
<string name="EncryptedPlaceholderTitleIncoming">%s heeft u uitgenodigd voor een privégesprek.</string>
<string name="EncryptedPlaceholderTitleOutgoing">U hebt %s uitgenodigd voor een privégesprek.</string>
<string name="EncryptedPlaceholderTitleIncoming">%s heeft je uitgenodigd voor een privégesprek.</string>
<string name="EncryptedPlaceholderTitleOutgoing">Je hebt %s uitgenodigd voor een privégesprek.</string>
<string name="EncryptedDescriptionTitle">Privégesprekken:</string>
<string name="EncryptedDescription1">gebruiken end-to-endversleuteling</string>
<string name="EncryptedDescription2">laten geen sporen achter op onze server</string>
@ -106,8 +106,8 @@
<string name="EncryptedDescription4">staan doorsturen niet toe</string>
<string name="OneNewMessage">%1$d nieuw bericht</string>
<string name="FewNewMessages">%1$d nieuwe berichten</string>
<string name="YouWereKicked">U bent verwijderd uit deze groep</string>
<string name="YouLeft">U hebt deze groep verlaten</string>
<string name="YouWereKicked">Je bent verwijderd uit deze groep</string>
<string name="YouLeft">Je hebt deze groep verlaten</string>
<string name="DeleteThisGroup">Deze groep verwijderen</string>
<string name="DeleteThisChat">Verwijder dit gesprek</string>
<string name="SlideToCancel">SLEEP OM TE ANNULEREN</string>
@ -118,24 +118,24 @@
<string name="EncryptedChatRequested">Privégesprek aangevraagd</string>
<string name="EncryptedChatAccepted">Privégesprek gestart</string>
<string name="MessageLifetimeChanged">%1$s heeft de verlooptijd ingesteld op %2$s</string>
<string name="MessageLifetimeChangedOutgoing">U hebt de verlooptijd ingesteld op %1$s</string>
<string name="MessageLifetimeChangedOutgoing">Je hebt de verlooptijd ingesteld op %1$s</string>
<string name="MessageLifetimeRemoved">%1$s heeft de verlooptijd uitgeschakeld</string>
<string name="MessageLifetimeYouRemoved">U hebt de verlooptijd uitgeschakeld</string>
<string name="MessageLifetimeYouRemoved">Je hebt de verlooptijd uitgeschakeld</string>
<string name="MessageLifetime2s">2 seconden</string>
<string name="MessageLifetime5s">5 seconden</string>
<string name="MessageLifetime1m">1 minuut</string>
<string name="MessageLifetime1h">1 uur</string>
<string name="MessageLifetime1d">1 dag</string>
<string name="MessageLifetime1w">1 week</string>
<string name="YouHaveNewMessage">U hebt een nieuw bericht</string>
<string name="YouHaveNewMessage">Je hebt een nieuw bericht</string>
<string name="NotificationMessageText">%1$s: %2$s</string>
<string name="NotificationMessageNoText">%1$s heeft u een bericht gestuurd</string>
<string name="NotificationMessagePhoto">%1$s heeft u een foto gestuurd</string>
<string name="NotificationMessageVideo">%1$s heeft u een video gestuurd</string>
<string name="NotificationMessageContact">%1$s heeft een contact met u gedeeld</string>
<string name="NotificationMessageMap">%1$s heeft u een locatie gestuurd</string>
<string name="NotificationMessageDocument">%1$s heeft u een document gestuurd</string>
<string name="NotificationMessageAudio">%1$s heeft u een geluidsbestand gestuurd</string>
<string name="NotificationMessageNoText">%1$s heeft je een bericht gestuurd</string>
<string name="NotificationMessagePhoto">%1$s heeft je een foto gestuurd</string>
<string name="NotificationMessageVideo">%1$s heeft je een video gestuurd</string>
<string name="NotificationMessageContact">%1$s heeft een contact met je gedeeld</string>
<string name="NotificationMessageMap">%1$s heeft je een locatie gestuurd</string>
<string name="NotificationMessageDocument">%1$s heeft je een document gestuurd</string>
<string name="NotificationMessageAudio">%1$s heeft je een geluidsbestand gestuurd</string>
<string name="NotificationMessageGroupText">%1$s @ %2$s: %3$s</string>
<string name="NotificationMessageGroupNoText">%1$s heeft een bericht gestuurd naar de groep %2$s</string>
<string name="NotificationMessageGroupPhoto">%1$s heeft een foto gestuurd naar de groep %2$s</string>
@ -144,21 +144,21 @@
<string name="NotificationMessageGroupMap">%1$s heeft een locatie gestuurd naar de groep %2$s</string>
<string name="NotificationMessageGroupDocument">%1$s heeft een document gestuurd naar de groep %2$s</string>
<string name="NotificationMessageGroupAudio">%1$s heeft een geluidsbestand gestuurd naar de groep %2$s</string>
<string name="NotificationInvitedToGroup">%1$s heeft u uitgenodigd voor de groep %2$s</string>
<string name="NotificationInvitedToGroup">%1$s heeft je uitgenodigd voor de groep %2$s</string>
<string name="NotificationEditedGroupName">%1$s heeft de naam van de groep %2$s gewijzigd</string>
<string name="NotificationEditedGroupPhoto">%1$s heeft de afbeelding van de groep %2$s gewijzigd</string>
<string name="NotificationGroupAddMember">%1$s heeft %3$s uitgenodigd voor de groep %2$s</string>
<string name="NotificationGroupKickMember">%1$s heeft %3$s verwijderd uit de groep %2$s</string>
<string name="NotificationGroupKickYou">%1$s heeft u verwijderd uit de groep %2$s</string>
<string name="NotificationGroupKickYou">%1$s heeft je verwijderd uit de groep %2$s</string>
<string name="NotificationGroupLeftMember">%1$s heeft de groep %2$s verlaten</string>
<string name="NotificationContactJoined">%1$s heeft nu Telegram!</string>
<string name="NotificationUnrecognizedDevice">%1$s,\nEr is op uw account ingelogd vanaf een nieuw apparaat op %2$s\n\nApparaat: %3$s\nLocatie: %4$s\n\nAls u dit niet was, kunt u alle sessies beëindigen via de instellingen.\n\nHet Telegram-team</string>
<string name="NotificationUnrecognizedDevice">%1$s,\nEr is op je account ingelogd vanaf een nieuw apparaat op %2$s\n\nApparaat: %3$s\nLocatie: %4$s\n\nAls jij dit niet was, kun je alle sessies beëindigen via Instellingen Alle andere sessies beëindigen.\n\nHet Telegram-team</string>
<string name="NotificationContactNewPhoto">%1$s heeft zijn/haar profielfoto gewijzigd</string>
<!--contacts view-->
<string name="SelectContact">Kies een contact</string>
<string name="NoContacts">Nog geen contacten</string>
<string name="InviteText">Hoi, zullen we overstappen op Telegram? http://telegram.org/dl2</string>
<string name="InviteText">Hey! Zullen we overstappen op Telegram? http://telegram.org/dl2</string>
<string name="TodayAt">vandaag om</string>
<string name="YesterdayAt">gisteren om</string>
<string name="OtherAt">om</string>
@ -213,7 +213,7 @@
<string name="ShortMessageLifetime1h">1u</string>
<string name="ShortMessageLifetime1d">1d</string>
<string name="ShortMessageLifetime1w">1w</string>
<string name="EncryptionKeyDescription">Dit is een weergave van de encryptiesleutel voor dit privégesprek met <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Als deze afbeelding er bij <![CDATA[<b>]]>%2$s<![CDATA[</b>]]> hetzelfde uitziet, is uw gesprek 200%% beveiligd.<![CDATA[<br><br>]]>Lees meer op telegram.org.</string>
<string name="EncryptionKeyDescription">Dit is een weergave van de encryptiesleutel voor dit privégesprek met <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Als deze afbeelding er bij <![CDATA[<b>]]>%2$s<![CDATA[</b>]]> hetzelfde uitziet, is jullie gesprek 200%% beveiligd.<![CDATA[<br><br>]]>Lees meer op telegram.org.</string>
<!--settings view-->
<string name="ResetNotificationsText">Alle meldingsinstellingen herstellen</string>
@ -222,18 +222,18 @@
<string name="EnableAnimations">Animaties</string>
<string name="Unblock">Deblokkeren</string>
<string name="UnblockText">Houd een gebruiker ingedrukt om hem/haar te deblokkeren.</string>
<string name="NoBlocked">Nog geen geblokkeerde gebruikers</string>
<string name="YourPhoneNumber">UW TELEFOONNUMMER</string>
<string name="NoBlocked">Geen geblokkeerde gebruikers</string>
<string name="YourPhoneNumber">JE TELEFOONNUMMER</string>
<string name="MessageNotifications">BERICHTMELDINGEN</string>
<string name="Alert">Waarschuwing</string>
<string name="MessagePreview">Voorbeeld van berichten</string>
<string name="MessagePreview">Voorvertoning</string>
<string name="GroupNotifications">GROEPSMELDINGEN</string>
<string name="Sound">Geluid</string>
<string name="InAppNotifications">IN-APP MELDINGEN</string>
<string name="InAppSounds">In-app geluiden</string>
<string name="InAppVibrate">In-app trillen</string>
<string name="InAppNotifications">IN-APP BERICHTGEVING</string>
<string name="InAppSounds">Geluiden</string>
<string name="InAppVibrate">Trillen</string>
<string name="Vibrate">Trillen</string>
<string name="InAppPreview">In-app voorbeelden</string>
<string name="InAppPreview">Voorvertoningen</string>
<string name="Reset">RESETTEN</string>
<string name="ResetAllNotifications">Alle meldingen resetten</string>
<string name="UndoAllCustom">Alle aangepaste meldingsinstellingen ongedaan maken voor alle contacten en groepen.</string>
@ -241,7 +241,7 @@
<string name="BlockedUsers">Geblokkeerde gebruikers</string>
<string name="SaveIncomingPhotos">Inkomende foto\'s opslaan</string>
<string name="LogOut">Uitloggen</string>
<string name="YourFirstNameAndLastName">UW VOOR- EN ACHTERNAAM</string>
<string name="YourFirstNameAndLastName">JE VOOR- EN ACHTERNAAM</string>
<string name="NoSound">Geen geluid</string>
<string name="Default">Standaard</string>
<string name="Support">ONDERSTEUNING</string>
@ -257,19 +257,19 @@
<string name="ContactJoined">Contact lid geworden van Telegram</string>
<string name="Pebble">PEBBLE</string>
<string name="Language">Taal</string>
<string name="AskAQuestionInfo">Houd er rekening mee dat de ondersteuning van Telegram door vrijwilligers wordt gedaan. We doen ons best om zo snel als mogelijk te antwoorden, maar het kan even even duren.<![CDATA[<br><br>]]>Bekijk ook de <![CDATA[<a href="http://telegram.org/faq#general">veelgestelde vragen (FAQ)</a>]]>: hier staan de antwoorden op de meeste vragen en belangrijke tips voor <![CDATA[<a href="http://telegram.org/faq#troubleshooting">het oplossen van problemen</a>]]>.</string>
<string name="AskAQuestionInfo">Houd er rekening mee dat de ondersteuning van Telegram door vrijwilligers wordt gedaan. We doen ons best om zo snel mogelijk te antwoorden, maar het kan even even duren.<![CDATA[<br><br>]]>Bekijk ook de <![CDATA[<a href="http://telegram.org/faq#general">veelgestelde vragen</a>]]>: hier staan de antwoorden op de meeste vragen en belangrijke tips voor <![CDATA[<a href="http://telegram.org/faq#troubleshooting">het oplossen van problemen</a>]]>.</string>
<string name="AskButton">Vraag een vrijwilliger</string>
<string name="TelegramFaq">Telegram veelgestelde vragen (FAQ)</string>
<string name="TelegramFaq">Veelgestelde vragen</string>
<string name="TelegramFaqUrl">https://telegram.org/faq</string>
<string name="DeleteLocalization">Verwijder vertaling?</string>
<string name="IncorrectLocalization">Ongeldig vertalingsbestand</string>
<string name="Enabled">Inschakelen</string>
<string name="Disabled">Uitschakelen</string>
<string name="NotificationsService">Meldingen service</string>
<string name="NotificationsServiceDisableInfo">Als Google Play services genoeg is om notificaties te ontvang, kan de meldingen service worden uitgeschakeld. Echter, we adviseren de service ingeschakeld te laten zodat de app in de achtergrond blijft draaien en meldingen direct worden ontvangen.</string>
<string name="NotificationsService">Meldingenservice</string>
<string name="NotificationsServiceDisableInfo">Als google play services genoeg is om notificaties te ontvangen, kan de meldingenservice worden uitgeschakeld. Echter, we adviseren de service ingeschakeld te laten zodat de app in de achtergrond blijft draaien en meldingen direct worden ontvangen.</string>
<string name="SortBy">Sorteren op</string>
<string name="ImportContacts">Importeer contacten</string>
<string name="WiFiOnly">alleen via WIFI</string>
<string name="WiFiOnly">Alleen via WiFi</string>
<string name="SortFirstName">Voornaam</string>
<string name="SortLastName">Achternaam</string>
@ -292,8 +292,8 @@
<string name="SaveToGallery">Opslaan in galerij</string>
<string name="Of">%1$d van %2$d</string>
<string name="Gallery">Galerij</string>
<string name="AllPhotos">All Photos</string>
<string name="NoPhotos">No photos yet</string>
<string name="AllPhotos">Alle foto\'s</string>
<string name="NoPhotos">Nog geen foto\'s</string>
<!--button titles-->
<string name="Next">Volgende</string>
@ -324,24 +324,24 @@
<string name="ActionChangedPhoto">un1 heeft de groepsafbeelding gewijzigd</string>
<string name="ActionChangedTitle">un1 heeft de groepsnaam gewijzigd naar un2</string>
<string name="ActionCreateGroup">un1 heeft de groep gemaakt</string>
<string name="ActionYouKickUser">U hebt un2 verwijderd</string>
<string name="ActionYouLeftUser">U hebt de groep verlaten</string>
<string name="ActionYouAddUser">U hebt un2 toegevoegd</string>
<string name="ActionYouRemovedPhoto">U hebt de groepsafbeelding verwijderd</string>
<string name="ActionYouChangedPhoto">U hebt de groepsafbeelding gewijzigd</string>
<string name="ActionYouChangedTitle">U hebt de groepsnaam gewijzigd naar un2</string>
<string name="ActionYouCreateGroup">U hebt de groep gemaakt</string>
<string name="ActionKickUserYou">un1 heeft u verwijderd</string>
<string name="ActionAddUserYou">un1 heeft u toegevoegd</string>
<string name="UnsuppotedMedia">Dit bericht wordt niet ondersteund door uw versie van Telegram. Werk Telegram bij om dit bericht te bekijken: http://telegram.org/update</string>
<string name="ActionYouKickUser">Je hebt un2 verwijderd</string>
<string name="ActionYouLeftUser">Je hebt de groep verlaten</string>
<string name="ActionYouAddUser">Je hebt un2 toegevoegd</string>
<string name="ActionYouRemovedPhoto">Je hebt de groepsafbeelding verwijderd</string>
<string name="ActionYouChangedPhoto">Je hebt de groepsafbeelding gewijzigd</string>
<string name="ActionYouChangedTitle">Je hebt de groepsnaam gewijzigd naar un2</string>
<string name="ActionYouCreateGroup">Je hebt de groep gemaakt</string>
<string name="ActionKickUserYou">un1 heeft je verwijderd</string>
<string name="ActionAddUserYou">un1 heeft je toegevoegd</string>
<string name="UnsuppotedMedia">Dit bericht wordt niet ondersteund door jouw versie van Telegram. Werk Telegram bij om dit bericht te bekijken: http://telegram.org/update</string>
<string name="AttachPhoto">Foto</string>
<string name="AttachVideo">Video</string>
<string name="AttachLocation">Locatie</string>
<string name="AttachContact">Contact</string>
<string name="AttachDocument">Document</string>
<string name="AttachAudio">Geluidsbestand</string>
<string name="FromYou">U</string>
<string name="ActionTakeScreenshootYou">U heeft een schermafbeelding gemaakt!</string>
<string name="FromYou">Jij</string>
<string name="ActionTakeScreenshootYou">Je hebt een schermafbeelding gemaakt!</string>
<string name="ActionTakeScreenshoot">un1 maakte een schermafbeeling!</string>
<!--Alert messages-->
@ -352,10 +352,10 @@
<string name="InvalidFirstName">Ongeldige voornaam</string>
<string name="InvalidLastName">Ongeldige achternaam</string>
<string name="Loading">Bezig met laden…</string>
<string name="NoPlayerInstalled">U hebt geen mediaspeler. Installeer een mediaspeler om door te gaan.</string>
<string name="NoHandleAppInstalled">U hebt geen applicaties die het MIME-type \'%1$s\' ondersteunen. Installeer een geschikte applicatie om door te gaan.</string>
<string name="InviteUser">Deze gebruiker heeft nog geen Telegram. Wilt u een uitnodiging sturen?</string>
<string name="AreYouSure">Weet u het zeker?</string>
<string name="NoPlayerInstalled">Je hebt geen mediaspeler. Installeer een mediaspeler om door te gaan.</string>
<string name="NoHandleAppInstalled">Je hebt geen applicaties die het MIME-type \'%1$s\' ondersteunen. Installeer een geschikte applicatie om door te gaan.</string>
<string name="InviteUser">Deze gebruiker heeft nog geen Telegram. Wil je een uitnodiging sturen?</string>
<string name="AreYouSure">Weet je het zeker?</string>
<string name="AddContactQ">Contact toevoegen?</string>
<string name="AddToTheGroup">%1$s toevoegen aan de groep?</string>
<string name="ForwardMessagesTo">Berichten doorsturen naar %1$s?</string>
@ -372,9 +372,9 @@
<string name="Page1Message">Welkom in het tijdperk van snel en veilig chatten</string>
<string name="Page2Message"><![CDATA[<b>Telegram</b>]]> bezorgt berichten sneller dan elke andere app</string>
<string name="Page3Message"><![CDATA[<b>Telegram</b>]]> is altijd gratis. Geen advertenties. Geen abonnementskosten</string>
<string name="Page4Message"><![CDATA[<b>Telegram</b>]]> beveiligt uw berichten tegen hackers</string>
<string name="Page5Message"><![CDATA[<b>Telegram</b>]]> heeft geen beperkingen op de grootte van uw media en gesprekken</string>
<string name="Page6Message"><![CDATA[<b>Telegram</b>]]> biedt toegang tot uw berichten vanaf meerdere apparaten</string>
<string name="Page4Message"><![CDATA[<b>Telegram</b>]]> beveiligt je berichten tegen hackers</string>
<string name="Page5Message"><![CDATA[<b>Telegram</b>]]> heeft geen beperkingen op de grootte van je media en gesprekken</string>
<string name="Page6Message"><![CDATA[<b>Telegram</b>]]> biedt toegang tot je berichten vanaf meerdere apparaten</string>
<string name="Page7Message"><![CDATA[<b>Telegram</b>]]> berichten zijn sterk versleuteld en kunnen zichzelf vernietigen</string>
<string name="StartMessaging">Begin nu met chatten</string>