diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-06-29 22:22:29 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-06-29 22:22:29 +0200 |
commit | d269fd47eecc7b4f34634118926a19bc084d07a4 (patch) | |
tree | 60e32019ff038b683dadb421aa6695461876fad6 /src/main/java/de/pixart/messenger/ui | |
parent | 298e5757cdfcdeacdd1d219ce314d52089fc2823 (diff) |
use room name (if available and != localpart) as group name
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index ed2dfee04..2ff6facf9 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -54,6 +54,8 @@ import de.pixart.messenger.utils.UIHelper; import de.pixart.messenger.utils.XmppUri; import rocks.xmpp.addr.Jid; +import static de.pixart.messenger.entities.Bookmark.printableValue; + public class ConferenceDetailsActivity extends XmppActivity implements OnConversationUpdate, OnMucRosterUpdate, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnRoleChanged, XmppConnectionService.OnConfigurationPushed { public static final String ACTION_VIEW_MUC = "view_muc"; private static final float INACTIVE_ALPHA = 0.4684f; //compromise between dark and light theme @@ -598,9 +600,23 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers this.binding.detailsAccount.setVisibility(View.GONE); } this.binding.yourPhoto.setImageBitmap(avatarService().get(mConversation.getAccount(), getPixel(48))); - - this.binding.mucTitle.setText(mucOptions.getName()); - this.binding.mucSubject.setText(mucOptions.getSubject()); + String roomName = mucOptions.getName(); + String subject = mucOptions.getSubject(); + if (printableValue(roomName)) { + this.binding.mucTitle.setText(roomName); + this.binding.mucTitle.setVisibility(View.VISIBLE); + } else if (!printableValue(subject)) { + this.binding.mucTitle.setText(mConversation.getName()); + this.binding.mucTitle.setVisibility(View.VISIBLE); + } else { + this.binding.mucTitle.setVisibility(View.GONE); + } + if (printableValue(subject)) { + this.binding.mucSubject.setText(mucOptions.getSubject()); + this.binding.mucSubject.setVisibility(View.VISIBLE); + } else { + this.binding.mucSubject.setVisibility(View.GONE); + } this.binding.mucYourNick.setText(mucOptions.getActualNick()); if (mucOptions.online()) { this.binding.mucMoreDetails.setVisibility(View.VISIBLE); |