aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu')
-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
3 files changed, 15 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("");
- }
}