Skip to content
This repository has been archived by the owner on Sep 2, 2021. It is now read-only.

Commit

Permalink
disable XMPP reconnection manager, and change heartbeat service call
Browse files Browse the repository at this point in the history
  • Loading branch information
iamironrabbit committed Dec 3, 2018
1 parent 79b6b98 commit 1d2029c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2974,20 +2974,6 @@ public void sendMessageAsync(ChatSession session, final Message message) {
else {
Chat thisChat = mChatManager.chatWith(jidTo.asEntityBareJidIfPossible());

/**
if (mConnection.isSmEnabled()) {
try {
mConnection.addStanzaIdAcknowledgedListener(message.getID(), new StanzaListener() {
@Override
public void processStanza(Stanza stanza) throws SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException {
message.setType(Imps.MessageType.OUTGOING_ENCRYPTED_VERIFIED);
}
});
} catch (StreamManagementException.StreamManagementNotEnabledException e) {
e.printStackTrace();
}
}**/

if (message.getType() == Imps.MessageType.QUEUED) {

//if this isn't already OTR encrypted, and the JID can support OMEMO then do it!
Expand Down Expand Up @@ -4207,14 +4193,13 @@ public void pingFailed() {
}
});


mReconnectionManager = ReconnectionManager.getInstanceFor(mConnection);
/**
if (mReconnectionManager != null) {
mReconnectionManager.abortPossiblyRunningReconnection();
mReconnectionManager.disableAutomaticReconnection();
}**/

mReconnectionManager = ReconnectionManager.getInstanceFor(mConnection);

}
mReconnectionManager.setReconnectionPolicy(ReconnectionManager.ReconnectionPolicy.FIXED_DELAY);
mReconnectionManager.addReconnectionListener(new ReconnectionListener() {
@Override
Expand All @@ -4230,8 +4215,9 @@ public void reconnectionFailed(Exception e) {
}
});
mReconnectionManager.enableAutomaticReconnection();
});**/

mReconnectionManager.disableAutomaticReconnection();

try {
debug(TAG,"is Private Data supported?" + mPrivateManager.isSupported());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ public void onCreate() {
// Have the heartbeat start autoLogin, unless onStart turns this off
mNeedCheckAutoLogin = true;

HeartbeatService.startBeating(getApplicationContext());

installTransports(this);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Expand Down Expand Up @@ -431,7 +429,9 @@ public int onStartCommand(Intent intent, int flags, int startId) {
mNeedCheckAutoLogin = !autoLogin();
}

return START_STICKY;
HeartbeatService.startBeating(getApplicationContext());

return START_REDELIVER_INTENT;
}


Expand Down Expand Up @@ -507,6 +507,7 @@ public void onTrimMemory(int level) {
}
}

/**
private void clearMemoryMedium ()
{
mOtrChatManager = null;
Expand Down Expand Up @@ -542,7 +543,7 @@ private void clearMemoryComplete ()
System.gc();
openEncryptedStores(tempKey,true);
}
}**/

private void clearConnectionStatii() {
ContentResolver cr = getContentResolver();
Expand Down

0 comments on commit 1d2029c

Please sign in to comment.