don't show contact details when in conversations with self

This commit is contained in:
Daniel Gultsch 2016-04-09 10:59:54 +02:00
parent 2713fd50c8
commit b99d70bfe7
3 changed files with 8 additions and 1 deletions

View File

@ -336,6 +336,10 @@ public class Conversation extends AbstractEntity implements Blockable {
return this.correctingMessage; return this.correctingMessage;
} }
public boolean withSelf() {
return getContact().isSelf();
}
public interface OnMessageFound { public interface OnMessageFound {
void onMessageFound(final Message message); void onMessageFound(final Message message);
} }

View File

@ -411,6 +411,7 @@ public class ConversationActivity extends XmppActivity
menuInviteContact.setVisible(getSelectedConversation().getMucOptions().canInvite()); menuInviteContact.setVisible(getSelectedConversation().getMucOptions().canInvite());
menuSecure.setVisible((Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices()); //only if pgp is supported we have a choice menuSecure.setVisible((Config.supportOpenPgp() || Config.supportOmemo()) && Config.multipleEncryptionChoices()); //only if pgp is supported we have a choice
} else { } else {
menuContactDetails.setVisible(!this.getSelectedConversation().withSelf());
menuMucDetails.setVisible(false); menuMucDetails.setVisible(false);
menuSecure.setVisible(Config.multipleEncryptionChoices()); menuSecure.setVisible(Config.multipleEncryptionChoices());
} }

View File

@ -468,8 +468,10 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa
highlightInConference(user); highlightInConference(user);
} }
} else { } else {
if (!message.getContact().isSelf()) {
activity.switchToContactDetails(message.getContact(), message.getFingerprint()); activity.switchToContactDetails(message.getContact(), message.getFingerprint());
} }
}
} else { } else {
Account account = message.getConversation().getAccount(); Account account = message.getConversation().getAccount();
Intent intent = new Intent(activity, EditAccountActivity.class); Intent intent = new Intent(activity, EditAccountActivity.class);