Repository navigation
Conversation
Reviewer's GuideThe export-settings backup flow now opens Telegram’s native ShareAlert instead of invoking the generic ShareUtil helper, sends the generated JSON file to selected chats with forum-topic support, and displays a themed success bulletin while routing broader failures through the existing alert handler. Sequence diagram for export settings sharingsequenceDiagram
participant User
participant NekoSettingsActivity
participant ShareAlert
participant SendMessagesHelper
participant BulletinFactory
User->>NekoSettingsActivity: backupSettings()
NekoSettingsActivity->>NekoSettingsActivity: backupSettingsJson()
NekoSettingsActivity->>ShareAlert: showDialog(shareAlert)
User->>ShareAlert: select chats and send
ShareAlert->>NekoSettingsActivity: onSend(dids, count, topic, showToast)
loop selected dialogs
NekoSettingsActivity->>SendMessagesHelper: prepareSendingDocument(..., did, replyTopMsg, ...)
end
opt showToast
NekoSettingsActivity->>BulletinFactory: createInviteSentBulletin(...)
BulletinFactory-->>User: show success bulletin
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java" line_range="283" />
<code_context>
FileUtil.writeUtf8String(backupSettingsJson(), cacheFile);
- ShareUtil.shareFile(getParentActivity(), cacheFile);
- } catch (JSONException e) {
+ ShareAlert shareAlert = new ShareAlert(getParentActivity(), null, null, false, null, false) {
+ @Override
+ protected void onSend(LongSparseArray<TLRPC.Dialog> dids, int count, TLRPC.TL_forumTopic topic, boolean showToast) {
</code_context>
<issue_to_address>
**Export sends nothing**
When the user selects chats and taps Send in the export dialog, `ShareAlert` receives null messages and null text, so `sendInternal` skips the content branches and never calls the overridden `onSend`; `prepareSendingDocument` is never reached and no file is sent.
Make the document-only export invoke `onSend` for the selected chats.
</issue_to_address>
### Comment 2
<location path="TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java" line_range="300" />
<code_context>
+ getAccountInstance(),
+ cacheFile.getAbsolutePath(),
+ cacheFile.getAbsolutePath(),
+ null,
+ null,
+ "application/json",
</code_context>
<issue_to_address>
**Share comments are discarded**
When the user adds a comment in the share dialog, the document is sent with a null caption and the callback never reads the share dialog’s comment, so recipients get the file without any comment the user typed.
Include the entered comment in the document send or send it as a separate message, matching the native share dialog’s comment behavior.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 2 findings to address first, and the backup file is now sent as a document into selected Telegram dialogs, so an implementation mistake could expose settings data or deliver it to the wrong recipients. Reverting stops future sends but cannot retract files or messages already delivered.
Blocking findings: TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java:283, TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java:300
| FileUtil.writeUtf8String(backupSettingsJson(), cacheFile); | ||
| ShareUtil.shareFile(getParentActivity(), cacheFile); | ||
| } catch (JSONException e) { | ||
| ShareAlert shareAlert = new ShareAlert(getParentActivity(), null, null, false, null, false) { |
There was a problem hiding this comment.
🟠 High · Export sends nothing
When the user selects chats and taps Send in the export dialog, ShareAlert receives null messages and null text, so sendInternal skips the content branches and never calls the overridden onSend; prepareSendingDocument is never reached and no file is sent.
Make the document-only export invoke onSend for the selected chats.
Prompt for AI agents
In `TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java` at line 283:
**Export sends nothing**
When the user selects chats and taps Send in the export dialog, `ShareAlert` receives null messages and null text, so `sendInternal` skips the content branches and never calls the overridden `onSend`; `prepareSendingDocument` is never reached and no file is sent.
Make the document-only export invoke `onSend` for the selected chats.| cacheFile.getAbsolutePath(), | ||
| cacheFile.getAbsolutePath(), | ||
| null, | ||
| null, |
There was a problem hiding this comment.
🟡 Medium · Share comments are discarded
When the user adds a comment in the share dialog, the document is sent with a null caption and the callback never reads the share dialog’s comment, so recipients get the file without any comment the user typed.
Include the entered comment in the document send or send it as a separate message, matching the native share dialog’s comment behavior.
Prompt for AI agents
In `TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoSettingsActivity.java` at line 300:
**Share comments are discarded**
When the user adds a comment in the share dialog, the document is sent with a null caption and the callback never reads the share dialog’s comment, so recipients get the file without any comment the user typed.
Include the entered comment in the document send or send it as a separate message, matching the native share dialog’s comment behavior.|
This makes the method complicated and unnecessary. |
Improved the style of the dialog.
Summary by Sourcery
Replace the export settings file share flow with an integrated Telegram share dialog.
New Features:
Enhancements: