Skip to content

Fix instant crash when using message translation option#13

Merged
Rocket-Space merged 1 commit intomasterfrom
codex/fix-app-crash-on-translate-option
Feb 25, 2026
Merged

Fix instant crash when using message translation option#13
Rocket-Space merged 1 commit intomasterfrom
codex/fix-app-crash-on-translate-option

Conversation

@Rocket-Space
Copy link
Owner

Motivation

  • Fix a crash caused by a payload mismatch when posting NotificationCenter.messageTranslated, which produced a ClassCastException: java.lang.Long cannot be cast to org.telegram.messenger.MessageObject in ChatActivity.didReceivedNotification.
  • ChatActivity expects the first messageTranslated argument to be a MessageObject (with optional booleans after it), while the translator was sending dialogId and messageId (Longs).

Description

  • Changed TranslationHelper to post NotificationCenter.messageTranslated with the MessageObject and the two boolean flags instead of (dialogId, messageId) for the inline translation completion path in TMessagesProj/src/main/java/org/spacegram/translator/TranslationHelper.java.
  • Applied the same payload shape when clearing a translation in TranslationHelper.clearTranslation(...) so both code paths follow the contract expected by ChatActivity.
  • The fix is contained in the single modified file TMessagesProj/src/main/java/org/spacegram/translator/TranslationHelper.java and has been committed.

Testing

  • Attempted to compile Java sources with ./gradlew :TMessagesProj:compileDebugJavaWithJavac -x lint, but the build could not run in this environment due to a Gradle/JDK incompatibility (Unsupported class file major version 69), so automated compilation did not complete successfully.

Codex Task

@Rocket-Space Rocket-Space merged commit 13640ea into master Feb 25, 2026
1 check passed
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