Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
33909a7
feat(chat): keep the conversation's camera photos in their own folder
Mamel0uk Nov 17, 2026
4399cc8
feat(chat): attach a photo to the draft
Mamel0uk Nov 17, 2026
8be72c2
feat(chat): send a photo with its caption
Mamel0uk Nov 17, 2026
8c3ce26
feat(chat): retry or remove a photo that failed
Mamel0uk Nov 17, 2026
252101c
feat(chat): pick or take a photo in the conversation
Mamel0uk Nov 17, 2026
428e173
feat(chat): show the photos being sent with their upload state
Mamel0uk Nov 18, 2026
7e5b5c1
refactor(chat): drop the photo write callback
Mamel0uk Nov 18, 2026
44580ca
test(chat): cover attaching a photo
Mamel0uk Nov 18, 2026
694e9f6
test(chat): cover sending a photo
Mamel0uk Nov 18, 2026
8cc05e1
test(chat): cover a photo that fails to send
Mamel0uk Nov 18, 2026
e1f66d3
test(chat): cover the photo button and attachment
Mamel0uk Nov 18, 2026
aace41c
test(chat): cover the photos being sent
Mamel0uk Nov 18, 2026
ec6b63b
test(chat): cover the photo menu on the screen
Mamel0uk Nov 18, 2026
41bc999
fix(chat): show a photo once while it is being sent
Mamel0uk Nov 18, 2026
b9ba7e9
fix(chat): rely on the listing observation after a photo fails
Mamel0uk Nov 18, 2026
5604777
fix(chat): don't send a photo while a text is still being sent
Mamel0uk Nov 18, 2026
eade3dc
fix(chat): keep a photo picked or taken while the conversation loads
Mamel0uk Nov 18, 2026
6b012ac
fix(chat): keep the photo being taken when Android kills the app
Mamel0uk Nov 18, 2026
0e5bdb0
fix(chat): let a photo upload finish after leaving the conversation
Mamel0uk Nov 18, 2026
f7f67ae
fix(chat): delete the message of a photo removed after a failed send
Mamel0uk Nov 18, 2026
71c6e19
fix(chat): delete a failed photo's message when leaving the conversation
Mamel0uk Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ interface ChatRepository {
caption: String? = null,
)

/**
* Deletes the signed-in user's photo message with this ID, for a [sendPhoto] that failed and that
* they no longer want sent, so that it does not stay pending for the other participant. Like
* [markRead], the delete is queued without waiting for the server, so it works offline, and it
* never throws: a failure is only logged. The rules only let the sender delete a message whose
* photo is still pending, and refuse to delete one that was never written, which is then only
* logged. The conversation's preview of it stays until the next message.
*/
fun deletePhotoMessage(conversationId: String, messageId: String)

/**
* Downloads the photo of a message, from its [ChatMessage.imagePath], as the signed-in user.
* Fails with PERMISSION_DENIED for a user who is not a participant of the conversation, with an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,15 @@ class FirebaseChatRepository(
storage.reference.child(imagePath).getBytes(PhotoStorage.MAX_PHOTO_BYTES).await()
}

override fun deletePhotoMessage(conversationId: String, messageId: String) {
// Not awaited, like markRead: the delete is queued offline and the listener sees it at once.
conversationDocument(conversationId)
.collection(MESSAGES)
.document(messageId)
.delete()
.addOnFailureListener(Executor { it.run() }) { logWriteFailure(it) }
}

override fun markRead(conversationId: String) {
val uid = auth.currentUser?.uid ?: return
// Not awaited, like sendMessage: the write is queued offline and the listener sees it at once.
Expand Down
Loading
Loading