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
This commit is contained in:
Christian Basler 2016-11-04 22:03:04 +01:00
parent b34e678c68
commit 96af8e0750
3 changed files with 14 additions and 6 deletions

View File

@ -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
}

View File

@ -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:")) {

View File

@ -110,7 +110,7 @@ public class AndroidAddressRepository implements AddressRepository {
@Override
public List<BitmessageAddress> getContacts() {
return find("private_key IS NULL");
return find("private_key IS NULL OR chan = '1'");
}
private List<BitmessageAddress> find(String where) {