From 96af8e0750773bedc2b9a9124c15c7b7a4d3aac4 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Fri, 4 Nov 2016 22:03:04 +0100 Subject: [PATCH] Some chan improvements - When replying on a chan, the receiving address isn't used as the sending identity - Chans are listed as contacts as well --- app/build.gradle | 8 ++++---- .../ch/dissem/apps/abit/ComposeMessageActivity.java | 10 +++++++++- .../apps/abit/repository/AndroidAddressRepository.java | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index cf33c47..7401c9b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -18,8 +18,8 @@ android { applicationId "ch.dissem.apps." + appName.toLowerCase() minSdkVersion 19 targetSdkVersion 25 - versionCode 9 - versionName "1.0-beta9" + versionCode 11 + versionName "1.0-beta11" jackOptions.enabled = false } compileOptions { @@ -28,8 +28,8 @@ android { } buildTypes { release { - minifyEnabled true - shrinkResources true + minifyEnabled false + shrinkResources false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } diff --git a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java index 6bcccf6..270c6ba 100644 --- a/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java +++ b/app/src/main/java/ch/dissem/apps/abit/ComposeMessageActivity.java @@ -24,6 +24,8 @@ import android.support.v4.app.Fragment; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; +import ch.dissem.apps.abit.service.Singleton; +import ch.dissem.bitmessage.entity.BitmessageAddress; import ch.dissem.bitmessage.entity.Plaintext; /** @@ -68,7 +70,13 @@ public class ComposeMessageActivity extends AppCompatActivity { private static Intent getReplyIntent(Context ctx, Plaintext item) { Intent replyIntent = new Intent(ctx, ComposeMessageActivity.class); replyIntent.putExtra(EXTRA_RECIPIENT, item.getFrom()); - replyIntent.putExtra(EXTRA_IDENTITY, item.getTo()); + BitmessageAddress receivingIdentity = item.getTo(); + if (receivingIdentity.isChan()) { + // I hate when people send as chan, so it won't be the default behaviour. + replyIntent.putExtra(EXTRA_IDENTITY, Singleton.getIdentity(ctx)); + } else { + replyIntent.putExtra(EXTRA_IDENTITY, receivingIdentity); + } String prefix; if (item.getSubject().length() >= 3 && item.getSubject().substring(0, 3) .equalsIgnoreCase("RE:")) { diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java index 5557112..24cc1bb 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java +++ b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.java @@ -110,7 +110,7 @@ public class AndroidAddressRepository implements AddressRepository { @Override public List getContacts() { - return find("private_key IS NULL"); + return find("private_key IS NULL OR chan = '1'"); } private List find(String where) {