mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 14:35:03 +01:00
Bug fixes
This commit is contained in:
parent
adbe66c860
commit
fa1734518d
6 changed files with 27 additions and 13 deletions
|
@ -83,7 +83,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 19
|
||||
versionCode 273
|
||||
versionCode 274
|
||||
versionName "1.6.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -547,9 +547,9 @@ public class NotificationsController {
|
|||
}
|
||||
if (old_unread_count != total_unread_count) {
|
||||
showOrUpdateNotification(notifyCheck);
|
||||
setBadge(ApplicationLoader.applicationContext, total_unread_count);
|
||||
notifyCheck = false;
|
||||
}
|
||||
setBadge(ApplicationLoader.applicationContext, total_unread_count);
|
||||
}
|
||||
|
||||
public void processLoadedUnreadMessages(HashMap<Long, Integer> dialogs) {
|
||||
|
@ -569,6 +569,7 @@ public class NotificationsController {
|
|||
dialogsToLoad += "" + dialog_id;
|
||||
}
|
||||
}
|
||||
setBadge(ApplicationLoader.applicationContext, total_unread_count);
|
||||
}
|
||||
|
||||
private void setBadge(Context context, int count) {
|
||||
|
|
|
@ -788,6 +788,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
|
|||
if (object.layer() > 0) {
|
||||
Datacenter datacenter = datacenterWithId(datacenterId);
|
||||
if (datacenter == null || datacenter.lastInitVersion != currentAppVersion) {
|
||||
registerForPush();
|
||||
request.initRequest = true;
|
||||
TLRPC.initConnection invoke = new TLRPC.initConnection();
|
||||
invoke.query = object;
|
||||
|
|
|
@ -468,13 +468,11 @@ public class MessageObject {
|
|||
FileLog.e("tmessages", e);
|
||||
}
|
||||
|
||||
int linesMaxWidth;
|
||||
int linesMaxWidth = (int)Math.ceil(lastLine);
|
||||
int lastLineWidthWithLeft;
|
||||
int linesMaxWidthWithLeft;
|
||||
boolean hasNonRTL = false;
|
||||
|
||||
linesMaxWidth = (int)Math.ceil(lastLine);
|
||||
|
||||
if (a == blocksCount - 1) {
|
||||
lastLineWidth = linesMaxWidth;
|
||||
}
|
||||
|
@ -494,6 +492,13 @@ public class MessageObject {
|
|||
lineWidth = 0;
|
||||
}
|
||||
|
||||
if (lineWidth > maxWidth + 100) {
|
||||
int start = block.textLayout.getLineStart(n);
|
||||
int end = block.textLayout.getLineEnd(n);
|
||||
CharSequence text = block.textLayout.getText().subSequence(start, end);
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
lineLeft = block.textLayout.getLineLeft(n);
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -1439,7 +1439,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
public void run() {
|
||||
MessagesController.getInstance().sendMessage(photoFinal, originalPathFinal, dialog_id);
|
||||
if (chatListView != null) {
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
}
|
||||
if (paused) {
|
||||
scrollToTopOnResume = true;
|
||||
|
@ -1528,7 +1528,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
public void run() {
|
||||
MessagesController.getInstance().sendMessage(documentFinal, originalPathFinal, dialog_id);
|
||||
if (chatListView != null) {
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
}
|
||||
if (paused) {
|
||||
scrollToTopOnResume = true;
|
||||
|
@ -1609,7 +1609,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
public void run() {
|
||||
MessagesController.getInstance().sendMessage(videoFinal, originalPathFinal, dialog_id);
|
||||
if (chatListView != null) {
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
}
|
||||
if (paused) {
|
||||
scrollToTopOnResume = true;
|
||||
|
@ -2113,7 +2113,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
} else if (id == 997) {
|
||||
MessagesController.getInstance().sendMessage((Double) args[0], (Double) args[1], dialog_id);
|
||||
if (chatListView != null) {
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
scrollToTopOnResume = true;
|
||||
}
|
||||
} else if (id == MessagesController.chatInfoDidLoaded) {
|
||||
|
@ -2347,7 +2347,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
} else {
|
||||
if (chatListView != null) {
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
}
|
||||
}
|
||||
scrollToTopUnReadOnResume = false;
|
||||
|
@ -2768,7 +2768,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
random_ids.add(selectedObject.messageOwner.random_id);
|
||||
}
|
||||
MessagesController.getInstance().deleteMessages(arr, random_ids, currentEncryptedChat);
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
}
|
||||
} else if (option == 1) {
|
||||
if (selectedObject != null) {
|
||||
|
@ -2843,6 +2843,13 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
MessagesController.getInstance().sendMessage((TLRPC.TL_document)messageObject.messageOwner.media.document, null, did);
|
||||
} else if (messageObject.messageOwner.media.geo instanceof TLRPC.TL_geoPoint) {
|
||||
MessagesController.getInstance().sendMessage(messageObject.messageOwner.media.geo.lat, messageObject.messageOwner.media.geo._long, did);
|
||||
} else if (messageObject.messageOwner.media.phone_number != null) {
|
||||
TLRPC.User user = new TLRPC.TL_userContact();
|
||||
user.phone = messageObject.messageOwner.media.phone_number;
|
||||
user.first_name = messageObject.messageOwner.media.first_name;
|
||||
user.last_name = messageObject.messageOwner.media.last_name;
|
||||
user.id = messageObject.messageOwner.media.user_id;
|
||||
MessagesController.getInstance().sendMessage(user, did);
|
||||
} else {
|
||||
MessagesController.getInstance().sendMessage(messageObject, did);
|
||||
}
|
||||
|
@ -2900,7 +2907,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
} else {
|
||||
activity.finishFragment();
|
||||
chatListView.setSelection(messages.size() + 1);
|
||||
chatListView.setSelectionFromTop(messages.size() - 1, -100000 - chatListView.getPaddingTop());
|
||||
scrollToTopOnResume = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -218,7 +218,7 @@ public class UserProfileActivity extends BaseFragment implements NotificationCen
|
|||
return;
|
||||
}
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
|
||||
builder.setMessage(LocaleController.getString("AreYouSure", R.string.AreYouSure));
|
||||
builder.setMessage(LocaleController.getString("AreYouSureSecretChat", R.string.AreYouSureSecretChat));
|
||||
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
|
||||
builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue