Skip to content

open threads via notification#5395

Merged
mahibi merged 3 commits intomasterfrom
feature/3074/improveThreads8
Sep 19, 2025
Merged

open threads via notification#5395
mahibi merged 3 commits intomasterfrom
feature/3074/improveThreads8

Conversation

@mahibi
Copy link
Copy Markdown
Collaborator

@mahibi mahibi commented Sep 19, 2025

This PR will add the possibility to open threads via notification
(while keeping the behavior that backpress in thread that was opened via the threads-list should open the list again)

While it's tempting to do refactoring in the touched code parts, i won't do it now to avoid too many changes regarding the release of 22.0.0

Just some thoughts for later:

  • is overriding handleOnBackPressed with own logic the best solution?

    • take a closer look at Jetpack's Navigation component
    • or should backstack regarding ChatActivity be handled via activity flags again (as intermediate solution if there will be more scenarios to consider?)?
  • MainActivity might be removed in the future (redirecting could be done differently?, it only still exists as remnant from conductor architechture). This will also allow easier backstack handling (e.g. without the openedViaNotification solution in this PR, the old code

                if (isChatThread()) {
                    isEnabled = false
                    onBackPressedDispatcher.onBackPressed()
                } 
    

    ended up in showing the MainActivity (which should never be displayed besides when redirecting).

  • NotificationWorker needs to be refactored. E.g. passing intents/bundles through the whole class is confusing...

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔖 Capability is checked or not needed
  • 🔙 Backport requests are created or not needed: /backport to stable-xx.x
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

although it's not a nice solution to pass around and modify the intent, i will stick with this to avoid too many changes before the 22.0.0 release

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
fix: when opened via notification, backpress will now open chat instead bluescreen from MainActivity

modify: this will affect that backpress from thread after coming from threadlist will open the chat, which is not expected

to be improved...

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
only when coming from notification and backpress is done in a thread, then open the conversationlist

Introducing the extra openedViaNotification for this is not a nice solution. But for release of 22.0.0 greater changes should be avoided.

Best might be for take care of the backstack completely by activities intent flags instead to override handleOnBackPressed

Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
@mahibi mahibi added this to the 23.0.0 milestone Sep 19, 2025
@mahibi mahibi self-assigned this Sep 19, 2025
@mahibi mahibi added the 3. to review Waiting for reviews label Sep 19, 2025
@mahibi mahibi changed the title Feature/3074/improve threads8 open threads via notification Sep 19, 2025
@mahibi
Copy link
Copy Markdown
Collaborator Author

mahibi commented Sep 19, 2025

/backport to stable-22.0

@github-actions
Copy link
Copy Markdown
Contributor

Codacy

Lint

TypemasterPR
Warnings9999
Errors00

SpotBugs

CategoryBaseNew
Bad practice66
Correctness1111
Dodgy code6262
Internationalization33
Malicious code vulnerability33
Performance44
Security11
Total9090

@github-actions
Copy link
Copy Markdown
Contributor

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/5395.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@mahibi mahibi merged commit ed01b3a into master Sep 19, 2025
19 checks passed
@mahibi mahibi deleted the feature/3074/improveThreads8 branch September 19, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Message threads

2 participants