Option to turn off acknowledgements
This commit is contained in:
parent
e2aa0e8b1d
commit
3a98cc115a
@ -36,6 +36,7 @@ import java.util.List;
|
||||
import ch.dissem.apps.abit.adapter.ContactAdapter;
|
||||
import ch.dissem.apps.abit.dialog.SelectEncodingDialogFragment;
|
||||
import ch.dissem.apps.abit.service.Singleton;
|
||||
import ch.dissem.apps.abit.util.Preferences;
|
||||
import ch.dissem.bitmessage.BitmessageContext;
|
||||
import ch.dissem.bitmessage.entity.BitmessageAddress;
|
||||
import ch.dissem.bitmessage.entity.Plaintext;
|
||||
@ -227,6 +228,9 @@ public class ComposeMessageFragment extends Fragment {
|
||||
.from(identity)
|
||||
.to(recipient);
|
||||
}
|
||||
if (!Preferences.requestAcknowledgements(getContext())){
|
||||
builder.preventAck();
|
||||
}
|
||||
switch (encoding) {
|
||||
case SIMPLE:
|
||||
builder.message(
|
||||
|
@ -27,6 +27,7 @@ public class Constants {
|
||||
public static final String PREFERENCE_SYNC_TIMEOUT = "sync_timeout";
|
||||
public static final String PREFERENCE_SERVER_POW = "server_pow";
|
||||
public static final String PREFERENCE_FULL_NODE = "full_node";
|
||||
public static final String PREFERENCE_REQUEST_ACK = "request_acknowledgments";
|
||||
public static final String PREFERENCE_POW_AVERAGE = "average_pow_time_ms";
|
||||
public static final String PREFERENCE_POW_COUNT = "pow_count";
|
||||
|
||||
|
@ -122,6 +122,18 @@ object Preferences {
|
||||
return File(ctx.filesDir, "exports")
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun requestAcknowledgements(ctx: Context): Boolean {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(ctx)
|
||||
return preferences.getBoolean(PREFERENCE_REQUEST_ACK, true)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun setRequestAcknowledgements(ctx: Context, status: Boolean) {
|
||||
val preferences = PreferenceManager.getDefaultSharedPreferences(ctx)
|
||||
preferences.edit().putBoolean(PREFERENCE_REQUEST_ACK, status).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun cleanupExportDirectory(ctx: Context) {
|
||||
val exportDirectory = getExportDirectory(ctx)
|
||||
|
@ -5,6 +5,11 @@
|
||||
android:key="wifi_only"
|
||||
android:summary="@string/wifi_only_summary"
|
||||
android:title="@string/wifi_only"/>
|
||||
<SwitchPreferenceCompat
|
||||
android:defaultValue="true"
|
||||
android:key="request_acknowledgements"
|
||||
android:summary="@string/request_acknowledgements_summary"
|
||||
android:title="@string/request_acknowledgements"/>
|
||||
<EditTextPreference
|
||||
android:inputType="textUri"
|
||||
android:key="trusted_node"
|
||||
|
Loading…
Reference in New Issue
Block a user