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

Bug fixes

This commit is contained in:
DrKLO 2015-03-19 12:27:46 +03:00
parent 028f5d9c90
commit a484ab0d7f
10 changed files with 48 additions and 33 deletions

View File

@ -82,7 +82,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 22 targetSdkVersion 22
versionCode 467 versionCode 468
versionName "2.6.0" versionName "2.6.0"
} }
} }

View File

@ -504,7 +504,7 @@ public class MessageObject {
} else if (!(c != ' ' && digitsInRow > 0)) { } else if (!(c != ' ' && digitsInRow > 0)) {
digitsInRow = 0; digitsInRow = 0;
} }
if ((c == '@' || c == '#') && i == 0 || i != 0 && message.charAt(i - 1) == ' ') { if ((c == '@' || c == '#') && i == 0 || i != 0 && (message.charAt(i - 1) == ' ' || message.charAt(i - 1) == '\n')) {
return true; return true;
} }
if (c == ':') { if (c == ':') {

View File

@ -51,11 +51,11 @@ public class SmsListener extends BroadcastReceiver {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0)); NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0));
} }
} }
} catch (Exception e) { } catch (Throwable e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
} catch(Exception e) { } catch(Throwable e) {
FileLog.e("tmessages", e); FileLog.e("tmessages", e);
} }
} }

View File

