Skip to content
Permalink
Browse files

Merge branch 'richdbdb-develop' into staging

  • Loading branch information...
SamouraiDev committed Feb 24, 2019
2 parents b8116c0 + aa8bcda commit 9a4b9d7f87d3d84fc007fcfbad8f807234c3aee0
Showing with 14 additions and 3 deletions.
  1. +14 −3 app/src/main/java/com/samourai/txtenna/utils/SendMessageInteractor.java
@@ -12,6 +12,7 @@
import com.gotenna.sdk.responses.GTResponse;
import com.gotenna.sdk.types.GTDataTypes.GTCommandResponseCode;
import com.gotenna.sdk.utils.Utils;
import com.gotenna.sdk.GoTenna;

import java.util.ArrayList;
import java.util.List;
@@ -37,6 +38,7 @@
private final Handler messageResendHandler;
private final List<SendMessageItem> messageQueue;
private boolean isSending;
private static final int BROADCAST_HOPS = 6;

//==============================================================================================
// Constructor
@@ -105,7 +107,7 @@ private void markMessageAsSentAndSendNext(SendMessageItem sendMessageItem)

private void sendBroadcast(final SendMessageItem sendMessageItem)
{
gtCommandCenter.sendBroadcastMessage(sendMessageItem.message.toBytes(), new GTCommandResponseListener()
GTCommandResponseListener responseListener = new GTCommandResponseListener()
{
@Override
public void onResponse(GTResponse response)
@@ -127,7 +129,9 @@ public void onResponse(GTResponse response)

markMessageAsSentAndSendNext(sendMessageItem);
}
}, new GTErrorListener()
};

GTErrorListener errorListener = new GTErrorListener()
{
@Override
public void onError(GTError error)
@@ -146,7 +150,14 @@ public void onError(GTError error)
markMessageAsSentAndSendNext(sendMessageItem);
}
}
}, 3);
};
if(GoTenna.hasSuperToken()) {
Log.w(TAG, String.format(Locale.US,"SDK SuperToken will cause message to be re-broadcast up to %d hops", BROADCAST_HOPS));
gtCommandCenter.sendBroadcastMessage(sendMessageItem.message.toBytes(), responseListener, errorListener, BROADCAST_HOPS);
}
else{
gtCommandCenter.sendBroadcastMessage(sendMessageItem.message.toBytes(), responseListener, errorListener);
}
}

private void sendMessage(final SendMessageItem sendMessageItem)

0 comments on commit 9a4b9d7

Please sign in to comment.
You can’t perform that action at this time.