mirror of
https://github.com/DrKLO/Telegram.git
synced 2024-12-22 06:25:14 +01:00
Fixed not working notifications in opened chat while app in background
This commit is contained in:
parent
5855dc0567
commit
e2a6511fbf
3 changed files with 15 additions and 12 deletions
|
@ -83,7 +83,7 @@ android {
|
|||
defaultConfig {
|
||||
minSdkVersion 8
|
||||
targetSdkVersion 19
|
||||
versionCode 287
|
||||
versionCode 288
|
||||
versionName "1.6.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2231,16 +2231,11 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
|
|||
if (request.completed) {
|
||||
break;
|
||||
}
|
||||
if ((request.flags & RPCRequest.RPCRequestClassDownloadMedia) != 0) {
|
||||
if (request.lastResendTime == 0 || request.lastResendTime + 60 < (int)(System.currentTimeMillis() / 1000)) {
|
||||
request.lastResendTime = (int)(System.currentTimeMillis() / 1000);
|
||||
requestResend = true;
|
||||
} else {
|
||||
confirm = false;
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
if (request.lastResendTime == 0 || request.lastResendTime + 60 < (int)(System.currentTimeMillis() / 1000)) {
|
||||
request.lastResendTime = (int)(System.currentTimeMillis() / 1000);
|
||||
requestResend = true;
|
||||
} else {
|
||||
confirm = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1984,7 +1984,9 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
messages.add(0, dateObj);
|
||||
}
|
||||
if (!obj.isOut() && obj.messageOwner.unread) {
|
||||
obj.messageOwner.unread = false;
|
||||
if (!paused) {
|
||||
obj.messageOwner.unread = false;
|
||||
}
|
||||
markAsRead = true;
|
||||
}
|
||||
dayArray.add(0, obj);
|
||||
|
@ -2379,6 +2381,12 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
paused = false;
|
||||
if (readWhenResume && !messages.isEmpty()) {
|
||||
for (MessageObject messageObject : messages) {
|
||||
if (!messageObject.isUnread() && !messageObject.isFromMe()) {
|
||||
break;
|
||||
}
|
||||
messageObject.messageOwner.unread = false;
|
||||
}
|
||||
readWhenResume = false;
|
||||
MessagesController.getInstance().markDialogAsRead(dialog_id, messages.get(0).messageOwner.id, readWithMid, 0, readWithDate, true);
|
||||
}
|
||||
|
@ -3310,7 +3318,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
|
||||
@Override
|
||||
public boolean canPerformActions() {
|
||||
return !actionBarLayer.isActionModeShowed();
|
||||
return actionBarLayer != null && !actionBarLayer.isActionModeShowed();
|
||||
}
|
||||
};
|
||||
if (view instanceof ChatMediaCell) {
|
||||
|
|
Loading…
Reference in a new issue