1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-02 10:33:36 +00:00

Update to layer 18, usernames support, UI improvements

This commit is contained in:
DrKLO 2014-10-17 22:29:13 +04:00
parent 5bbfba2092
commit bc76df2f99
41 changed files with 793 additions and 131 deletions

View File

@ -80,7 +80,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 358
versionCode 359
versionName "1.9.5"
}
}

View File

@ -67,6 +67,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
private long updatesStartWaitTime = 0;
public ArrayList<TLRPC.Update> delayedEncryptedChatUpdates = new ArrayList<TLRPC.Update>();
private boolean startingSecretChat = false;
private ArrayList<Integer> loadingFullUsers = new ArrayList<Integer>();
private ArrayList<Integer> loadedFullUsers = new ArrayList<Integer>();
private boolean gettingNewDeleteTask = false;
private int currentDeletingTaskTime = 0;
@ -318,6 +320,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
delayedEncryptedChatUpdates.clear();
blockedUsers.clear();
sendingTypings.clear();
loadingFullUsers.clear();
loadedFullUsers.clear();
updatesStartWaitTime = 0;
currentDeletingTaskTime = 0;
@ -389,6 +393,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
users.put(user.id, user);
if (user.id == UserConfig.getClientUserId()) {
UserConfig.setCurrentUser(user);
UserConfig.saveConfig(true);
}
if (oldUser != null && user.status != null && oldUser.status != null && user.status.expires != oldUser.status.expires) {
return true;
@ -459,10 +464,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
public void cancelLoadFullUser(int uid) {
loadingFullUsers.remove((Integer) uid);
}
public void loadFullUser(final TLRPC.User user, final int classGuid) {
if (user == null) {
if (user == null || loadingFullUsers.contains(user.id) || loadedFullUsers.contains(user.id)) {
return;
}
loadingFullUsers.add(user.id);
TLRPC.TL_users_getFullUser req = new TLRPC.TL_users_getFullUser();
req.id = getInputUser(user);
long reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@ -472,10 +482,24 @@ public class MessagesController implements NotificationCenter.NotificationCenter
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
loadingFullUsers.remove((Integer)user.id);
loadedFullUsers.add(user.id);
String names = user.first_name + user.last_name + user.username;
TLRPC.TL_userFull userFull = (TLRPC.TL_userFull)response;
ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
users.add(userFull.user);
putUsers(users, false);
MessagesStorage.getInstance().putUsersAndChats(users, null, false, true);
if (!names.equals(userFull.user.first_name + userFull.user.last_name + userFull.user.username)) {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, UPDATE_MASK_NAME);
}
}
});
} else {
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
loadingFullUsers.remove((Integer)user.id);
}
});
}
@ -3153,6 +3177,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newChat.user_id = exist.user_id;
newChat.auth_key = exist.auth_key;
newChat.ttl = exist.ttl;
newChat.seq_in = exist.seq_in;
newChat.seq_out = exist.seq_out;
putEncryptedChat(newChat, false);
}
MessagesStorage.getInstance().updateEncryptedChat(newChat);
@ -3189,6 +3215,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
});
} else if (update instanceof TLRPC.TL_updateNotifySettings) {
updatesOnMainThread.add(update);
} else if (update instanceof TLRPC.TL_updateServiceNotification) {
//TODO
}
}
if (!messages.isEmpty()) {
@ -3257,9 +3285,11 @@ public class MessagesController implements NotificationCenter.NotificationCenter
if (currentUser != null) {
currentUser.first_name = update.first_name;
currentUser.last_name = update.last_name;
currentUser.username = update.username;
}
toDbUser.first_name = update.first_name;
toDbUser.last_name = update.last_name;
toDbUser.username = update.username;
dbUsers.add(toDbUser);
} else if (update instanceof TLRPC.TL_updateUserPhoto) {
if (currentUser != null) {
@ -3786,6 +3816,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
}
}
});
} else if (serviceMessage.action instanceof TLRPC.TL_decryptedMessageActionResend) {
} else {
return null;
}
@ -3832,12 +3864,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
long fingerprint = Utilities.bytesToLong(authKeyId);
if (encryptedChat.key_fingerprint == fingerprint) {
encryptedChat.auth_key = authKey;
encryptedChat.seq_in = 0;
encryptedChat.seq_out = 1;
MessagesStorage.getInstance().updateEncryptedChat(encryptedChat);
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
putEncryptedChat(encryptedChat, false);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.encryptedChatUpdated, encryptedChat);
SendMessagesHelper.getInstance().sendNotifyLayerMessage(encryptedChat);
}
});
} else {
@ -3845,6 +3880,8 @@ public class MessagesController implements NotificationCenter.NotificationCenter
newChat.id = encryptedChat.id;
newChat.user_id = encryptedChat.user_id;
newChat.auth_key = encryptedChat.auth_key;
newChat.seq_in = encryptedChat.seq_in;
newChat.seq_out = encryptedChat.seq_out;
MessagesStorage.getInstance().updateEncryptedChat(newChat);
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
@ -3952,12 +3989,15 @@ public class MessagesController implements NotificationCenter.NotificationCenter
final TLRPC.EncryptedChat newChat = (TLRPC.EncryptedChat) response;
newChat.auth_key = encryptedChat.auth_key;
newChat.user_id = encryptedChat.user_id;
newChat.seq_in = encryptedChat.seq_in;
newChat.seq_out = encryptedChat.seq_out;
MessagesStorage.getInstance().updateEncryptedChat(newChat);
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
putEncryptedChat(newChat, false);
NotificationCenter.getInstance().postNotificationName(NotificationCenter.encryptedChatUpdated, newChat);
SendMessagesHelper.getInstance().sendNotifyLayerMessage(newChat);
}
});
}

View File

@ -109,6 +109,7 @@ public class MessagesStorage {
database.executeFast("CREATE TABLE blocked_users(uid INTEGER PRIMARY KEY)").stepThis().dispose();
database.executeFast("CREATE TABLE download_queue(uid INTEGER, type INTEGER, date INTEGER, data BLOB, PRIMARY KEY (uid, type));").stepThis().dispose();
database.executeFast("CREATE TABLE dialog_settings(did INTEGER PRIMARY KEY, flags INTEGER);").stepThis().dispose();
database.executeFast("CREATE TABLE messages_seq(mid INTEGER PRIMARY KEY, seq_in INTEGER, seq_out INTEGER);").stepThis().dispose();
//database.executeFast("CREATE TABLE attach_data(uid INTEGER, id INTEGER, data BLOB, PRIMARY KEY (uid, id))").stepThis().dispose();
database.executeFast("CREATE TABLE user_contacts_v6(uid INTEGER PRIMARY KEY, fname TEXT, sname TEXT)").stepThis().dispose();
@ -290,6 +291,7 @@ public class MessagesStorage {
version = 6;
}
if (version == 6 && version < 7) {
database.executeFast("CREATE TABLE IF NOT EXISTS messages_seq(mid INTEGER PRIMARY KEY, seq_in INTEGER, seq_out INTEGER);").stepThis().dispose();
database.executeFast("ALTER TABLE enc_chats ADD COLUMN layer INTEGER default 0").stepThis().dispose();
database.executeFast("ALTER TABLE enc_chats ADD COLUMN seq_in INTEGER default 0").stepThis().dispose();
database.executeFast("ALTER TABLE enc_chats ADD COLUMN seq_out INTEGER default 0").stepThis().dispose();
@ -2956,6 +2958,7 @@ public class MessagesStorage {
if (updateUser.first_name != null && updateUser.last_name != null) {
user.first_name = updateUser.first_name;
user.last_name = updateUser.last_name;
user.username = updateUser.username;
} else if (updateUser.photo != null) {
user.photo = updateUser.photo;
}

View File

@ -833,7 +833,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
object = invoke;
}
TLRPC.invokeWithLayer17 invoke = new TLRPC.invokeWithLayer17();
TLRPC.invokeWithLayer18 invoke = new TLRPC.invokeWithLayer18();
invoke.query = object;
FileLog.d("wrap in layer", "" + object);
return invoke;
@ -1386,7 +1386,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (rawRequest != null && (rawRequest instanceof TLRPC.TL_messages_sendMessage ||
rawRequest instanceof TLRPC.TL_messages_sendMedia ||
rawRequest instanceof TLRPC.TL_messages_forwardMessages ||
rawRequest instanceof TLRPC.TL_messages_sendEncrypted)) {
rawRequest instanceof TLRPC.TL_messages_sendEncrypted ||
rawRequest instanceof TLRPC.TL_messages_sendEncryptedFile ||
rawRequest instanceof TLRPC.TL_messages_sendEncryptedService)) {
if (rawRequest instanceof TLRPC.TL_messages_sendMessage) {
hasSendMessage = true;
@ -1404,7 +1406,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (currentRawRequest instanceof TLRPC.TL_messages_sendMessage ||
currentRawRequest instanceof TLRPC.TL_messages_sendMedia ||
currentRawRequest instanceof TLRPC.TL_messages_forwardMessages ||
currentRawRequest instanceof TLRPC.TL_messages_sendEncrypted) {
currentRawRequest instanceof TLRPC.TL_messages_sendEncrypted ||
currentRawRequest instanceof TLRPC.TL_messages_sendEncryptedFile ||
currentRawRequest instanceof TLRPC.TL_messages_sendEncryptedService) {
currentRequests.add(currentMessage.msg_id);
}
}
@ -1414,7 +1418,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (request.rawRequest instanceof TLRPC.TL_messages_sendMessage ||
request.rawRequest instanceof TLRPC.TL_messages_sendMedia ||
request.rawRequest instanceof TLRPC.TL_messages_forwardMessages ||
request.rawRequest instanceof TLRPC.TL_messages_sendEncrypted) {
request.rawRequest instanceof TLRPC.TL_messages_sendEncrypted ||
request.rawRequest instanceof TLRPC.TL_messages_sendEncryptedFile ||
request.rawRequest instanceof TLRPC.TL_messages_sendEncryptedService) {
if (!currentRequests.contains(request.runningMessageId)) {
maxRequestId = Math.max(maxRequestId, request.runningMessageId);
}
@ -1608,12 +1614,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
TLRPC.TL_protoMessage message = networkMessage.protoMessage;
if (BuildVars.DEBUG_VERSION) {
if (message.body instanceof TLRPC.invokeWithLayer17) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer17)message.body).query);
if (message.body instanceof TLRPC.invokeWithLayer18) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer18)message.body).query);
} else if (message.body instanceof TLRPC.initConnection) {
TLRPC.initConnection r = (TLRPC.initConnection)message.body;
if (r.query instanceof TLRPC.invokeWithLayer17) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer17)r.query).query);
if (r.query instanceof TLRPC.invokeWithLayer18) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer18)r.query).query);
} else {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + r.query);
}
@ -1648,12 +1654,12 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
TLRPC.TL_protoMessage message = networkMessage.protoMessage;
containerMessages.add(message);
if (BuildVars.DEBUG_VERSION) {
if (message.body instanceof TLRPC.invokeWithLayer17) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer17)message.body).query);
if (message.body instanceof TLRPC.invokeWithLayer18) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer18)message.body).query);
} else if (message.body instanceof TLRPC.initConnection) {
TLRPC.initConnection r = (TLRPC.initConnection)message.body;
if (r.query instanceof TLRPC.invokeWithLayer17) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer17)r.query).query);
if (r.query instanceof TLRPC.invokeWithLayer18) {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + ((TLRPC.invokeWithLayer18)r.query).query);
} else {
FileLog.d("tmessages", connection.getSissionId() + ":DC" + datacenter.datacenterId + "> Send message (" + message.seqno + ", " + message.msg_id + "): " + r.query);
}
@ -2070,12 +2076,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
int errorCode = ((TLRPC.RpcError) resultContainer.result).error_code;
if (errorCode == 500 || errorCode < 0) {
if ((request.flags & RPCRequest.RPCRequestClassFailOnServerErrors) != 0) {
if (request.serverFailureCount < 1) {
discardResponse = true;
request.runningMinStartTime = request.runningStartTime + 1;
}
} else {
if ((request.flags & RPCRequest.RPCRequestClassFailOnServerErrors) == 0) {
discardResponse = true;
int delay = Math.min(1, request.serverFailureCount * 2);
request.runningMinStartTime = request.runningStartTime + delay;

View File

@ -176,7 +176,7 @@ public class FileLoader {
}
if (small) {
currentUploadSmallOperationsCount--;
if (currentUploadSmallOperationsCount < 2) {
if (currentUploadSmallOperationsCount < 1) {
FileUploadOperation operation = uploadSmallOperationQueue.poll();
if (operation != null) {
currentUploadSmallOperationsCount++;
@ -185,7 +185,7 @@ public class FileLoader {
}
} else {
currentUploadOperationsCount--;
if (currentUploadOperationsCount < 2) {
if (currentUploadOperationsCount < 1) {
FileUploadOperation operation = uploadOperationQueue.poll();
if (operation != null) {
currentUploadOperationsCount++;
@ -227,7 +227,7 @@ public class FileLoader {
});
if (small) {
currentUploadSmallOperationsCount--;
if (currentUploadSmallOperationsCount < 2) {
if (currentUploadSmallOperationsCount < 1) {
FileUploadOperation operation = uploadSmallOperationQueue.poll();
if (operation != null) {
currentUploadSmallOperationsCount++;
@ -236,7 +236,7 @@ public class FileLoader {
}
} else {
currentUploadOperationsCount--;
if (currentUploadOperationsCount < 2) {
if (currentUploadOperationsCount < 1) {
FileUploadOperation operation = uploadOperationQueue.poll();
if (operation != null) {
currentUploadOperationsCount++;
@ -259,14 +259,14 @@ public class FileLoader {
}
};
if (small) {
if (currentUploadSmallOperationsCount < 2) {
if (currentUploadSmallOperationsCount < 1) {
currentUploadSmallOperationsCount++;
operation.start();
} else {
uploadSmallOperationQueue.add(operation);
}
} else {
if (currentUploadOperationsCount < 2) {
if (currentUploadOperationsCount < 1) {
currentUploadOperationsCount++;
operation.start();
} else {

View File

@ -198,6 +198,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_updateReadMessages.constructor, TLRPC.TL_updateReadMessages.class);
classStore.put(TLRPC.TL_updateChatParticipantDelete.constructor, TLRPC.TL_updateChatParticipantDelete.class);
classStore.put(TLRPC.TL_updateRestoreMessages.constructor, TLRPC.TL_updateRestoreMessages.class);
classStore.put(TLRPC.TL_updateServiceNotification.constructor, TLRPC.TL_updateServiceNotification.class);
classStore.put(TLRPC.TL_updateNotifySettings.constructor, TLRPC.TL_updateNotifySettings.class);
classStore.put(TLRPC.TL_updateUserTyping.constructor, TLRPC.TL_updateUserTyping.class);
classStore.put(TLRPC.TL_updateChatUserTyping.constructor, TLRPC.TL_updateChatUserTyping.class);
@ -226,6 +227,7 @@ public class TLClassStore {
classStore.put(TLRPC.TL_inputEncryptedFileEmpty.constructor, TLRPC.TL_inputEncryptedFileEmpty.class);
classStore.put(TLRPC.TL_inputEncryptedFileUploaded.constructor, TLRPC.TL_inputEncryptedFileUploaded.class);
classStore.put(TLRPC.TL_decryptedMessageActionFlushHistory.constructor, TLRPC.TL_decryptedMessageActionFlushHistory.class);
classStore.put(TLRPC.TL_decryptedMessageActionResend.constructor, TLRPC.TL_decryptedMessageActionResend.class);
classStore.put(TLRPC.TL_decryptedMessageActionNotifyLayer.constructor, TLRPC.TL_decryptedMessageActionNotifyLayer.class);
classStore.put(TLRPC.TL_decryptedMessageActionSetMessageTTL.constructor, TLRPC.TL_decryptedMessageActionSetMessageTTL.class);
classStore.put(TLRPC.TL_decryptedMessageActionDeleteMessages.constructor, TLRPC.TL_decryptedMessageActionDeleteMessages.class);
@ -363,6 +365,11 @@ public class TLClassStore {
classStore.put(TLRPC.TL_decryptedMessageService_old.constructor, TLRPC.TL_decryptedMessageService_old.class);
classStore.put(TLRPC.TL_decryptedMessage_old.constructor, TLRPC.TL_decryptedMessage_old.class);
classStore.put(TLRPC.TL_message_secret.constructor, TLRPC.TL_message_secret.class);
classStore.put(TLRPC.TL_userSelf_old.constructor, TLRPC.TL_userSelf_old.class);
classStore.put(TLRPC.TL_userContact_old.constructor, TLRPC.TL_userContact_old.class);
classStore.put(TLRPC.TL_userRequest_old.constructor, TLRPC.TL_userRequest_old.class);
classStore.put(TLRPC.TL_userForeign_old.constructor, TLRPC.TL_userForeign_old.class);
classStore.put(TLRPC.TL_userDeleted_old.constructor, TLRPC.TL_userDeleted_old.class);
}
static TLClassStore store = null;

View File

@ -2084,13 +2084,14 @@ public class TLRPC {
}
public static class TL_userContact extends User {
public static int constructor = 0xf2fb8319;
public static int constructor = 0xcab35e18;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
access_hash = stream.readInt64();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
@ -2102,6 +2103,7 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
stream.writeInt64(access_hash);
stream.writeString(phone);
photo.serializeToStream(stream);
@ -2110,13 +2112,14 @@ public class TLRPC {
}
public static class TL_userRequest extends User {
public static int constructor = 0x22e8ceb0;
public static int constructor = 0xd9ccc4ef;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
access_hash = stream.readInt64();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
@ -2128,6 +2131,7 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
stream.writeInt64(access_hash);
stream.writeString(phone);
photo.serializeToStream(stream);
@ -2136,13 +2140,14 @@ public class TLRPC {
}
public static class TL_userForeign extends User {
public static int constructor = 0x5214c89d;
public static int constructor = 0x75cf7a8;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
access_hash = stream.readInt64();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
@ -2153,6 +2158,7 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
stream.writeInt64(access_hash);
photo.serializeToStream(stream);
status.serializeToStream(stream);
@ -2160,13 +2166,14 @@ public class TLRPC {
}
public static class TL_userDeleted extends User {
public static int constructor = 0xb29ad7cc;
public static int constructor = 0xd6016d7a;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
}
public void serializeToStream(AbsSerializedData stream) {
@ -2174,17 +2181,19 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
}
}
public static class TL_userSelf extends User {
public static int constructor = 0x720535ec;
public static int constructor = 0x7007b451;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
@ -2196,6 +2205,7 @@ public class TLRPC {
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
stream.writeString(phone);
photo.serializeToStream(stream);
status.serializeToStream(stream);
@ -3425,11 +3435,15 @@ public class TLRPC {
public ArrayList<Integer> messages = new ArrayList<Integer>();
public int pts;
public int version;
public String type;
public MessageMedia media;
public boolean popup;
public NotifyPeer peer;
public PeerNotifySettings notify_settings;
public SendMessageAction action;
public String first_name;
public String last_name;
public String username;
public int qts;
public int id;
public long random_id;
@ -3550,6 +3564,27 @@ public class TLRPC {
}
}
public static class TL_updateServiceNotification extends Update {
public static int constructor = 0x382dd3e4;
public String message;
public void readParams(AbsSerializedData stream) {
type = stream.readString();
message = stream.readString();
media = (MessageMedia)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
popup = stream.readBool();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(type);
stream.writeString(message);
media.serializeToStream(stream);
stream.writeBool(popup);
}
}
public static class TL_updateNotifySettings extends Update {
public static int constructor = 0xbec268ef;
@ -3601,13 +3636,14 @@ public class TLRPC {
}
public static class TL_updateUserName extends Update {
public static int constructor = 0xda22d9ad;
public static int constructor = 0xa7332b73;
public void readParams(AbsSerializedData stream) {
user_id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
username = stream.readString();
}
public void serializeToStream(AbsSerializedData stream) {
@ -3615,6 +3651,7 @@ public class TLRPC {
stream.writeInt32(user_id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(username);
}
}
@ -4037,6 +4074,8 @@ public class TLRPC {
}
public static class DecryptedMessageAction extends TLObject {
public int start_seq_no;
public int end_seq_no;
public int layer;
public int ttl_seconds;
public ArrayList<Long> random_ids = new ArrayList<Long>();
@ -4064,6 +4103,22 @@ public class TLRPC {
}
}
public static class TL_decryptedMessageActionResend extends DecryptedMessageAction {
public static int constructor = 0x511110b0;
public void readParams(AbsSerializedData stream) {
start_seq_no = stream.readInt32();
end_seq_no = stream.readInt32();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(start_seq_no);
stream.writeInt32(end_seq_no);
}
}
public static class TL_decryptedMessageActionNotifyLayer extends DecryptedMessageAction {
public static int constructor = 0xf3048883;
@ -4572,6 +4627,44 @@ public class TLRPC {
}
}
public static class TL_account_checkUsername extends TLObject {
public static int constructor = 0x2714d86c;
public String username;
public Class responseClass () {
return Bool.class;
}
public void readParams(AbsSerializedData stream) {
username = stream.readString();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(username);
}
}
public static class TL_account_updateUsername extends TLObject {
public static int constructor = 0x3e0bdd7c;
public String username;
public Class responseClass () {
return User.class;
}
public void readParams(AbsSerializedData stream) {
username = stream.readString();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeString(username);
}
}
public static class InputAudio extends TLObject {
public long id;
public long access_hash;
@ -8363,6 +8456,126 @@ public class TLRPC {
//manually created
public static class TL_userDeleted_old extends TL_userDeleted {
public static int constructor = 0xb29ad7cc;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
}
}
public static class TL_userForeign_old extends TL_userForeign {
public static int constructor = 0x5214c89d;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
access_hash = stream.readInt64();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeInt64(access_hash);
photo.serializeToStream(stream);
status.serializeToStream(stream);
}
}
public static class TL_userRequest_old extends TL_userRequest {
public static int constructor = 0x22e8ceb0;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
access_hash = stream.readInt64();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeInt64(access_hash);
stream.writeString(phone);
photo.serializeToStream(stream);
status.serializeToStream(stream);
}
}
public static class TL_userContact_old extends TL_userContact {
public static int constructor = 0xf2fb8319;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
access_hash = stream.readInt64();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeInt64(access_hash);
stream.writeString(phone);
photo.serializeToStream(stream);
status.serializeToStream(stream);
}
}
public static class TL_userSelf_old extends TL_userSelf {
public static int constructor = 0x720535ec;
public void readParams(AbsSerializedData stream) {
id = stream.readInt32();
first_name = stream.readString();
last_name = stream.readString();
phone = stream.readString();
photo = (UserProfilePhoto)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
status = (UserStatus)TLClassStore.Instance().TLdeserialize(stream, stream.readInt32());
inactive = stream.readBool();
}
public void serializeToStream(AbsSerializedData stream) {
stream.writeInt32(constructor);
stream.writeInt32(id);
stream.writeString(first_name);
stream.writeString(last_name);
stream.writeString(phone);
photo.serializeToStream(stream);
status.serializeToStream(stream);
stream.writeBool(inactive);
}
}
public static class TL_set_client_DH_params extends TLObject {
public static int constructor = 0xf5045f1f;
@ -9129,6 +9342,7 @@ public class TLRPC {
public int id;
public String first_name;
public String last_name;
public String username;
public long access_hash;
public String phone;
public UserProfilePhoto photo;
@ -9629,8 +9843,8 @@ public class TLRPC {
}
}
public static class invokeWithLayer17 extends TLObject {
public static int constructor = 0x50858a19;
public static class invokeWithLayer18 extends TLObject {
public static int constructor = 0x1c900537;
public TLObject query;

View File

@ -9,10 +9,17 @@
package org.telegram.ui.Adapters;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import org.telegram.android.AndroidUtilities;
import org.telegram.android.LocaleController;
import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.R;
import org.telegram.messenger.RPCRequest;
import org.telegram.messenger.TLObject;
import org.telegram.messenger.TLRPC;
import org.telegram.android.ContactsController;
import org.telegram.messenger.FileLog;
@ -32,6 +39,9 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
private ArrayList<TLRPC.User> searchResult;
private ArrayList<CharSequence> searchResultNames;
private Timer searchTimer;
private ArrayList<TLRPC.User> globalSearch;
private long reqId = 0;
private int lastReqId;
public ContactsActivitySearchAdapter(Context context, HashMap<Integer, TLRPC.User> arg1) {
mContext = context;
@ -42,6 +52,8 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
if (query == null) {
searchResult = null;
searchResultNames = null;
globalSearch = null;
queryServerSearch(null);
notifyDataSetChanged();
} else {
try {
@ -63,14 +75,50 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
}
processSearch(query);
}
}, 100, 300);
}, 200, 300);
}
}
private void queryServerSearch(String query) {
if (query == null || query.length() < 5) {
if (reqId != 0) {
ConnectionsManager.getInstance().cancelRpc(reqId, true);
reqId = 0;
}
globalSearch = null;
lastReqId = 0;
notifyDataSetChanged();
return;
}
TLRPC.TL_contacts_search req = new TLRPC.TL_contacts_search();
req.q = query;
req.limit = 50;
final int currentReqId = ++lastReqId;
reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
if (currentReqId == lastReqId) {
if (error == null) {
TLRPC.TL_contacts_found res = (TLRPC.TL_contacts_found) response;
globalSearch = res.users;
notifyDataSetChanged();
}
}
reqId = 0;
}
});
}
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
}
private void processSearch(final String query) {
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
queryServerSearch(query);
final ArrayList<TLRPC.TL_contact> contactsCopy = new ArrayList<TLRPC.TL_contact>();
contactsCopy.addAll(ContactsController.getInstance().contacts);
Utilities.searchQueue.postRunnable(new Runnable() {
@ -117,28 +165,43 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
@Override
public boolean areAllItemsEnabled() {
return true;
return false;
}
@Override
public boolean isEnabled(int i) {
return true;
return i != (searchResult == null ? 0 : searchResult.size());
}
@Override
public int getCount() {
if (searchResult == null) {
return 0;
int count = searchResult == null ? 0 : searchResult.size();
int globalCount = globalSearch == null ? 0 : globalSearch.size();
if (globalCount != 0) {
count += globalCount + 1;
}
return searchResult.size();
return count;
}
public boolean isGlobalSearch(int i) {
int localCount = searchResult == null ? 0 : searchResult.size();
int globalCount = globalSearch == null ? 0 : globalSearch.size();
if (i >= 0 && i < localCount) {
return false;
} else if (i > localCount && i <= globalCount + localCount) {
return true;
}
return false;
}
@Override
public TLRPC.User getItem(int i) {
if (searchResult != null) {
if (i >= 0 && i < searchResult.size()) {
return searchResult.get(i);
}
int localCount = searchResult == null ? 0 : searchResult.size();
int globalCount = globalSearch == null ? 0 : globalSearch.size();
if (i >= 0 && i < localCount) {
return searchResult.get(i);
} else if (i > localCount && i <= globalCount + localCount) {
return globalSearch.get(i - localCount - 1);
}
return null;
}
@ -155,24 +218,30 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
@Override
public View getView(int i, View view, ViewGroup viewGroup) {
if (view == null) {
view = new ChatOrUserCell(mContext);
((ChatOrUserCell)view).usePadding = false;
}
if (i == (searchResult == null ? 0 : searchResult.size())) {
if (view == null) {
LayoutInflater li = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
view = li.inflate(R.layout.settings_section_layout, viewGroup, false);
TextView textView = (TextView)view.findViewById(R.id.settings_section_text);
textView.setText(LocaleController.getString("GlobalSearch", R.string.GlobalSearch));
}
} else {
if (view == null) {
view = new ChatOrUserCell(mContext);
((ChatOrUserCell) view).usePadding = false;
}
((ChatOrUserCell) view).useSeparator = i != searchResult.size() - 1;
((ChatOrUserCell) view).useSeparator = (i != getCount() - 1 && i != searchResult.size() - 1);
TLRPC.User user = getItem(i);
if (user != null) {
((ChatOrUserCell) view).setData(user, null, null, i < searchResult.size() ? searchResultNames.get(i) : null, i > searchResult.size() ? "@" + user.username : null);
Object obj = searchResult.get(i);
TLRPC.User user = MessagesController.getInstance().getUser(((TLRPC.User)obj).id);
if (user != null) {
((ChatOrUserCell)view).setData(user, null, null, searchResultNames.get(i), null);
if (ignoreUsers != null) {
if (ignoreUsers.containsKey(user.id)) {
((ChatOrUserCell)view).drawAlpha = 0.5f;
} else {
((ChatOrUserCell)view).drawAlpha = 1.0f;
if (ignoreUsers != null) {
if (ignoreUsers.containsKey(user.id)) {
((ChatOrUserCell) view).drawAlpha = 0.5f;
} else {
((ChatOrUserCell) view).drawAlpha = 1.0f;
}
}
}
}
@ -181,16 +250,19 @@ public class ContactsActivitySearchAdapter extends BaseFragmentAdapter {
@Override
public int getItemViewType(int i) {
if (i == (searchResult == null ? 0 : searchResult.size())) {
return 1;
}
return 0;
}
@Override
public int getViewTypeCount() {
return 1;
return 2;
}
@Override
public boolean isEmpty() {
return searchResult == null || searchResult.size() == 0;
return (searchResult == null || searchResult.size() == 0) && (globalSearch == null || globalSearch.isEmpty());
}
}

View File

@ -36,6 +36,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
private static TextPaint timePaint;
private ImageReceiver avatarImage;
private boolean needAvatarImage = false;
private SeekBar seekBar;
private ProgressView progressView;
private int seekBarX;
@ -117,7 +118,7 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
buttonPressed = true;
invalidate();
result = true;
} else if (avatarImage.isInsideImage(x, y)) {
} else if (needAvatarImage && avatarImage.isInsideImage(x, y)) {
avatarPressed = true;
result = true;
}
@ -317,11 +318,19 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
timeX = AndroidUtilities.dp(80);
}
}
avatarImage.setImageCoords(x, AndroidUtilities.dp(9), AndroidUtilities.dp(50), AndroidUtilities.dp(50));
int diff = 0;
if (needAvatarImage) {
avatarImage.setImageCoords(x, AndroidUtilities.dp(9), AndroidUtilities.dp(50), AndroidUtilities.dp(50));
} else {
diff = AndroidUtilities.dp(56);
seekBarX -= diff;
buttonX -= diff;
timeX -= diff;
}
seekBar.width = backgroundWidth - AndroidUtilities.dp(112);
seekBar.width = backgroundWidth - AndroidUtilities.dp(112) + diff;
seekBar.height = AndroidUtilities.dp(30);
progressView.width = backgroundWidth - AndroidUtilities.dp(136);
progressView.width = backgroundWidth - AndroidUtilities.dp(136) + diff;
progressView.height = AndroidUtilities.dp(30);
seekBarY = AndroidUtilities.dp(13);
buttonY = AndroidUtilities.dp(10);
@ -348,14 +357,18 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
if (uid == 0) {
uid = messageObject.messageOwner.from_id;
}
needAvatarImage = !(messageObject.messageOwner.to_id != null && messageObject.messageOwner.to_id.chat_id != 0 && !messageObject.isOut() && messageObject.messageOwner.media.audio.user_id == messageObject.messageOwner.from_id);
audioUser = MessagesController.getInstance().getUser(uid);
if (audioUser != null) {
if (audioUser.photo != null) {
currentPhoto = audioUser.photo.photo_small;
if (needAvatarImage) {
if (audioUser != null) {
if (audioUser.photo != null) {
currentPhoto = audioUser.photo.photo_small;
}
avatarImage.setImage(currentPhoto, "50_50", getResources().getDrawable(AndroidUtilities.getUserAvatarForId(uid)), false);
} else {
avatarImage.setImage(null, "50_50", getResources().getDrawable(AndroidUtilities.getUserAvatarForId(uid)), false);
}
avatarImage.setImage(currentPhoto, "50_50", getResources().getDrawable(AndroidUtilities.getUserAvatarForId(uid)), false);
} else {
avatarImage.setImage(null, "50_50", getResources().getDrawable(AndroidUtilities.getUserAvatarForId(uid)), false);
}
if (messageObject.isOut()) {
@ -379,7 +392,9 @@ public class ChatAudioCell extends ChatBaseCell implements SeekBar.SeekBarDelega
return;
}
avatarImage.draw(canvas, avatarImage.getImageX(), avatarImage.getImageY(), avatarImage.getImageHeight(), avatarImage.getImageHeight());
if (needAvatarImage) {
avatarImage.draw(canvas, avatarImage.getImageX(), avatarImage.getImageY(), avatarImage.getImageHeight(), avatarImage.getImageHeight());
}
canvas.save();
if (buttonState == 0 || buttonState == 1) {

View File

@ -10,7 +10,6 @@ package org.telegram.ui.Cells;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.text.Layout;
import android.text.StaticLayout;
@ -39,8 +38,8 @@ public class ChatContactCell extends ChatBaseCell {
private static TextPaint namePaint;
private static TextPaint phonePaint;
private static Drawable addContactDrawable;
private static Paint linePaint;
private static Drawable addContactDrawableIn;
private static Drawable addContactDrawableOut;
private ImageReceiver avatarImage;
@ -67,10 +66,8 @@ public class ChatContactCell extends ChatBaseCell {
phonePaint.setTextSize(AndroidUtilities.dp(15));
phonePaint.setColor(0xff000000);
addContactDrawable = getResources().getDrawable(R.drawable.ic_ab_add_member);
linePaint = new Paint();
linePaint.setStrokeWidth(AndroidUtilities.dp(1));
addContactDrawableIn = getResources().getDrawable(R.drawable.addcontact_blue);
addContactDrawableOut = getResources().getDrawable(R.drawable.addcontact_green);
}
avatarImage = new ImageReceiver(this);
}
@ -85,6 +82,12 @@ public class ChatContactCell extends ChatBaseCell {
return false;
}
int uid = currentMessageObject.messageOwner.media.user_id;
boolean newDrawAdd = contactUser != null && uid != UserConfig.getClientUserId() && ContactsController.getInstance().contactsDict.get(uid) == null;
if (newDrawAdd != drawAddButton) {
return true;
}
contactUser = MessagesController.getInstance().getUser(currentMessageObject.messageOwner.media.user_id);
TLRPC.FileLocation newPhoto = null;
@ -103,10 +106,10 @@ public class ChatContactCell extends ChatBaseCell {
boolean result = false;
int side = AndroidUtilities.dp(36);
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (x >= avatarImage.getImageX() && x <= avatarImage.getImageX() + namesWidth && y >= avatarImage.getImageY() && y <= avatarImage.getImageY() + avatarImage.getImageHeight()) {
if (x >= avatarImage.getImageX() && x <= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(42) && y >= avatarImage.getImageY() && y <= avatarImage.getImageY() + avatarImage.getImageHeight()) {
avatarPressed = true;
result = true;
} else if (x >= avatarImage.getImageX() - AndroidUtilities.dp(44) && y >= AndroidUtilities.dp(20) && x <= avatarImage.getImageX() - AndroidUtilities.dp(10) && y <= AndroidUtilities.dp(52)) {
} else if (x >= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(52) && y >= AndroidUtilities.dp(13) && x <= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(92) && y <= AndroidUtilities.dp(52)) {
buttonPressed = true;
result = true;
}
@ -133,7 +136,7 @@ public class ChatContactCell extends ChatBaseCell {
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
avatarPressed = false;
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
if (!avatarImage.isInsideImage(x, y)) {
if (!(x >= avatarImage.getImageX() && x <= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(42) && y >= avatarImage.getImageY() && y <= avatarImage.getImageY() + avatarImage.getImageHeight())) {
avatarPressed = false;
}
}
@ -147,7 +150,7 @@ public class ChatContactCell extends ChatBaseCell {
} else if (event.getAction() == MotionEvent.ACTION_CANCEL) {
buttonPressed = false;
} else if (event.getAction() == MotionEvent.ACTION_MOVE) {
if (!(x >= avatarImage.getImageX() - AndroidUtilities.dp(44) && y >= AndroidUtilities.dp(20) && x <= avatarImage.getImageX() - AndroidUtilities.dp(10) && y <= AndroidUtilities.dp(52))) {
if (!(x >= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(52) && y >= AndroidUtilities.dp(13) && x <= avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(92) && y <= AndroidUtilities.dp(52))) {
buttonPressed = false;
}
}
@ -175,7 +178,7 @@ public class ChatContactCell extends ChatBaseCell {
} else {
maxWidth = (int) (Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y) * 0.7f);
}
maxWidth -= AndroidUtilities.dp(58 + (drawAddButton ? 52 : 0));
maxWidth -= AndroidUtilities.dp(58 + (drawAddButton ? 42 : 0));
if (contactUser != null) {
if (contactUser.photo != null) {
@ -216,7 +219,7 @@ public class ChatContactCell extends ChatBaseCell {
}
namesWidth = Math.max(nameWidth, phoneWidth);
backgroundWidth = AndroidUtilities.dp(75 + (drawAddButton ? 52 : 0)) + namesWidth;
backgroundWidth = AndroidUtilities.dp(77 + (drawAddButton ? 42 : 0)) + namesWidth;
super.setMessageObject(messageObject);
}
@ -238,15 +241,15 @@ public class ChatContactCell extends ChatBaseCell {
int x;
if (currentMessageObject.isOut()) {
x = layoutWidth - backgroundWidth + AndroidUtilities.dp(6);
x = layoutWidth - backgroundWidth + AndroidUtilities.dp(8);
} else {
if (isChat) {
x = AndroidUtilities.dp(67);
x = AndroidUtilities.dp(69);
} else {
x = AndroidUtilities.dp(14);
x = AndroidUtilities.dp(16);
}
}
avatarImage.setImageCoords(x + (drawAddButton ? AndroidUtilities.dp(52) : 0), AndroidUtilities.dp(7), AndroidUtilities.dp(42), AndroidUtilities.dp(42));
avatarImage.setImageCoords(x, AndroidUtilities.dp(9), AndroidUtilities.dp(42), AndroidUtilities.dp(42));
}
@Override
@ -261,27 +264,26 @@ public class ChatContactCell extends ChatBaseCell {
if (nameLayout != null) {
canvas.save();
canvas.translate(avatarImage.getImageX() + avatarImage.getImageWidth() + AndroidUtilities.dp(9), AndroidUtilities.dp(8));
canvas.translate(avatarImage.getImageX() + avatarImage.getImageWidth() + AndroidUtilities.dp(9), AndroidUtilities.dp(10));
namePaint.setColor(AndroidUtilities.getColorForId(currentMessageObject.messageOwner.media.user_id));
nameLayout.draw(canvas);
canvas.restore();
}
if (phoneLayout != null) {
canvas.save();
canvas.translate(avatarImage.getImageX() + avatarImage.getImageWidth() + AndroidUtilities.dp(9), AndroidUtilities.dp(29));
canvas.translate(avatarImage.getImageX() + avatarImage.getImageWidth() + AndroidUtilities.dp(9), AndroidUtilities.dp(31));
phoneLayout.draw(canvas);
canvas.restore();
}
if (drawAddButton) {
Drawable addContactDrawable;
if (currentMessageObject.isOut()) {
linePaint.setColor(0x9670b15c);
addContactDrawable = addContactDrawableOut;
} else {
linePaint.setColor(0xffe8e8e8);
addContactDrawable = addContactDrawableIn;
}
canvas.drawLine(avatarImage.getImageX() - AndroidUtilities.dp(4), avatarImage.getImageY(), avatarImage.getImageX() - AndroidUtilities.dp(4), AndroidUtilities.dp(62), linePaint);
setDrawableBounds(addContactDrawable, avatarImage.getImageX() - AndroidUtilities.dp(44), AndroidUtilities.dp(20));
setDrawableBounds(addContactDrawable, avatarImage.getImageX() + namesWidth + AndroidUtilities.dp(78), AndroidUtilities.dp(13));
addContactDrawable.draw(canvas);
}
}

View File

@ -30,6 +30,7 @@ import android.widget.TextView;
import org.telegram.android.AndroidUtilities;
import org.telegram.android.LocaleController;
import org.telegram.android.MessagesStorage;
import org.telegram.messenger.TLObject;
import org.telegram.messenger.TLRPC;
import org.telegram.messenger.ConnectionsManager;
@ -221,6 +222,12 @@ public class ContactsActivity extends BaseFragment implements NotificationCenter
if (user == null || user.id == UserConfig.getClientUserId()) {
return;
}
if (searchListViewAdapter.isGlobalSearch(i)) {
ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
users.add(user);
MessagesController.getInstance().putUsers(users, false);
MessagesStorage.getInstance().putUsersAndChats(users, null, false, true);
}
if (returnAsResult) {
if (ignoreUsers != null && ignoreUsers.containsKey(user.id)) {
return;

View File

@ -73,6 +73,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
private int profileRow;
private int numberSectionRow;
private int numberRow;
private int usernameRow;
private int settingsSectionRow;
private int textSizeRow;
private int enableAnimationsRow;
@ -179,6 +180,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
profileRow = rowCount++;
numberSectionRow = rowCount++;
numberRow = rowCount++;
usernameRow = rowCount++;
settingsSectionRow = rowCount++;
enableAnimationsRow = rowCount++;
languageRow = rowCount++;
@ -208,12 +210,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
logoutRow = rowCount++;
versionRow = rowCount++;
MessagesController.getInstance().loadFullUser(UserConfig.getCurrentUser(), classGuid);
return true;
}
@Override
public void onFragmentDestroy() {
super.onFragmentDestroy();
MessagesController.getInstance().cancelLoadFullUser(UserConfig.getClientUserId());
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.updateInterfaces);
avatarUpdater.clear();
}
@ -477,6 +482,8 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
});
builder.setNegativeButton(LocaleController.getString("OK", R.string.OK), null);
showAlertDialog(builder);
} else if (i == usernameRow) {
presentFragment(new SettingsChangeUsernameActivity());
}
}
});
@ -709,7 +716,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
public boolean isEnabled(int i) {
return i == textSizeRow || i == enableAnimationsRow || i == blockedRow || i == notificationRow || i == backgroundRow ||
i == askQuestionRow || i == sendLogsRow || i == sendByEnterRow || i == terminateSessionsRow || i == wifiDownloadRow ||
i == mobileDownloadRow || i == clearLogsRow || i == roamingDownloadRow || i == languageRow ||
i == mobileDownloadRow || i == clearLogsRow || i == roamingDownloadRow || i == languageRow || i == usernameRow ||
i == switchBackendButtonRow || i == telegramFaqRow || i == contactsSortRow || i == contactsReimportRow || i == saveToGalleryRow;
}
@ -829,7 +836,7 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
}
TextView textView = (TextView)view.findViewById(R.id.settings_section_text);
if (i == numberSectionRow) {
textView.setText(LocaleController.getString("YourPhoneNumber", R.string.YourPhoneNumber));
textView.setText(LocaleController.getString("Info", R.string.Info));
} else if (i == settingsSectionRow) {
textView.setText(LocaleController.getString("SETTINGS", R.string.SETTINGS));
} else if (i == supportSectionRow) {
@ -848,15 +855,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.getCurrentUser();
if (user != null && user.phone != null && user.phone.length() != 0) {
textView.setText(PhoneFormat.getInstance().format("+" + user.phone));
} else {
textView.setText(LocaleController.getString("Unknown", R.string.Unknown));
}
divider.setVisibility(View.INVISIBLE);
} else if (i == notificationRow) {
if (i == notificationRow) {
textView.setText(LocaleController.getString("NotificationsAndSounds", R.string.NotificationsAndSounds));
divider.setVisibility(View.VISIBLE);
} else if (i == blockedRow) {
@ -966,7 +965,16 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
TextView textView = (TextView)view.findViewById(R.id.settings_row_text);
TextView detailTextView = (TextView)view.findViewById(R.id.settings_row_text_detail);
View divider = view.findViewById(R.id.settings_row_divider);
if (i == textSizeRow) {
if (i == numberRow) {
TLRPC.User user = UserConfig.getCurrentUser();
textView.setText(LocaleController.getString("Phone", R.string.Phone));
if (user != null && user.phone != null && user.phone.length() != 0) {
detailTextView.setText(PhoneFormat.getInstance().format("+" + user.phone));
} else {
detailTextView.setText(LocaleController.getString("Unknown", R.string.Unknown));
}
divider.setVisibility(View.VISIBLE);
} else if (i == textSizeRow) {
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
int size = preferences.getInt("fons_size", AndroidUtilities.isTablet() ? 18 : 16);
detailTextView.setText(String.format("%d", size));
@ -988,6 +996,15 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
} else if (sort == 2) {
detailTextView.setText(LocaleController.getString("LastName", R.string.SortLastName));
}
} else if (i == usernameRow) {
TLRPC.User user = UserConfig.getCurrentUser();
textView.setText(LocaleController.getString("Username", R.string.Username));
if (user != null && user.username != null && user.username.length() != 0) {
detailTextView.setText("@" + user.username);
} else {
detailTextView.setText("-");
}
divider.setVisibility(View.INVISIBLE);
}
} else if (type == 6) {
if (view == null) {
@ -1061,11 +1078,11 @@ public class SettingsActivity extends BaseFragment implements NotificationCenter
return 0;
} else if (i == numberSectionRow || i == settingsSectionRow || i == supportSectionRow || i == messagesSectionRow || i == mediaDownloadSection || i == contactsSectionRow) {
return 1;
} else if (i == textSizeRow || i == languageRow || i == contactsSortRow) {
} else if (i == textSizeRow || i == languageRow || i == contactsSortRow || i == numberRow || i == usernameRow) {
return 5;
} else if (i == enableAnimationsRow || i == sendByEnterRow || i == saveToGalleryRow) {
return 3;
} else if (i == numberRow || i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow || i == telegramFaqRow || i == contactsReimportRow) {
} else if (i == notificationRow || i == blockedRow || i == backgroundRow || i == askQuestionRow || i == sendLogsRow || i == terminateSessionsRow || i == clearLogsRow || i == switchBackendButtonRow || i == telegramFaqRow || i == contactsReimportRow) {
return 2;
} else if (i == logoutRow) {
return 4;

View File

@ -125,12 +125,13 @@ public class SettingsChangeNameActivity extends BaseFragment {
}
private void saveName() {
TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
if (UserConfig.getCurrentUser() == null || lastNameField.getText() == null || firstNameField.getText() == null) {
TLRPC.User currentUser = UserConfig.getCurrentUser();
if (currentUser == null || lastNameField.getText() == null || firstNameField.getText() == null) {
return;
}
UserConfig.getCurrentUser().first_name = req.first_name = firstNameField.getText().toString();
UserConfig.getCurrentUser().last_name = req.last_name = lastNameField.getText().toString();
TLRPC.TL_account_updateProfile req = new TLRPC.TL_account_updateProfile();
currentUser.first_name = req.first_name = firstNameField.getText().toString();
currentUser.last_name = req.last_name = lastNameField.getText().toString();
TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
if (user != null) {
user.first_name = req.first_name;

View File

@ -0,0 +1,216 @@
/*
* This is the source code of Telegram for Android v. 1.7.x.
* It is licensed under GNU GPL v. 2 or later.
* You should have received a copy of the license in this archive (see LICENSE).
*
* Copyright Nikolai Kudashov, 2013-2014.
*/
package org.telegram.ui;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.EditorInfo;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import org.telegram.android.AndroidUtilities;
import org.telegram.android.LocaleController;
import org.telegram.android.MessagesController;
import org.telegram.android.MessagesStorage;
import org.telegram.android.NotificationCenter;
import org.telegram.messenger.ConnectionsManager;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.R;
import org.telegram.messenger.RPCRequest;
import org.telegram.messenger.TLObject;
import org.telegram.messenger.TLRPC;
import org.telegram.messenger.UserConfig;
import org.telegram.ui.Views.ActionBar.BaseFragment;
import java.util.ArrayList;
public class SettingsChangeUsernameActivity extends BaseFragment {
private EditText firstNameField;
private View headerLabelView;
private View doneButton;
@Override
public View createView(LayoutInflater inflater, ViewGroup container) {
if (fragmentView == null) {
actionBarLayer.setCustomView(R.layout.settings_do_action_layout);
Button cancelButton = (Button)actionBarLayer.findViewById(R.id.cancel_button);
cancelButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
finishFragment();
}
});
doneButton = actionBarLayer.findViewById(R.id.done_button);
doneButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (firstNameField.getText().length() != 0) {
saveName();
}
}
});
cancelButton.setText(LocaleController.getString("Cancel", R.string.Cancel).toUpperCase());
TextView textView = (TextView)doneButton.findViewById(R.id.done_button_text);
textView.setText(LocaleController.getString("Done", R.string.Done).toUpperCase());
fragmentView = inflater.inflate(R.layout.chat_profile_change_name_layout, container, false);
TLRPC.User user = MessagesController.getInstance().getUser(UserConfig.getClientUserId());
if (user == null) {
user = UserConfig.getCurrentUser();
}
firstNameField = (EditText)fragmentView.findViewById(R.id.first_name_field);
firstNameField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == EditorInfo.IME_ACTION_DONE) {
doneButton.performClick();
return true;
}
return false;
}
});
if (user != null && user.username != null && user.username.length() > 0) {
firstNameField.setText(user.username);
firstNameField.setSelection(firstNameField.length());
}
TextView headerLabel = (TextView)fragmentView.findViewById(R.id.settings_section_text);
headerLabel.setText(LocaleController.getString("Username", R.string.Username).toUpperCase());
} else {
ViewGroup parent = (ViewGroup)fragmentView.getParent();
if (parent != null) {
parent.removeView(fragmentView);
}
}
return fragmentView;
}
@Override
public void onResume() {
super.onResume();
SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("mainconfig", Activity.MODE_PRIVATE);
boolean animations = preferences.getBoolean("view_animations", true);
if (!animations) {
firstNameField.requestFocus();
AndroidUtilities.showKeyboard(firstNameField);
}
}
private void showErrorAlert(String error) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
if (error.equals("USERNAME_INVALID")) {
builder.setMessage(LocaleController.getString("UsernameInvalid", R.string.UsernameInvalid));
} else if (error.equals("USERNAME_OCCUPIED")) {
builder.setMessage(LocaleController.getString("UsernameInUse", R.string.UsernameInUse));
} else {
builder.setMessage(error);
}
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), null);
showAlertDialog(builder);
}
private void saveName() {
TLRPC.User user = UserConfig.getCurrentUser();
if (getParentActivity() == null || user == null) {
return;
}
String currentName = user.username;
if (currentName == null) {
currentName = "";
}
String newName = firstNameField.getText().toString();
if (currentName.equals(newName)) {
finishFragment();
return;
}
if (newName.length() > 32 || newName.length() > 0 && newName.length() < 5) {
showErrorAlert("USERNAME_INVALID");
return;
}
final ProgressDialog progressDialog = new ProgressDialog(getParentActivity());
progressDialog.setMessage(LocaleController.getString("Loading", R.string.Loading));
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.setCancelable(false);
TLRPC.TL_account_updateUsername req = new TLRPC.TL_account_updateUsername();
req.username = newName;
NotificationCenter.getInstance().postNotificationName(NotificationCenter.updateInterfaces, MessagesController.UPDATE_MASK_NAME);
final long reqId = ConnectionsManager.getInstance().performRpc(req, new RPCRequest.RPCRequestDelegate() {
@Override
public void run(TLObject response, final TLRPC.TL_error error) {
if (error == null) {
final TLRPC.User user = (TLRPC.User)response;
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e("tmessages", e);
}
ArrayList<TLRPC.User> users = new ArrayList<TLRPC.User>();
users.add(user);
MessagesController.getInstance().putUsers(users, false);
MessagesStorage.getInstance().putUsersAndChats(users, null, false, true);
UserConfig.saveConfig(true);
finishFragment();
}
});
} else {
AndroidUtilities.RunOnUIThread(new Runnable() {
@Override
public void run() {
try {
progressDialog.dismiss();
} catch (Exception e) {
FileLog.e("tmessages", e);
}
showErrorAlert(error.text);
}
});
}
}
}, true, RPCRequest.RPCRequestClassGeneric | RPCRequest.RPCRequestClassFailOnServerErrors);
ConnectionsManager.getInstance().bindRequestToGuid(reqId, classGuid);
progressDialog.setButton(DialogInterface.BUTTON_NEGATIVE, LocaleController.getString("Cancel", R.string.Cancel), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ConnectionsManager.getInstance().cancelRpc(reqId, true);
try {
dialog.dismiss();
} catch (Exception e) {
FileLog.e("tmessages", e);
}
}
});
progressDialog.show();
}
@Override
public void onOpenAnimationEnd() {
firstNameField.requestFocus();
AndroidUtilities.showKeyboard(firstNameField);
}
}

View File

@ -63,6 +63,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
private int avatarRow;
private int phoneSectionRow;
private int phoneRow;
private int usernameRow;
private int settingsSectionRow;
private int settingsTimerRow;
private int settingsKeyRow;
@ -93,6 +94,9 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
NotificationCenter.getInstance().addObserver(this, NotificationCenter.encryptedChatUpdated);
NotificationCenter.getInstance().addObserver(this, NotificationCenter.blockedUsersDidLoaded);
userBlocked = MessagesController.getInstance().blockedUsers.contains(user_id);
MessagesController.getInstance().loadFullUser(MessagesController.getInstance().getUser(user_id), classGuid);
return true;
}
@ -105,6 +109,8 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.encryptedChatCreated);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.encryptedChatUpdated);
NotificationCenter.getInstance().removeObserver(this, NotificationCenter.blockedUsersDidLoaded);
MessagesController.getInstance().cancelLoadFullUser(user_id);
}
private void updateRowsIds() {
@ -112,6 +118,12 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
avatarRow = rowCount++;
phoneSectionRow = rowCount++;
phoneRow = rowCount++;
TLRPC.User user = MessagesController.getInstance().getUser(user_id);
if (user != null && user.username != null && user.username.length() > 0) {
usernameRow = rowCount++;
} else {
usernameRow = -1;
}
settingsSectionRow = rowCount++;
if (currentEncryptedChat instanceof TLRPC.TL_encryptedChat) {
settingsTimerRow = rowCount++;
@ -281,6 +293,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
if (id == NotificationCenter.updateInterfaces) {
int mask = (Integer)args[0];
if ((mask & MessagesController.UPDATE_MASK_AVATAR) != 0 || (mask & MessagesController.UPDATE_MASK_NAME) != 0) {
updateRowsIds();
if (listView != null) {
listView.invalidateViews();
}
@ -531,7 +544,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
}
TextView textView = (TextView)view.findViewById(R.id.settings_section_text);
if (i == phoneSectionRow) {
textView.setText(LocaleController.getString("PHONE", R.string.PHONE));
textView.setText(LocaleController.getString("Info", R.string.Info));
} else if (i == settingsSectionRow) {
textView.setText(LocaleController.getString("SETTINGS", R.string.SETTINGS));
} else if (i == sharedMediaSectionRow) {
@ -610,7 +623,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
} else {
textView.setText(LocaleController.getString("Unknown", R.string.Unknown));
}
divider.setVisibility(View.INVISIBLE);
divider.setVisibility(usernameRow != -1 ? View.VISIBLE : View.INVISIBLE);
detailTextView.setText(LocaleController.getString("PhoneMobile", R.string.PhoneMobile));
}
} else if (type == 3) {
@ -639,6 +652,15 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
} else {
detailTextView.setText(AndroidUtilities.formatTTLString(encryptedChat.ttl));
}
} else if (i == usernameRow) {
TLRPC.User user = MessagesController.getInstance().getUser(user_id);
textView.setText(LocaleController.getString("Username", R.string.Username));
if (user != null && user.username != null && user.username.length() != 0) {
detailTextView.setText("@" + user.username);
} else {
detailTextView.setText("-");
}
divider.setVisibility(View.INVISIBLE);
}
} else if (type == 4) {
if (view == null) {
@ -675,7 +697,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
return 1;
} else if (i == phoneRow) {
return 2;
} else if (i == sharedMediaRow || i == settingsTimerRow) {
} else if (i == sharedMediaRow || i == settingsTimerRow || i == usernameRow) {
return 3;
} else if (i == settingsKeyRow) {
return 4;

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 972 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 956 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
@ -35,4 +35,4 @@
</LinearLayout>
</RelativeLayout>
</FrameLayout>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
@ -54,4 +54,4 @@
</LinearLayout>
</RelativeLayout>
</FrameLayout>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">آخر ظهور</string>
<string name="LastSeenDate">آخر ظهور</string>
<string name="InviteFriends">قم بدعوة صديق</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">إرسال الرسالة إلى...</string>
<string name="EnterGroupNamePlaceholder">أدخل اسم للمجموعة</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">إيقاف</string>
<string name="EncryptionKeyDescription">هذه الصورة هي تصور لمفتاح التشفير لهذه المحادثة السرية مع <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>إذا كانت مطابقة للصورة التي في جهاز <![CDATA[<b>]]>%2$s<![CDATA[</b>]]>, فمحادثتكم آمنة ٢٠٠٪.<![CDATA[<br><br>]]>للمزيد نرجو الذهاب إلى telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">الهاتف</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">تم تعيين كافة الإشعارات افتراضيا</string>
<string name="TextSize">حجم نص الرسائل</string>
@ -206,7 +212,6 @@
<string name="Unblock">إلغاء الحظر</string>
<string name="UnblockText">إضغط بإستمرار على المستخدم لإلغاء الحظر</string>
<string name="NoBlocked">لا توجد جهات اتصال محظورة</string>
<string name="YourPhoneNumber">رقم هاتفك</string>
<string name="MessageNotifications">إشعارات الرسائل</string>
<string name="Alert">التنبيه</string>
<string name="MessagePreview">معاينة الرسالة</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">zul. online</string>
<string name="LastSeenDate">zul. online</string>
<string name="InviteFriends">Freunde einladen</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Sende Nachricht an…</string>
<string name="EnterGroupNamePlaceholder">Gruppenname</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Aus</string>
<string name="EncryptionKeyDescription">Das ist eine Darstellung des Schlüssels für den Geheimen Chat mit <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Wenn dieses Bild auf <![CDATA[<b>]]>%2$s\s<![CDATA[</b>]]>s Telefon genau so aussieht, ist euer Chat zu 200%% sicher.<![CDATA[<br><br>]]>Erfahre mehr auf telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Telefon</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Alle Einstellungen für Mitteilungen zurücksetzen</string>
<string name="TextSize">Textgröße für Nachrichten</string>
@ -206,7 +212,6 @@
<string name="Unblock">Freigeben</string>
<string name="UnblockText">Gedrückt halten um freizugeben.</string>
<string name="NoBlocked">Keine blockierten Benutzer</string>
<string name="YourPhoneNumber">DEINE TELEFONNUMMER</string>
<string name="MessageNotifications">NACHRICHTEN</string>
<string name="Alert">Benachrichtigung</string>
<string name="MessagePreview">Vorschau</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">últ. vez</string>
<string name="LastSeenDate">últ. vez el</string>
<string name="InviteFriends">Invitar a amigos</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Enviar mensaje a...</string>
<string name="EnterGroupNamePlaceholder">Nombre del grupo</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Apagada</string>
<string name="EncryptionKeyDescription">Esta imagen es una visualización de la clave de cifrado para el chat secreto con <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Si esta imagen se ve igual en el teléfono de <![CDATA[<b>]]>%2$s<![CDATA[</b>]]>, tu chat es seguro en un 200%%.<![CDATA[<br><br>]]>Aprende más en telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Teléfono</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Restablecer las notificaciones</string>
<string name="TextSize">Tamaño del texto</string>
@ -206,7 +212,6 @@
<string name="Unblock">Desbloquear</string>
<string name="UnblockText">Para desbloquear, mantén pulsado sobre un usuario.</string>
<string name="NoBlocked">Sin usuarios bloqueados</string>
<string name="YourPhoneNumber">TU NÚMERO DE TELÉFONO</string>
<string name="MessageNotifications">NOTIFICACIONES DE MENSAJES</string>
<string name="Alert">Alerta</string>
<string name="MessagePreview">Vista previa del mensaje</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">ultimo accesso</string>
<string name="LastSeenDate">ultimo accesso</string>
<string name="InviteFriends">Invita amici</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Invia messaggio a...</string>
<string name="EnterGroupNamePlaceholder">Immetti il nome del gruppo</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Spento</string>
<string name="EncryptionKeyDescription">Questa immagine è una visualizzazione della chiave di cifratura per questa chat segreta con <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Se questa immagine è uguale sul telefono di <![CDATA[<b>]]>%2$s<![CDATA[</b>]]>, la chat è sicura al 200%%.<![CDATA[<br><br>]]>Per saperne di più, visita Telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Telefono</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Ripristina tutte le impostazioni di notifica predefinite</string>
<string name="TextSize">Dimensione testo messaggi</string>
@ -206,7 +212,6 @@
<string name="Unblock">Sblocca</string>
<string name="UnblockText">Tieni premuto sullutente per sbloccarlo.</string>
<string name="NoBlocked">Ancora nessun utente bloccato</string>
<string name="YourPhoneNumber">IL TUO NUMERO DI TELEFONO</string>
<string name="MessageNotifications">NOTIFICHE MESSAGGI</string>
<string name="Alert">Avviso</string>
<string name="MessagePreview">Anteprima messaggio</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">마지막 접속: </string>
<string name="LastSeenDate">마지막 접속: </string>
<string name="InviteFriends">친구 초대</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">메시지 보내기...</string>
<string name="EnterGroupNamePlaceholder">그룹 이름 입력</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">해제</string>
<string name="EncryptionKeyDescription">이 이미지는 <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>님과의 비밀대화에 사용 중인 암호화 키의 모습입니다.<![CDATA[<br><br>]]>이 이미지가 <![CDATA[<b>]]>%2$s<![CDATA[</b>]]>님의 암호화 키와 똑같다면 대화는 200%% 안전합니다.<![CDATA[<br><br>]]>더 자세한 사항은 telegram.org 를 참고해 주세요.</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">전화번호</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">모든 알림 설정이 초기화되었습니다</string>
<string name="TextSize">채팅 글자 크기</string>
@ -206,7 +212,6 @@
<string name="Unblock">차단 해제</string>
<string name="UnblockText">차단을 해제하려면 대화상대를 길게 누르세요.</string>
<string name="NoBlocked">차단한 친구가 없습니다</string>
<string name="YourPhoneNumber">전화번호</string>
<string name="MessageNotifications">메시지 알림</string>
<string name="Alert">알림 사용</string>
<string name="MessagePreview">메시지 미리보기</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">gezien</string>
<string name="LastSeenDate">gezien</string>
<string name="InviteFriends">Vrienden uitnodigen</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Bericht verzenden naar…</string>
<string name="EnterGroupNamePlaceholder">Groepsnaam...</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Uit</string>
<string name="EncryptionKeyDescription">Dit is een weergave van de encryptiesleutel voor deze geheime chat 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>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Telefoon</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Alle meldingsinstellingen herstellen</string>
<string name="TextSize">Tekstgrootte berichten</string>
@ -206,7 +212,6 @@
<string name="Unblock">Deblokkeren</string>
<string name="UnblockText">Houd een gebruiker ingedrukt om hem/haar te deblokkeren.</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">Voorvertoning</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">visto</string>
<string name="LastSeenDate">visto</string>
<string name="InviteFriends">Convidar Amigos</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Enviar mensagem para...</string>
<string name="EnterGroupNamePlaceholder">Digite o nome do grupo</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Desativado</string>
<string name="EncryptionKeyDescription">Esta imagem é uma visualização da chave criptográfica para esta conversa secreta com <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Se esta imagem aparecer da mesma forma no telefone de <![CDATA[<b>]]>%2$s\'s<![CDATA[</b>]]>, sua conversa é 200%% segura.<![CDATA[<br><br>]]>Saiba mais em telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Telefone</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Restaurar todas as configurações de notificação</string>
<string name="TextSize">Tamanho do texto nas mensagens</string>
@ -206,7 +212,6 @@
<string name="Unblock">Desbloquear</string>
<string name="UnblockText">Toque e segure no usuário para desbloquear</string>
<string name="NoBlocked">Nenhum usuário bloqueado</string>
<string name="YourPhoneNumber">SEU NÚMERO DE TELEFONE</string>
<string name="MessageNotifications">NOTIFICAÇÕES DE MENSAGENS</string>
<string name="Alert">Alerta</string>
<string name="MessagePreview">Visualização de Mensagem</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">visto</string>
<string name="LastSeenDate">visto</string>
<string name="InviteFriends">Convidar Amigos</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Enviar mensagem para...</string>
<string name="EnterGroupNamePlaceholder">Digite o nome do grupo</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Desativado</string>
<string name="EncryptionKeyDescription">Esta imagem é uma visualização da chave criptográfica para esta conversa secreta com <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>Se esta imagem aparecer da mesma forma no telefone de <![CDATA[<b>]]>%2$s\'s<![CDATA[</b>]]>, sua conversa é 200%% segura.<![CDATA[<br><br>]]>Saiba mais em telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Telefone</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Restaurar todas as configurações de notificação</string>
<string name="TextSize">Tamanho do texto nas mensagens</string>
@ -206,7 +212,6 @@
<string name="Unblock">Desbloquear</string>
<string name="UnblockText">Toque e segure no usuário para desbloquear</string>
<string name="NoBlocked">Nenhum usuário bloqueado</string>
<string name="YourPhoneNumber">SEU NÚMERO DE TELEFONE</string>
<string name="MessageNotifications">NOTIFICAÇÕES DE MENSAGENS</string>
<string name="Alert">Alerta</string>
<string name="MessagePreview">Visualização de Mensagem</string>

View File

@ -160,6 +160,7 @@
<string name="LastSeen">last seen</string>
<string name="LastSeenDate">last seen</string>
<string name="InviteFriends">Invite Friends</string>
<string name="GlobalSearch">GLOBAL SEARCH</string>
<!--group create view-->
<string name="SendMessageTo">Send message to...</string>
<string name="EnterGroupNamePlaceholder">Enter group name</string>
@ -198,6 +199,11 @@
<string name="ShortMessageLifetimeForever">Off</string>
<string name="EncryptionKeyDescription">This image is a visualization of the encryption key for this secret chat with <![CDATA[<b>]]>%1$s<![CDATA[</b>]]>.<![CDATA[<br><br>]]>If this image looks the same on <![CDATA[<b>]]>%2$s\'s<![CDATA[</b>]]> phone, your chat is 200%% secure.<![CDATA[<br><br>]]>Learn more at telegram.org</string>
<string name="Unknown">Unknown</string>
<string name="Info">INFO</string>
<string name="Phone">Phone</string>
<string name="Username">Username</string>
<string name="UsernameInUse">Username already in use</string>
<string name="UsernameInvalid">Username invalid</string>
<!--settings view-->
<string name="ResetNotificationsText">Reset all notification settings to default</string>
<string name="TextSize">Messages Text Size</string>
@ -206,7 +212,6 @@
<string name="Unblock">Unblock</string>
<string name="UnblockText">Tap and hold on user to unblock.</string>
<string name="NoBlocked">No blocked users yet</string>
<string name="YourPhoneNumber">YOUR PHONE NUMBER</string>
<string name="MessageNotifications">MESSAGE NOTIFICATIONS</string>
<string name="Alert">Alert</string>
<string name="MessagePreview">Message Preview</string>