@ -2154,7 +2154,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
implicitError.code = ((TLRPC.RpcError)resultContainer.result).error_code; implicitError.code = ((TLRPC.RpcError)resultContainer.result).error_code;
implicitError.text = ((TLRPC.RpcError)resultContainer.result).error_message; implicitError.text = ((TLRPC.RpcError)resultContainer.result).error_message;
} else if (!(resultContainer.result instanceof TLRPC.TL_error)) { } else if (!(resultContainer.result instanceof TLRPC.TL_error)) {
if (request.rawRequest == null || !request.rawRequest.responseClass().isAssignableFrom(resultContainer.result.getClass())) { if (request.rawRequest == null || resultContainer.result == null || !request.rawRequest.responseClass().isAssignableFrom(resultContainer.result.getClass())) {
if (request.rawRequest == null) { if (request.rawRequest == null) {
FileLog.e("tmessages", "rawRequest is null"); FileLog.e("tmessages", "rawRequest is null");
} else { } else {

View File

@ -132,6 +132,9 @@ public class FileLoader {
} }
public void uploadFile(final String location, final boolean encrypted, final boolean small, final int estimatedSize) { public void uploadFile(final String location, final boolean encrypted, final boolean small, final int estimatedSize) {
if (location == null) {
return;
}
fileLoaderQueue.postRunnable(new Runnable() { fileLoaderQueue.postRunnable(new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@ -181,7 +181,7 @@ public class FileLog {
} }
public static void cleanupLogs() { public static void cleanupLogs() {
ArrayList<Uri> uris = new ArrayList<Uri>(); ArrayList<Uri> uris = new ArrayList<>();
File sdCard = ApplicationLoader.applicationContext.getExternalFilesDir(null); File sdCard = ApplicationLoader.applicationContext.getExternalFilesDir(null);
File dir = new File (sdCard.getAbsolutePath() + "/logs"); File dir = new File (sdCard.getAbsolutePath() + "/logs");
File[] files = dir.listFiles(); File[] files = dir.listFiles();

View File

@ -70,7 +70,7 @@ public class MentionsAdapter extends BaseFragmentAdapter {
continue; continue;
} }
char ch = text.charAt(a); char ch = text.charAt(a);
if (ch == '@' && (a == 0 || text.charAt(a - 1) == ' ')) { if (ch == '@' && (a == 0 || text.charAt(a - 1) == ' ' || text.charAt(a - 1) == '\n')) {
found = true; found = true;
usernameStartPosition = a; usernameStartPosition = a;
usernameLength = username.length() + 1; usernameLength = username.length() + 1;

View File

@ -27,6 +27,7 @@ import org.telegram.android.Emoji;
import org.telegram.android.LocaleController; import org.telegram.android.LocaleController;
import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.FileLoader; import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.TLRPC; import org.telegram.messenger.TLRPC;
import org.telegram.android.MessagesController; import org.telegram.android.MessagesController;
import org.telegram.messenger.R; import org.telegram.messenger.R;
@ -447,17 +448,25 @@ public class ChatBaseCell extends BaseCell {
if (stringFinalName == null) { if (stringFinalName == null) {
stringFinalName = LocaleController.getString("Loading", R.string.Loading); stringFinalName = LocaleController.getString("Loading", R.string.Loading);
} }
replyNameLayout = new StaticLayout(stringFinalName, replyNamePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false); try {
if (replyNameLayout.getLineCount() > 0) { replyNameLayout = new StaticLayout(stringFinalName, replyNamePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
replyNameWidth = (int)Math.ceil(replyNameLayout.getLineWidth(0)) + AndroidUtilities.dp(12 + (needReplyImage ? 44 : 0)); if (replyNameLayout.getLineCount() > 0) {
replyNameOffset = replyNameLayout.getLineLeft(0); replyNameWidth = (int)Math.ceil(replyNameLayout.getLineWidth(0)) + AndroidUtilities.dp(12 + (needReplyImage ? 44 : 0));
} replyNameOffset = replyNameLayout.getLineLeft(0);
if (stringFinalText != null) {
replyTextLayout = new StaticLayout(stringFinalText, replyTextPaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
if (replyTextLayout.getLineCount() > 0) {
replyTextWidth = (int) Math.ceil(replyTextLayout.getLineWidth(0)) + AndroidUtilities.dp(12 + (needReplyImage ? 44 : 0));
replyTextOffset = replyTextLayout.getLineLeft(0);
} }
} catch (Exception e) {
FileLog.e("tmessages", e);
}
try {
if (stringFinalText != null) {
replyTextLayout = new StaticLayout(stringFinalText, replyTextPaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
if (replyTextLayout.getLineCount() > 0) {
replyTextWidth = (int) Math.ceil(replyTextLayout.getLineWidth(0)) + AndroidUtilities.dp(12 + (needReplyImage ? 44 : 0));
replyTextOffset = replyTextLayout.getLineLeft(0);
}
}
} catch (Exception e) {
FileLog.e("tmessages", e);
} }
} }

View File

@ -4120,17 +4120,20 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
args.putInt("chat_id", -lower_part); args.putInt("chat_id", -lower_part);
} }
ChatActivity chatActivity = new ChatActivity(args); ChatActivity chatActivity = new ChatActivity(args);
presentFragment(chatActivity, true); if (presentFragment(chatActivity, true)) {
chatActivity.showReplyForMessageObjectOrForward(true, null, fmessages, false); chatActivity.showReplyForMessageObjectOrForward(true, null, fmessages, false);
if (!AndroidUtilities.isTablet()) { if (!AndroidUtilities.isTablet()) {
removeSelfFromStack(); removeSelfFromStack();
Activity parentActivity = getParentActivity(); Activity parentActivity = getParentActivity();
if (parentActivity == null) { if (parentActivity == null) {
parentActivity = chatActivity.getParentActivity(); parentActivity = chatActivity.getParentActivity();
} }
if (parentActivity != null) { if (parentActivity != null) {
parentActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); parentActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}
} }
} else {
activity.finishFragment();
} }
} else { } else {
activity.finishFragment(); activity.finishFragment();

View File

@ -664,12 +664,12 @@
<string name="ForwardedSticker_few">%1$d ملصق معاد توجيهه</string> <string name="ForwardedSticker_few">%1$d ملصق معاد توجيهه</string>
<string name="ForwardedSticker_many">%1$d ملصق معاد توجيهه</string> <string name="ForwardedSticker_many">%1$d ملصق معاد توجيهه</string>
<string name="ForwardedSticker_other">%1$d ملصق معاد توجيهه</string> <string name="ForwardedSticker_other">%1$d ملصق معاد توجيهه</string>
<string name="AndOther_zero">and %1$d others</string> <string name="AndOther_zero">و %1$d غيرهم</string>
<string name="AndOther_one">and %1$d other</string> <string name="AndOther_one">و %1$d غيره</string>
<string name="AndOther_two">and %1$d others</string> <string name="AndOther_two">و %1$d غيرهم</string>
<string name="AndOther_few">and %1$d others</string> <string name="AndOther_few">و %1$d غيرهم</string>
<string name="AndOther_many">and %1$d others</string> <string name="AndOther_many">و %1$d غيرهم</string>
<string name="AndOther_other">and %1$d others</string> <string name="AndOther_other">و %1$d غيرهم</string>
<!--date formatters--> <!--date formatters-->
<string name="formatterMonthYear">MMMM yyyy</string> <string name="formatterMonthYear">MMMM yyyy</string>
<string name="formatterMonth">MMM dd</string> <string name="formatterMonth">MMM dd</string>