Skip to content

Commit

Permalink
contact profile: hide unavailable media/location (#2589)
Browse files Browse the repository at this point in the history
* contact profile: hide unavailable media/location

if there is no chat with a contact,
in the contact's profile,
hide the superfluous media and location options -
similar to eg. shared chats and buttons as clear/delete chat.

this unclutters the profile,
puting things as "send message" more into focus.
and it looks better,
there are otherwise a bit too many grey tones in the upper area :)

* update CHANGELOG
  • Loading branch information
r10s authored Feb 8, 2025
1 parent 490723d commit eadc1bc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Copy scanned QR code text to clipboard (#2582)
- Improve "All media empty" and "Block contact" wordings (#2580)
- Unify buttons and icons (#2584)
- Hide unneeded buttons in contact profiles (#2589)
- Fix: Allow to share contacts that do not have a chat (#2583)


Expand Down
8 changes: 0 additions & 8 deletions deltachat-ios/Controller/ContactDetailViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,6 @@ class ContactDetailViewController: UITableViewController {
cell.textLabel?.text = String.localized("media")
cell.imageView?.image = UIImage(systemName: "photo.on.rectangle")
cell.accessoryType = .disclosureIndicator
if viewModel.chatId == 0 {
cell.isUserInteractionEnabled = false
cell.textLabel?.isEnabled = false
}
return cell
}()

Expand All @@ -131,10 +127,6 @@ class ContactDetailViewController: UITableViewController {
cell.textLabel?.text = String.localized("locations")
cell.imageView?.image = UIImage(systemName: "map")
cell.accessoryType = .disclosureIndicator
if viewModel.chatId == 0 {
cell.isUserInteractionEnabled = false
cell.textLabel?.isEnabled = false
}
return cell
}()

Expand Down
9 changes: 5 additions & 4 deletions deltachat-ios/ViewModel/ContactDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ class ContactDetailViewModel {
if dcContact.getVerifierId() != 0 {
chatOptions.append(.verifiedBy)
}
chatOptions.append(.allMedia)
if UserDefaults.standard.bool(forKey: "location_streaming") {
chatOptions.append(.locations)
}

var chatActions: [ChatAction]
let chatExists = chatId != 0
if chatExists {
chatOptions.append(.allMedia)
if UserDefaults.standard.bool(forKey: "location_streaming") {
chatOptions.append(.locations)
}

if !isDeviceTalk {
chatOptions.append(.ephemeralMessages)
}
Expand Down

0 comments on commit eadc1bc

Please sign in to comment.