diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 070914bb8..901972c80 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -47,6 +47,7 @@ import de.pixart.messenger.entities.Contact; import de.pixart.messenger.entities.Conversation; import de.pixart.messenger.entities.MucOptions; import de.pixart.messenger.entities.MucOptions.User; +import de.pixart.messenger.services.EmojiService; import de.pixart.messenger.services.XmppConnectionService; import de.pixart.messenger.services.XmppConnectionService.OnConversationUpdate; import de.pixart.messenger.services.XmppConnectionService.OnMucRosterUpdate; @@ -68,6 +69,7 @@ import de.pixart.messenger.utils.XmppUri; import rocks.xmpp.addr.Jid; import static de.pixart.messenger.entities.Bookmark.printableValue; +import static de.pixart.messenger.ui.SettingsActivity.USE_BUNDLED_EMOJIS; import static de.pixart.messenger.utils.StringUtils.changed; public class ConferenceDetailsActivity extends XmppActivity implements OnConversationUpdate, OnMucRosterUpdate, XmppConnectionService.OnAffiliationChanged, XmppConnectionService.OnRoleChanged, XmppConnectionService.OnConfigurationPushed, TextWatcher, OnMediaLoaded { @@ -284,6 +286,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + boolean useBundledEmoji = getPreferences().getBoolean(USE_BUNDLED_EMOJIS, getResources().getBoolean(R.bool.use_bundled_emoji)); + new EmojiService(this).init(useBundledEmoji); this.binding = DataBindingUtil.setContentView(this, R.layout.activity_muc_details); this.binding.changeConferenceButton.setOnClickListener(this.mChangeConferenceSettings); this.binding.invite.setOnClickListener(inviteListener); @@ -470,9 +474,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers name = user.getName(); } menu.setHeaderTitle(name); - MenuItem sendPrivateMessage = menu.findItem(R.id.send_private_message); - MenuItem highlightInMuc = menu.findItem(R.id.highlight_in_muc); - highlightInMuc.setVisible(true); MucDetailsContextMenuHelper.configureMucDetailsContextMenu(this, menu, mConversation, user); } super.onCreateContextMenu(menu, v, menuInfo); @@ -531,7 +532,6 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers updateView(); } } - this.binding.detailsMucAvatar.setImageBitmap(avatarService().get(mConversation, getPixel(Config.AVATAR_SIZE))); } @Override @@ -566,6 +566,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } else { this.binding.detailsAccount.setVisibility(View.GONE); } + this.binding.detailsMucAvatar.setImageBitmap(avatarService().get(mConversation, getPixel(Config.AVATAR_SIZE))); this.binding.yourPhoto.setImageBitmap(avatarService().get(mConversation.getAccount(), getPixel(48))); String roomName = mucOptions.getName(); String subject = mucOptions.getSubject(); @@ -593,7 +594,7 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers } else { this.binding.mucSubject.setVisibility(View.GONE); } - this.binding.mucYourNick.setText(mucOptions.getActualNick()); + this.binding.mucYourNick.setText(EmojiWrapper.transform(mucOptions.getActualNick())); if (mucOptions.online()) { this.binding.mucMoreDetails.setVisibility(View.VISIBLE); this.binding.mucSettings.setVisibility(View.VISIBLE); @@ -695,12 +696,8 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers Collections.sort(users); for (final User user : users) { ContactBinding binding = DataBindingUtil.inflate(inflater, R.layout.contact, this.binding.mucMembers, false); - final Contact contact = user.getContact(); - final String name = user.getName(); this.setListItemBackgroundOnView(binding.getRoot()); - if (contact != null && contact.showInRoster()) { - binding.getRoot().setOnClickListener((OnClickListener) view -> switchToContactDetails(contact)); - } + binding.getRoot().setOnClickListener(view1 -> highlightInMuc(mConversation, user.getName())); registerForContextMenu(binding.getRoot()); binding.getRoot().setTag(user); if (mAdvancedMode && user.getPgpKeyId() != 0) { @@ -708,19 +705,21 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers binding.key.setOnClickListener(v -> viewPgpKey(user)); binding.key.setText(OpenPgpUtils.convertKeyIdToHex(user.getPgpKeyId())); } + Contact contact = user.getContact(); + String name = user.getName(); if (contact != null) { - binding.contactDisplayName.setText(contact.getDisplayName()); - binding.contactJid.setText((name != null ? name + " \u2022 " : "") + getStatus(user)); + binding.contactDisplayName.setText(EmojiWrapper.transform(contact.getDisplayName())); + binding.contactJid.setText((name != null ? EmojiWrapper.transform(name) + " \u2022 " : "") + getStatus(user)); } else { - binding.contactDisplayName.setText(name == null ? "" : name); + binding.contactDisplayName.setText(name == null ? "" : EmojiWrapper.transform(name)); binding.contactJid.setText(getStatus(user)); } loadAvatar(user, binding.contactPhoto); if (user.getRole() == MucOptions.Role.NONE) { - binding.contactDisplayName.setAlpha(INACTIVE_ALPHA); - binding.key.setAlpha(INACTIVE_ALPHA); binding.contactJid.setAlpha(INACTIVE_ALPHA); + binding.key.setAlpha(INACTIVE_ALPHA); + binding.contactDisplayName.setAlpha(INACTIVE_ALPHA); binding.contactPhoto.setAlpha(INACTIVE_ALPHA); } this.binding.mucMembers.addView(binding.getRoot()); |