Skip to content

Commit

Permalink
contact profile: hide unavailable media/location
Browse files Browse the repository at this point in the history
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 :)
  • Loading branch information
r10s committed Feb 7, 2025
1 parent 490723d commit f5f5d04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
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 f5f5d04

Please sign in to comment.