diff --git a/.github/workflows/fork-pr-notice.yml b/.github/workflows/fork-pr-notice.yml index dd697915f7..42b1e54c3f 100644 --- a/.github/workflows/fork-pr-notice.yml +++ b/.github/workflows/fork-pr-notice.yml @@ -11,9 +11,10 @@ jobs: welcome: runs-on: ubuntu-latest name: Welcome comment + if: github.event.pull_request.fork != null steps: - name: Add auto-generated commit warning - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: script: | github.rest.issues.createComment({ @@ -22,9 +23,9 @@ jobs: repo: context.repo.repo, body: `Thank you for your contribution! Here are a few things to check in the PR to ensure it's reviewed as quickly as possible: - - Your branch should be based on `origin/develop`, at least when it was created. - - There is a changelog entry in the `changelog.d` folder with [the Towncrier format](https://towncrier.readthedocs.io/en/latest/tutorial.html#creating-news-fragments). - - The test pass locally running `./gradlew test`. - - The code quality check suite pass locally running `./gradlew runQualityChecks`. - - If you modified anything related to the UI, including previews, you'll have to run the `Record screenshots` GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, **it will prevent the CI from running temporarily**, until you upload a new commit after that one. To do so, just pull the latest changes and push [an empty commit](https://coderwall.com/p/vkdekq/git-commit-allow-empty).` + - Your branch should be based on \`origin/develop\`, at least when it was created. + - There is a changelog entry in the \`changelog.d\` folder with [the Towncrier format](https://towncrier.readthedocs.io/en/latest/tutorial.html#creating-news-fragments). + - The test pass locally running \`./gradlew test\`. + - The code quality check suite pass locally running \`./gradlew runQualityChecks\`. + - If you modified anything related to the UI, including previews, you'll have to run the \`Record screenshots\` GH action in your forked repo: that will generate compatible new screenshots. However, given Github Actions limitations, **it will prevent the CI from running temporarily**, until you upload a new commit after that one. To do so, just pull the latest changes and push [an empty commit](https://coderwall.com/p/vkdekq/git-commit-allow-empty).` }) diff --git a/.github/workflows/maestro.yml b/.github/workflows/maestro.yml index 3b52235fb5..0e2dc74b92 100644 --- a/.github/workflows/maestro.yml +++ b/.github/workflows/maestro.yml @@ -24,31 +24,31 @@ jobs: cancel-in-progress: true steps: - name: Remove Run-Maestro label - if: ${{ !github.event.pull_request.fork && github.event.label.name == 'Run-Maestro' }} + if: ${{ github.event_name == 'pull_request' && github.event.label.name == 'Run-Maestro' }} uses: actions-ecosystem/action-remove-labels@v1 with: labels: Run-Maestro - uses: actions/checkout@v4 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: # Ensure we are building the branch and not the branch after being merged on develop # https://github.com/actions/checkout/issues/881 ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} - uses: actions/setup-java@v4 name: Use JDK 17 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: distribution: 'temurin' # See 'Supported distributions' for available options java-version: '17' - name: Assemble debug APK run: ./gradlew :app:assembleDebug $CI_GRADLE_ARG_PROPERTIES - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' env: ELEMENT_ANDROID_MAPTILER_API_KEY: ${{ secrets.MAPTILER_KEY }} ELEMENT_ANDROID_MAPTILER_LIGHT_MAP_ID: ${{ secrets.MAPTILER_LIGHT_MAP_ID }} ELEMENT_ANDROID_MAPTILER_DARK_MAP_ID: ${{ secrets.MAPTILER_DARK_MAP_ID }} - uses: mobile-dev-inc/action-maestro-cloud@v1.8.0 - if: ${{ !github.event.pull_request.fork }} + if: (github.event_name == 'pull_request' && github.event.pull_request.fork == null) || github.event_name == 'workflow_dispatch' with: api-key: ${{ secrets.MAESTRO_CLOUD_API_KEY }} # Doc says (https://github.com/mobile-dev-inc/action-maestro-cloud#android): diff --git a/changelog.d/1949.bugfix b/changelog.d/1949.bugfix new file mode 100644 index 0000000000..a49aff7545 --- /dev/null +++ b/changelog.d/1949.bugfix @@ -0,0 +1 @@ +Make sure the media viewer tries the main url first (if not empty) then the thumbnail url and then not open if both are missing instead of failing with an error dialog diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesFlowNode.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesFlowNode.kt index 9f0a91fa52..7343e56529 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesFlowNode.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/MessagesFlowNode.kt @@ -255,17 +255,21 @@ class MessagesFlowNode @AssistedInject constructor( overlay.show(navTarget) } is TimelineItemStickerContent -> { - val navTarget = NavTarget.MediaViewer( - mediaInfo = MediaInfo( - name = event.content.body, - mimeType = event.content.mimeType, - formattedFileSize = event.content.formattedFileSize, - fileExtension = event.content.fileExtension - ), - mediaSource = event.content.mediaSource, - thumbnailSource = event.content.thumbnailSource, - ) - overlay.show(navTarget) + /* Sticker may have an empty url and no thumbnail + if encrypted on certain bridges */ + if (event.content.preferredMediaSource != null) { + val navTarget = NavTarget.MediaViewer( + mediaInfo = MediaInfo( + name = event.content.body, + mimeType = event.content.mimeType, + formattedFileSize = event.content.formattedFileSize, + fileExtension = event.content.fileExtension + ), + mediaSource = event.content.preferredMediaSource, + thumbnailSource = event.content.thumbnailSource, + ) + overlay.show(navTarget) + } } is TimelineItemVideoContent -> { val navTarget = NavTarget.MediaViewer( diff --git a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemStickerContent.kt b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemStickerContent.kt index e608ed824a..9c8070ecc9 100644 --- a/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemStickerContent.kt +++ b/features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/model/event/TimelineItemStickerContent.kt @@ -16,7 +16,6 @@ package io.element.android.features.messages.impl.timeline.model.event -import io.element.android.libraries.core.mimetype.MimeTypes import io.element.android.libraries.matrix.api.media.MediaSource data class TimelineItemStickerContent( @@ -33,9 +32,7 @@ data class TimelineItemStickerContent( ) : TimelineItemEventContent { override val type: String = "TimelineItemStickerContent" - val preferredMediaSource = if (mimeType == MimeTypes.Gif) { - mediaSource - } else { - thumbnailSource ?: mediaSource - } + /* Stickers are supposed to be small images so + we allow using the mediaSource (unless the url is empty) */ + val preferredMediaSource = if (mediaSource.url.isEmpty()) thumbnailSource else mediaSource } diff --git a/libraries/eventformatter/impl/src/main/res/values-cs/translations.xml b/libraries/eventformatter/impl/src/main/res/values-cs/translations.xml index 69179b1276..ecbe8031b9 100644 --- a/libraries/eventformatter/impl/src/main/res/values-cs/translations.xml +++ b/libraries/eventformatter/impl/src/main/res/values-cs/translations.xml @@ -39,6 +39,8 @@ "Změnili jste název místnosti na: %1$s" "%1$s odstranil(a) název místnosti" "Odstranili jste název místnosti" + "%1$s neprovedl(a) žádné změny" + "Neprovedli jste žádné změny" "%1$s pozvánku odmítl(a)" "Odmítli jste pozvání" "%1$s odebral(a) %2$s" diff --git a/libraries/eventformatter/impl/src/main/res/values-fr/translations.xml b/libraries/eventformatter/impl/src/main/res/values-fr/translations.xml index f7c12a2028..be8f466aa3 100644 --- a/libraries/eventformatter/impl/src/main/res/values-fr/translations.xml +++ b/libraries/eventformatter/impl/src/main/res/values-fr/translations.xml @@ -39,6 +39,8 @@ "Vous avez changé le nom du salon en : %1$s" "%1$s a supprimé le nom du salon" "Vous avez supprimé le nom du salon" + "%1$s n‘a fait aucun changement visible" + "Vous n‘avez fait aucun changement visible" "%1$s a rejeté l’invitation" "Vous avez refusé l’invitation" "%1$s a supprimé %2$s" diff --git a/libraries/eventformatter/impl/src/main/res/values-ru/translations.xml b/libraries/eventformatter/impl/src/main/res/values-ru/translations.xml index 4c1defbb68..7930c496dc 100644 --- a/libraries/eventformatter/impl/src/main/res/values-ru/translations.xml +++ b/libraries/eventformatter/impl/src/main/res/values-ru/translations.xml @@ -39,6 +39,8 @@ "Вы изменили название комнаты на: %1$s" "%1$s удалил название комнаты" "Вы удалили название комнаты" + "%1$s ничего не изменилось" + "Вы не внесли никаких изменений" "%1$s отклонил приглашение" "Вы отклонили приглашение" "%1$s удалил %2$s" diff --git a/libraries/eventformatter/impl/src/main/res/values-sk/translations.xml b/libraries/eventformatter/impl/src/main/res/values-sk/translations.xml index 13722a3318..1987a2d333 100644 --- a/libraries/eventformatter/impl/src/main/res/values-sk/translations.xml +++ b/libraries/eventformatter/impl/src/main/res/values-sk/translations.xml @@ -39,6 +39,8 @@ "Zmenili ste názov miestnosti na: %1$s" "%1$s odstránil/a názov miestnosti" "Odstránili ste názov miestnosti" + "%1$s nevykonal/a žiadne zmeny" + "Nevykonali ste žiadne zmeny" "%1$s odmietol/a pozvánku" "Odmietli ste pozvánku" "%1$s odstránil/a %2$s"