diff options
Diffstat (limited to 'src/main/java/de/pixart/messenger/ui')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java | 6 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/StartConversationActivity.java | 14 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java index 87207b0cd..eb452015f 100644 --- a/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java +++ b/src/main/java/de/pixart/messenger/ui/ConferenceDetailsActivity.java @@ -510,7 +510,11 @@ public class ConferenceDetailsActivity extends XmppActivity implements OnConvers setTitle(mucOptions.isPrivateAndNonAnonymous() ? R.string.conference_details : R.string.channel_details); this.binding.editMucNameButton.setVisibility((self.getAffiliation().ranks(MucOptions.Affiliation.OWNER) || mucOptions.canChangeSubject()) ? View.VISIBLE : View.GONE); this.binding.detailsAccount.setText(getString(R.string.using_account, account)); - this.binding.jid.setText(mConversation.getJid().asBareJid().toEscapedString()); + if (mConversation.isPrivateAndNonAnonymous()) { + this.binding.jid.setText(getString(R.string.hosted_on, mConversation.getJid().getDomain())); + } else { + this.binding.jid.setText(mConversation.getJid().asBareJid().toEscapedString()); + } if (xmppConnectionService.multipleAccounts()) { this.binding.detailsAccount.setVisibility(View.VISIBLE); } else { diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java index 8f4e468c7..b0e880cba 100644 --- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java @@ -1003,10 +1003,12 @@ public class StartConversationActivity extends XmppActivity implements XmppConne } if (isBookmarkChecked) { - if (account.hasBookmarkFor(conferenceJid)) { - layout.setError(getString(R.string.bookmark_already_exists)); + Bookmark bookmark = account.getBookmark(conferenceJid); + if (bookmark != null) { + dialog.dismiss(); + openConversationsForBookmark(bookmark); } else { - final Bookmark bookmark = new Bookmark(account, conferenceJid.asBareJid()); + bookmark = new Bookmark(account, conferenceJid.asBareJid()); bookmark.setAutojoin(getBooleanPreference("autojoin", R.bool.autojoin)); final String nick = conferenceJid.getResource(); if (nick != null && !nick.isEmpty() && !nick.equals(MucOptions.defaultNick(account))) { @@ -1100,6 +1102,10 @@ public class StartConversationActivity extends XmppActivity implements XmppConne final AdapterView.AdapterContextMenuInfo acmi = (AdapterContextMenuInfo) menuInfo; if (mResContextMenu == R.menu.conference_context) { activity.conference_context_id = acmi.position; + final Bookmark bookmark = (Bookmark) activity.conferences.get(acmi.position); + final Conversation conversation = bookmark.getConversation(); + final MenuItem share = menu.findItem(R.id.context_share_uri); + share.setVisible(conversation == null || !conversation.isPrivateAndNonAnonymous()); } else if (mResContextMenu == R.menu.contact_context) { activity.contact_context_id = acmi.position; final Contact contact = (Contact) activity.contacts.get(acmi.position); @@ -1110,7 +1116,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne showContactDetailsItem.setVisible(false); } deleteContactMenuItem.setVisible(contact.showInRoster() && !contact.getOption(Contact.Options.SYNCED_VIA_OTHER)); - XmppConnection xmpp = contact.getAccount().getXmppConnection(); + final XmppConnection xmpp = contact.getAccount().getXmppConnection(); if (xmpp != null && xmpp.getFeatures().blocking() && !contact.isSelf()) { if (contact.isBlocked()) { blockUnblockItem.setTitle(R.string.unblock_contact); |