Skip to content

Add local friend profile photo override in nickname editor#1

Draft
aidanwolter3 wants to merge 1 commit intomainfrom
codex/add-feature-to-change-friends-profile-pictures
Draft

Add local friend profile photo override in nickname editor#1
aidanwolter3 wants to merge 1 commit intomainfrom
codex/add-feature-to-change-friends-profile-pictures

Conversation

@aidanwolter3
Copy link
Owner

Motivation

  • Provide a local-only profile photo override for recipients so a user can set/change a friend’s profile picture for their own view (no network/profile sharing).

Description

  • Add a localAvatarUri field to RecipientExtras in app/src/main/protowire/Database.proto to persist a per-recipient local avatar URI.
  • Add RecipientTable.setLocalAvatarUri(...) in app/src/main/java/org/thoughtcrime/securesms/database/RecipientTable.kt to update the extras blob with the local URI.
  • Expose localAvatarUri() in Recipient.Extras and include it in equality/hash logic, and prefer the local avatar when resolving Recipient.contactPhoto and hasAvatar in app/src/main/java/org/thoughtcrime/securesms/recipients/Recipient.kt so the UI renders the override when present.
  • Extend the nickname editor UI in app/src/main/java/org/thoughtcrime/securesms/nicknames/NicknameActivity.kt to add a document picker flow (using ActivityResultContracts.OpenDocument) that persists read permission and triggers NicknameViewModel.onLocalAvatarChanged(...) on selection or removal, and add onAvatarClick/onRemoveAvatarClick callbacks and visible buttons under the avatar preview.
  • Add NicknameViewModel.onLocalAvatarChanged(...) in app/src/main/java/org/thoughtcrime/securesms/nicknames/NicknameViewModel.kt to persist the local URI via SignalDatabase.recipients.setLocalAvatarUri(...) on a background dispatcher.
  • Add UI strings NicknameActivity__change_photo and NicknameActivity__remove_photo in app/src/main/res/values/strings.xml.

Testing

  • Attempted to compile Kotlin with ./gradlew :app:compileDebugKotlin -x lint -x test, but the build could not run in this environment because JAVA_HOME/java is not available, so no automated build/test run completed.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant