{{ message }}
Repository navigation
feat(chat): Forward the file of a media viewer message to another conversation - #2774
Open
ToteMeiSter wants to merge 6 commits into
Open
ToteMeiSter wants to merge 6 commits into
ToteMeiSter wants to merge 6 commits into
Conversation
The conditions of the Reply and Delete entries of the message menu move to NCChatMessage, so that other screens, like the media viewer, can ask the same question instead of copying the rules. Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
The media viewer shows "2 of 5" for the pictures and videos of the conversation, with a "+" when older media can still be loaded. A menu offers to save the shown media to Photos, to show all media of the conversation, to show the message in the chat, to reply, to share and to delete. Reply and delete use the same conditions as the message menu of the chat, and a file of a group of files shared together deletes the whole group, like the chat does. Only the chat that opened the viewer allows reply and delete, the viewer opened from the shared items offers neither and shows no counter. A picture can be drawn on from the toolbar, a copy of the file is edited and sent to the conversation. Saving needs NSPhotoLibraryAddUsageDescription. Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
…versation The media viewer gets a "Forward" button. It opens the conversation list and shares the file of the message with the existing files sharing call, so nothing is uploaded again. The path is read from the message object in process. The account of the message is the one used, the account selector is hidden and sending refuses a message of another account. The caption of the file is shown on the confirmation screen and is only sent when shown. Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
… share does Assisted-by: Claude-Code:claude-sonnet-5-5 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
Choose the account that owns the file before listing target conversations. The active account can differ from the message account. Assisted-by: Codex:gpt-6 Signed-off-by: Krainov Gleb <krajnov.g@kontentplus.ru>
1 task done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #2773
Depends on #2772: until it is merged, this PR also shows its two commits. The own commits of this PR are the last four.
What
The media viewer gets a "Forward" button. The file of the shown message is shared into the chosen conversation with the account of the message; nothing is uploaded again.
Before
The toolbar of the viewer held a flexible space and the draw button (NCMediaViewerViewController.swift#L439-L445).
ShareViewControllercould forward a text and an object share (ShareViewController.h#L27-L28);ShareConfirmationViewControllerknew the types text, item and object share (ShareConfirmationViewController.swift#L71).Change
forwardButtonis the first item of the toolbar (L102-L110, L462-L464).canForward(L443-L447) offers it only for a message with a file path of the account of the viewer that is not deleted, not federated and not classified.forwardCurrentMedia(L654-L662) hands a detached copy of the message to the share screen, because the stored one may be gone while the screen is open. It works the same from the chat and from the shared items (the shared items are opened with the account of the room since feat(chat): Add a counter, a menu and actions to the media viewer #2772).ShareViewController(toForwardFile:fromChatViewController:)(ShareViewController.m#L61-L66, .h#L30) and the new type.fileShareofShareConfirmationViewController(L73, shareFileMessage L494). The account is selected from the file message and its selector is hidden (ShareViewController.m#L274-L300, ShareViewController.m#L294).sendFileShare(L828) shares the path from the message object in process (never from outside) with the existingshareFileOrFolder; it refuses a message of another account. The caption is shown on the confirmation screen and sent only when it was shown (forwardedCaption, L518).shareViewControllerDidCancelcloses the share screens (L735); after a successful share the viewer closes and postsNCChatViewControllerForwardNotificationso the chat opens the target conversation, as the chat does for its forwards (L746-L760).Localizable.strings.Test
UnitNCMediaViewerForwardTest: a file of the own account can be forwarded; not a file without a path, not a file of another account, not a deleted message, not a file of a federated room.The account lookup in
ShareViewControllerand the share screens and sending have no unit test: they live in UIKit controllers andshareFileOrFolderis a network call with no seam to run it without a server. Classified rooms are not covered by the test (the capability would have to be faked). Not tested on a device and not checked against a server.CI: https://github.com/ToteMeiSter/talk-ios/actions/runs/39478124619 — Build and Test stable35 passed; 269 tests, 0 failures. The five
UnitNCMediaViewerForwardTestcases passed.🤖 AI (if applicable)
Commit trailers:
🤖 Generated with Claude Code