From ef09b0ab1aed878b054f2b7f475cf8d15682cedc Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 8 Feb 2019 13:46:33 +0100 Subject: [PATCH] use the term channel in destroy dialog --- .../conversations/ui/ConferenceDetailsActivity.java | 13 +++++++++---- src/main/res/values/strings.xml | 3 +++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java index a0cf80ad9..97e5a54b7 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConferenceDetailsActivity.java @@ -355,9 +355,12 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers @Override public boolean onCreateOptionsMenu(Menu menu) { + final boolean groupChat = mConversation != null && mConversation.isPrivateAndNonAnonymous(); getMenuInflater().inflate(R.menu.muc_details, menu); final MenuItem share = menu.findItem(R.id.action_share); - share.setVisible(mConversation != null && !mConversation.isPrivateAndNonAnonymous()); + share.setVisible(groupChat); + final MenuItem destroy = menu.findItem(R.id.action_destroy_room); + destroy.setTitle(groupChat ? R.string.destroy_room : R.string.destroy_channel); AccountUtils.showHideMenuItems(menu); return super.onCreateOptionsMenu(menu); } @@ -387,9 +390,10 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } protected void destroyRoom() { + final boolean groupChat = mConversation != null && mConversation.isPrivateAndNonAnonymous(); AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setTitle(R.string.destroy_room); - builder.setMessage(R.string.destroy_room_dialog); + builder.setTitle(groupChat ? R.string.destroy_room : R.string.destroy_channel); + builder.setMessage(groupChat ? R.string.destroy_room_dialog : R.string.destroy_channel_dialog); builder.setPositiveButton(R.string.ok, (dialog, which) -> { xmppConnectionService.destroyRoom(mConversation, ConferenceDetailsActivity.this); }); @@ -580,7 +584,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers @Override public void onRoomDestroyFailed() { - displayToast(getString(R.string.could_not_destroy_room)); + final boolean groupChat = mConversation != null && mConversation.isPrivateAndNonAnonymous(); + displayToast(getString(groupChat ? R.string.could_not_destroy_room : R.string.could_not_destroy_channel)); } @Override diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index a426afaf4..5e02d7f11 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -228,8 +228,11 @@ Save as bookmark Delete bookmark Destroy group chat + Destroy channel Are you sure you want to destroy this group chat?\n\nWarning: The group chat will be completely removed on the server. + Are you sure you want to destroy this public channel?\n\nWarning: The channel will be completely removed on the server. Could not destroy group chat + Could not destroy channel This bookmark already exists Edit group chat subject Topic