core: don't keep connection of the merged contact (#2507)

This commit is contained in:
spaced4ndy
2023-05-25 20:54:31 +04:00
committed by GitHub
parent f9f34911b1
commit 6093219ce9
8 changed files with 77 additions and 49 deletions
@@ -196,8 +196,8 @@ fun ChatInfoLayout(
}
ContactPreferencesButton(openPreferences)
}
SectionDividerSpaced()
if (contact.contactLink != null) {
val context = LocalContext.current
SectionView(stringResource(R.string.address_section_title).uppercase()) {
@@ -208,6 +208,17 @@ fun ChatInfoLayout(
SectionDividerSpaced()
}
if (developerTools) {
SectionView(title = stringResource(R.string.contact_info_section_title_contact)) {
val connLevel = contact.activeConn.connLevel
val connLevelDesc =
if (connLevel == 0) stringResource(R.string.conn_level_desc_direct)
else String.format(generalGetString(R.string.conn_level_desc_indirect), connLevel)
InfoRow(stringResource(R.string.info_row_connection), connLevelDesc)
}
SectionDividerSpaced()
}
SectionView(title = stringResource(R.string.conn_stats_section_title_servers)) {
SwitchAddressButton(switchContactAddress)
if (connStats != null) {
@@ -1140,6 +1140,7 @@
<string name="member_will_be_removed_from_group_cannot_be_undone">Member will be removed from group - this cannot be undone!</string>
<string name="remove_member_confirmation">Remove</string>
<string name="member_info_section_title_member">MEMBER</string>
<string name="contact_info_section_title_contact">CONTACT</string>
<string name="role_in_group">Role</string>
<string name="change_role">Change role</string>
<string name="change_verb">Change</string>
@@ -131,6 +131,14 @@ struct ChatInfoView: View {
}
}
if developerTools {
Section("Contact") {
let connLevel = contact.activeConn.connLevel
let connLevelDesc = connLevel == 0 ? NSLocalizedString("direct", comment: "connection level description") : String.localizedStringWithFormat(NSLocalizedString("indirect (%d)", comment: "connection level description"), connLevel)
infoRow("Connection", connLevelDesc)
}
}
Section("Servers") {
networkStatusRow()
.onTapGesture {