Merge branch 'develop' into msc4027

This commit is contained in:
Marco Antonio Alvarez 2024-01-04 09:42:23 +01:00 committed by GitHub
commit 639c3495aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 39 additions and 28 deletions

View file

@ -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).`
})

View file

@ -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):

1
changelog.d/1949.bugfix Normal file
View file

@ -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

View file

@ -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(

View file

@ -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
}

View file

@ -39,6 +39,8 @@
<string name="state_event_room_name_changed_by_you">"Změnili jste název místnosti na: %1$s"</string>
<string name="state_event_room_name_removed">"%1$s odstranil(a) název místnosti"</string>
<string name="state_event_room_name_removed_by_you">"Odstranili jste název místnosti"</string>
<string name="state_event_room_none">"%1$s neprovedl(a) žádné změny"</string>
<string name="state_event_room_none_by_you">"Neprovedli jste žádné změny"</string>
<string name="state_event_room_reject">"%1$s pozvánku odmítl(a)"</string>
<string name="state_event_room_reject_by_you">"Odmítli jste pozvání"</string>
<string name="state_event_room_remove">"%1$s odebral(a) %2$s"</string>

View file

@ -39,6 +39,8 @@
<string name="state_event_room_name_changed_by_you">"Vous avez changé le nom du salon en : %1$s"</string>
<string name="state_event_room_name_removed">"%1$s a supprimé le nom du salon"</string>
<string name="state_event_room_name_removed_by_you">"Vous avez supprimé le nom du salon"</string>
<string name="state_event_room_none">"%1$s na fait aucun changement visible"</string>
<string name="state_event_room_none_by_you">"Vous navez fait aucun changement visible"</string>
<string name="state_event_room_reject">"%1$s a rejeté linvitation"</string>
<string name="state_event_room_reject_by_you">"Vous avez refusé linvitation"</string>
<string name="state_event_room_remove">"%1$s a supprimé %2$s"</string>

View file

@ -39,6 +39,8 @@
<string name="state_event_room_name_changed_by_you">"Вы изменили название комнаты на: %1$s"</string>
<string name="state_event_room_name_removed">"%1$s удалил название комнаты"</string>
<string name="state_event_room_name_removed_by_you">"Вы удалили название комнаты"</string>
<string name="state_event_room_none">"%1$s ничего не изменилось"</string>
<string name="state_event_room_none_by_you">"Вы не внесли никаких изменений"</string>
<string name="state_event_room_reject">"%1$s отклонил приглашение"</string>
<string name="state_event_room_reject_by_you">"Вы отклонили приглашение"</string>
<string name="state_event_room_remove">"%1$s удалил %2$s"</string>

View file

@ -39,6 +39,8 @@
<string name="state_event_room_name_changed_by_you">"Zmenili ste názov miestnosti na: %1$s"</string>
<string name="state_event_room_name_removed">"%1$s odstránil/a názov miestnosti"</string>
<string name="state_event_room_name_removed_by_you">"Odstránili ste názov miestnosti"</string>
<string name="state_event_room_none">"%1$s nevykonal/a žiadne zmeny"</string>
<string name="state_event_room_none_by_you">"Nevykonali ste žiadne zmeny"</string>
<string name="state_event_room_reject">"%1$s odmietol/a pozvánku"</string>
<string name="state_event_room_reject_by_you">"Odmietli ste pozvánku"</string>
<string name="state_event_room_remove">"%1$s odstránil/a %2$s"</string>