Bug fixes

This commit is contained in:
DrKLO 2014-07-20 20:02:01 +04:00
parent 1c2010a428
commit 5855dc0567
5 changed files with 23 additions and 11 deletions

View file

@ -83,7 +83,7 @@ android {
defaultConfig {
minSdkVersion 8
targetSdkVersion 19
versionCode 286
versionCode 287
versionName "1.6.1"
}
}

View file

@ -74,6 +74,9 @@ public class ConnectionContext extends PyroClientAdapter {
}
public void addMessageToConfirm(long messageId) {
if (messagesIdsForConfirmation.contains(messageId)) {
return;
}
messagesIdsForConfirmation.add(messageId);
}

View file

@ -1095,6 +1095,10 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
}
}
if (request.transportChannelToken != 0 && request.transportChannelToken != connection.channelToken) {
request.lastResendTime = 0;
}
request.retryCount++;
NetworkMessage networkMessage = new NetworkMessage();
networkMessage.protoMessage = new TLRPC.TL_protoMessage();
@ -1729,7 +1733,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
});
}
void rpcCompleted(final long requestMsgId) {
private void rpcCompleted(final long requestMsgId) {
Utilities.stageQueue.postRunnable(new Runnable() {
@Override
public void run() {
@ -1920,6 +1924,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
futureSalts.freeResources();
messagesConfirmed(requestMid);
request.completed = true;
rpcCompleted(requestMid);
break;
@ -2135,6 +2140,7 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
FileLog.e("tmessages", "rpc is init, but init connection already completed");
}
}
request.completed = true;
rpcCompleted(resultMid);
} else {
request.runningMessageId = 0;
@ -2220,11 +2226,14 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
boolean confirm = true;
if (detailedInfo instanceof TLRPC.TL_msg_detailed_info) {
long requestMid = ((TLRPC.TL_msg_detailed_info)detailedInfo).msg_id;
for (RPCRequest request : runningRequests) {
if (request.respondsToMessageId(requestMid)) {
if (request.respondsToMessageId(detailedInfo.msg_id)) {
if (request.completed) {
break;
}
if ((request.flags & RPCRequest.RPCRequestClassDownloadMedia) != 0) {
if (request.runningStartTime + 60 < System.currentTimeMillis() / 1000) {
if (request.lastResendTime == 0 || request.lastResendTime + 60 < (int)(System.currentTimeMillis() / 1000)) {
request.lastResendTime = (int)(System.currentTimeMillis() / 1000);
requestResend = true;
} else {
confirm = false;
@ -2252,11 +2261,9 @@ public class ConnectionsManager implements Action.ActionDelegate, TcpConnection.
ArrayList<NetworkMessage> arr = new ArrayList<NetworkMessage>();
arr.add(networkMessage);
sendMessagesToTransport(arr, connection, false);
} else {
if (confirm) {
} else if (confirm) {
connection.addMessageToConfirm(detailedInfo.answer_msg_id);
}
}
} else if (message instanceof TLRPC.TL_gzip_packed) {
TLRPC.TL_gzip_packed packet = (TLRPC.TL_gzip_packed)message;
TLObject result = Utilities.decompress(packet.packed_data, getRequestWithMessageId(messageId));

View file

@ -35,7 +35,9 @@ public class RPCRequest {
int serverFailureCount;
int flags;
public int retryCount = 0;
protected int retryCount = 0;
protected int lastResendTime = 0;
protected boolean completed = false;
TLObject rawRequest;
TLObject rpcRequest;

View file

@ -275,7 +275,7 @@
<string name="OnlyWhenScreenOn">Nur wenn Bildschirm „an“</string>
<string name="OnlyWhenScreenOff">Nur wenn Bildschirm „aus“</string>
<string name="AlwaysShowPopup">Popups immer anzeigen</string>
<string name="BadgeNumber">Badge Number</string>
<string name="BadgeNumber">Nummer auf Symbol</string>
<!--media view-->
<string name="NoMedia">Noch keine geteilten Medien vorhanden</string>