1
0
mirror of https://github.com/MGislv/NekoX.git synced 2024-06-30 22:22:57 +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 {
minSdkVersion 8
targetSdkVersion 22
versionCode 467
versionCode 468
versionName "2.6.0"
}
}

View File

@ -504,7 +504,7 @@ public class MessageObject {
} else if (!(c != ' ' && 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;
}
if (c == ':') {

View File

@ -51,11 +51,11 @@ public class SmsListener extends BroadcastReceiver {
NotificationCenter.getInstance().postNotificationName(NotificationCenter.didReceiveSmsCode, matcher.group(0));
}
}
} catch (Exception e) {
} catch (Throwable e) {
FileLog.e("tmessages", e);
}
} catch(Exception e) {
} catch(Throwable 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.text = ((TLRPC.RpcError)resultContainer.result).error_message;
} 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) {
FileLog.e("tmessages", "rawRequest is null");
} 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) {
if (location == null) {
return;
}
fileLoaderQueue.postRunnable(new Runnable() {
@Override
public void run() {

View File

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

View File

@ -70,7 +70,7 @@ public class MentionsAdapter extends BaseFragmentAdapter {
continue;
}
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;
usernameStartPosition = a;
usernameLength = username.length() + 1;

View File

@ -27,6 +27,7 @@ import org.telegram.android.Emoji;
import org.telegram.android.LocaleController;
import org.telegram.messenger.ApplicationLoader;
import org.telegram.messenger.FileLoader;
import org.telegram.messenger.FileLog;
import org.telegram.messenger.TLRPC;
import org.telegram.android.MessagesController;
import org.telegram.messenger.R;
@ -447,17 +448,25 @@ public class ChatBaseCell extends BaseCell {
if (stringFinalName == null) {
stringFinalName = LocaleController.getString("Loading", R.string.Loading);
}
replyNameLayout = new StaticLayout(stringFinalName, replyNamePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
if (replyNameLayout.getLineCount() > 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);
try {
replyNameLayout = new StaticLayout(stringFinalName, replyNamePaint, maxWidth, Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
if (replyNameLayout.getLineCount() > 0) {
replyNameWidth = (int)Math.ceil(replyNameLayout.getLineWidth(0)) + AndroidUtilities.dp(12 + (needReplyImage ? 44 : 0));
replyNameOffset = replyNameLayout.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);
}
ChatActivity chatActivity = new ChatActivity(args);
presentFragment(chatActivity, true);
chatActivity.showReplyForMessageObjectOrForward(true, null, fmessages, false);
if (!AndroidUtilities.isTablet()) {
removeSelfFromStack();
Activity parentActivity = getParentActivity();
if (parentActivity == null) {
parentActivity = chatActivity.getParentActivity();
}
if (parentActivity != null) {
parentActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
if (presentFragment(chatActivity, true)) {
chatActivity.showReplyForMessageObjectOrForward(true, null, fmessages, false);
if (!AndroidUtilities.isTablet()) {
removeSelfFromStack();
Activity parentActivity = getParentActivity();
if (parentActivity == null) {
parentActivity = chatActivity.getParentActivity();
}
if (parentActivity != null) {
parentActivity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
}
}
} else {
activity.finishFragment();
}
} else {
activity.finishFragment();

View File

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