1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-07-04 11:13:36 +00:00

Bug fixes

This commit is contained in:
DrKLO 2014-06-22 13:36:52 +04:00
parent b85b6c1068
commit 9cbbe999e1
6 changed files with 19 additions and 8 deletions

View File

@ -81,7 +81,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 19 targetSdkVersion 19
versionCode 265 versionCode 266
versionName "1.5.7" versionName "1.5.7"
} }
} }

View File

@ -533,6 +533,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (request.completionBlock != null) { if (request.completionBlock != null) {
TLRPC.TL_error implicitError = new TLRPC.TL_error(); TLRPC.TL_error implicitError = new TLRPC.TL_error();
implicitError.code = -1000; implicitError.code = -1000;
implicitError.text = "";
request.completionBlock.run(null, implicitError); request.completionBlock.run(null, implicitError);
} }
} }
@ -542,6 +543,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
if (request.completionBlock != null) { if (request.completionBlock != null) {
TLRPC.TL_error implicitError = new TLRPC.TL_error(); TLRPC.TL_error implicitError = new TLRPC.TL_error();
implicitError.code = -1000; implicitError.code = -1000;
implicitError.text = "";
request.completionBlock.run(null, implicitError); request.completionBlock.run(null, implicitError);
} }
} }
@ -764,7 +766,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
invoke.device_model = "Android unknown"; invoke.device_model = "Android unknown";
} }
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
invoke.app_version = pInfo.versionName; invoke.app_version = pInfo.versionName + " (" + pInfo.versionCode + ")";
if (invoke.app_version == null) { if (invoke.app_version == null) {
invoke.app_version = "App version unknown"; invoke.app_version = "App version unknown";
} }
@ -1719,7 +1721,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
req.system_version = "SDK " + Build.VERSION.SDK_INT; req.system_version = "SDK " + Build.VERSION.SDK_INT;
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
req.app_version = pInfo.versionName; req.app_version = pInfo.versionName + " (" + pInfo.versionCode + ")";
if (req.app_version == null) { if (req.app_version == null) {
req.app_version = "App version unknown"; req.app_version = "App version unknown";
} }
@ -2027,6 +2029,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
} }
implicitError = new TLRPC.TL_error(); implicitError = new TLRPC.TL_error();
implicitError.code = -1000; implicitError.code = -1000;
implicitError.text = "";
} }
} }

View File

@ -1024,7 +1024,7 @@ public class MediaController implements NotificationCenter.NotificationCenterDel
fileDecodingQueue.postRunnable(new Runnable() { fileDecodingQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {
if (playingMessageObject.audioProgress != 0) { if (playingMessageObject != null && playingMessageObject.audioProgress != 0) {
lastPlayPcm = (long)(currentTotalPcmDuration * playingMessageObject.audioProgress); lastPlayPcm = (long)(currentTotalPcmDuration * playingMessageObject.audioProgress);
seekOpusFile(playingMessageObject.audioProgress); seekOpusFile(playingMessageObject.audioProgress);
} }

View File

@ -3093,7 +3093,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
} }
req.system_version = "SDK " + Build.VERSION.SDK_INT; req.system_version = "SDK " + Build.VERSION.SDK_INT;
PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0); PackageInfo pInfo = ApplicationLoader.applicationContext.getPackageManager().getPackageInfo(ApplicationLoader.applicationContext.getPackageName(), 0);
req.app_version = pInfo.versionName; req.app_version = pInfo.versionName + " (" + pInfo.versionCode + ")";
if (req.app_version == null) { if (req.app_version == null) {
req.app_version = "App version unknown"; req.app_version = "App version unknown";
} }

View File

@ -546,7 +546,7 @@ public class DialogCell extends BaseCell {
if (chat != null) { if (chat != null) {
nameString = chat.title; nameString = chat.title;
} else if (user != null) { } else if (user != null) {
if (user.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(user.id) == null) { if (user.id / 1000 != 777 && user.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(user.id) == null) {
if (ContactsController.getInstance().contactsDict.size() == 0 && (!ContactsController.getInstance().contactsLoaded || ContactsController.getInstance().isLoadingContacts())) { if (ContactsController.getInstance().contactsDict.size() == 0 && (!ContactsController.getInstance().contactsLoaded || ContactsController.getInstance().isLoadingContacts())) {
nameString = Utilities.formatName(user.first_name, user.last_name); nameString = Utilities.formatName(user.first_name, user.last_name);
} else { } else {

View File

@ -512,7 +512,11 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (str.length() != 0) { if (str.length() != 0) {
str += "\n"; str += "\n";
} }
if (messageObject.messageOwner.message != null) {
str += messageObject.messageOwner.message; str += messageObject.messageOwner.message;
} else {
str += messageObject.messageText;
}
} }
if (str.length() != 0) { if (str.length() != 0) {
if (android.os.Build.VERSION.SDK_INT < 11) { if (android.os.Build.VERSION.SDK_INT < 11) {
@ -1510,7 +1514,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
if (currentChat != null) { if (currentChat != null) {
actionBarLayer.setTitle(currentChat.title); actionBarLayer.setTitle(currentChat.title);
} else if (currentUser != null) { } else if (currentUser != null) {
if (currentUser.id / 1000 != 333 && ContactsController.getInstance().contactsDict.get(currentUser.id) == null && (ContactsController.getInstance().contactsDict.size() != 0 || !ContactsController.getInstance().isLoadingContacts())) { if (currentUser.id / 1000 != 777 || 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) { if (currentUser.phone != null && currentUser.phone.length() != 0) {
actionBarLayer.setTitle(PhoneFormat.getInstance().format("+" + currentUser.phone)); actionBarLayer.setTitle(PhoneFormat.getInstance().format("+" + currentUser.phone));
} else { } else {
@ -2646,6 +2650,7 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
if (currentEncryptedChat != null && !(currentEncryptedChat instanceof TLRPC.TL_encryptedChat) if (currentEncryptedChat != null && !(currentEncryptedChat instanceof TLRPC.TL_encryptedChat)
|| currentUser.id / 1000 == 333 || currentUser.id / 1000 == 333
|| currentUser.id / 1000 == 777
|| currentUser instanceof TLRPC.TL_userEmpty || currentUser instanceof TLRPC.TL_userDeleted || currentUser instanceof TLRPC.TL_userEmpty || currentUser instanceof TLRPC.TL_userDeleted
|| (currentUser.phone != null && currentUser.phone.length() != 0 && || (currentUser.phone != null && currentUser.phone.length() != 0 &&
ContactsController.getInstance().contactsDict.get(currentUser.id) != null && ContactsController.getInstance().contactsDict.get(currentUser.id) != null &&
@ -2723,6 +2728,9 @@ public class ChatActivity extends BaseFragment implements SizeNotifierRelativeLa
} }
private void createEmojiPopup() { private void createEmojiPopup() {
if (getParentActivity() == null) {
return;
}
emojiView = new EmojiView(getParentActivity()); emojiView = new EmojiView(getParentActivity());
emojiView.setListener(new EmojiView.Listener() { emojiView.setListener(new EmojiView.Listener() {
public void onBackspace() { public void onBackspace() {