aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2019-04-26 21:46:47 +0200
committerChristian Schneppe <christian@pix-art.de>2019-04-26 21:46:47 +0200
commitec253a5a98c1244f6e77d24a96c552c5de51882b (patch)
tree0fccd8b36da83472f5fac051206a5fa9b645cfe0
parent05b57606a9750a04d386d2b538fc9dd7eb43276c (diff)
fix setting muc avatar
-rw-r--r--src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
index 0840fc3fc..27fb7fe90 100644
--- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java
@@ -218,25 +218,24 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers
return getString(R.string.invalid_muc_nick);
}
}));
+ this.binding.detailsMucAvatar.setOnClickListener(v -> {
+ final MucOptions mucOptions = mConversation.getMucOptions();
+ if (!mucOptions.hasVCards()) {
+ Toast.makeText(this, R.string.host_does_not_support_group_chat_avatars, Toast.LENGTH_SHORT).show();
+ return;
+ }
+ if (!mucOptions.getSelf().getAffiliation().ranks(MucOptions.Affiliation.OWNER)) {
+ Toast.makeText(this, R.string.only_the_owner_can_change_group_chat_avatar, Toast.LENGTH_SHORT).show();
+ return;
+ }
+ final Intent intent = new Intent(this, PublishGroupChatProfilePictureActivity.class);
+ intent.putExtra("uuid", mConversation.getUuid());
+ startActivity(intent);
+ });
this.mAdvancedMode = getPreferences().getBoolean("advanced_muc_mode", false);
this.binding.mucInfoMore.setVisibility(this.mAdvancedMode ? View.VISIBLE : View.GONE);
this.binding.notificationStatusButton.setOnClickListener(this.mNotifyStatusClickListener);
- if (mConversation != null) {
- this.binding.detailsMucAvatar.setOnClickListener(v -> {
- final MucOptions mucOptions = mConversation.getMucOptions();
- if (!mucOptions.hasVCards()) {
- Toast.makeText(this, R.string.host_does_not_support_group_chat_avatars, Toast.LENGTH_SHORT).show();
- return;
- }
- if (!mucOptions.getSelf().getAffiliation().ranks(MucOptions.Affiliation.OWNER)) {
- Toast.makeText(this, R.string.only_the_owner_can_change_group_chat_avatar, Toast.LENGTH_SHORT).show();
- return;
- }
- final Intent intent = new Intent(this, PublishGroupChatProfilePictureActivity.class);
- intent.putExtra("uuid", mConversation.getUuid());
- startActivity(intent);
- });
- }
+
this.binding.editMucNameButton.setOnClickListener(this::onMucEditButtonClicked);
this.binding.mucEditTitle.addTextChangedListener(this);
this.binding.mucEditSubject.addTextChangedListener(this);