aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java17
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java4
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationFragment.java3
-rw-r--r--src/main/res/menu/contact_details.xml13
4 files changed, 28 insertions, 9 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
index 657ae75b..7a500c0b 100644
--- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java
@@ -201,7 +201,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
@Override
public boolean onOptionsItemSelected(final MenuItem menuItem) {
- AlertDialog.Builder builder = new AlertDialog.Builder(this);
+ final AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setNegativeButton(getString(R.string.cancel), null);
switch (menuItem.getItemId()) {
case android.R.id.home:
@@ -237,13 +237,25 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
startActivity(intent);
}
break;
+ case R.id.action_block:
+ BlockContactDialog.show(this, xmppConnectionService, contact);
+ break;
+ case R.id.action_unblock:
+ BlockContactDialog.show(this, xmppConnectionService, contact);
+ break;
}
return super.onOptionsItemSelected(menuItem);
}
@Override
- public boolean onCreateOptionsMenu(Menu menu) {
+ public boolean onCreateOptionsMenu(final Menu menu) {
getMenuInflater().inflate(R.menu.contact_details, menu);
+ if (this.contact.isBlocked()) {
+ menu.findItem(R.id.action_block).setVisible(false);
+ } else {
+ menu.findItem(R.id.action_unblock).setVisible(false);
+ }
+
return true;
}
@@ -424,6 +436,7 @@ public class ContactDetailsActivity extends XmppActivity implements OnAccountUpd
@Override
public void run() {
+ invalidateOptionsMenu();
populateView();
}
});
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
index 1356e616..ad9c13aa 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java
@@ -1075,10 +1075,6 @@ public class ConversationActivity extends XmppActivity
xmppConnectionService.sendUnblockRequest(conversation);
}
- public void blockConversation(final Blockable conversation) {
- xmppConnectionService.sendBlockRequest(conversation);
- }
-
public boolean enterIsSend() {
return getPreferences().getBoolean("enter_is_send",false);
}
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
index 0a38daee..e767fbea 100644
--- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java
@@ -974,7 +974,4 @@ public class ConversationFragment extends Fragment {
this.mEditMessage.append(text);
}
- public void clearInputField() {
- this.mEditMessage.setText("");
- }
}
diff --git a/src/main/res/menu/contact_details.xml b/src/main/res/menu/contact_details.xml
index ce9028aa..ba8889d8 100644
--- a/src/main/res/menu/contact_details.xml
+++ b/src/main/res/menu/contact_details.xml
@@ -17,6 +17,19 @@
android:id="@+id/action_show_qr_code"
android:title="@string/show_qr_code"
android:showAsAction="never" />
+
+ <item
+ android:id="@+id/action_block"
+ android:orderInCategory="72"
+ android:showAsAction="never"
+ android:title="@string/action_block_contact"/>
+
+ <item
+ android:id="@+id/action_unblock"
+ android:orderInCategory="73"
+ android:showAsAction="never"
+ android:title="@string/action_unblock_contact"/>
+
<item
android:id="@+id/action_accounts"
android:orderInCategory="90"