Skip to content

Expose if the room has a custom avatar#9423

Merged
nickvergessen merged 19 commits intomasterfrom
bugfix/9320/expose-if-is-custom-avatar
May 4, 2023
Merged

Expose if the room has a custom avatar#9423
nickvergessen merged 19 commits intomasterfrom
bugfix/9320/expose-if-is-custom-avatar

Conversation

@vitormattos
Copy link
Contributor

Fixes to be able identify if have a custom avatar

  • Added the property isCustomAvatar to conversation object
  • Return every time a non empty string as avatarVersion

☑️ Resolves

🏁 Checklist

@vitormattos vitormattos added 3. to review feature: api 🛠️ OCS API for conversations, chats and participants php labels May 2, 2023
@vitormattos vitormattos added this to the 💙 Next Major (27) milestone May 2, 2023
@vitormattos vitormattos self-assigned this May 2, 2023
Copy link
Contributor

@SystemKeeper SystemKeeper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works besides small remarks

vitormattos added a commit that referenced this pull request May 2, 2023
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
vitormattos added a commit that referenced this pull request May 2, 2023
#9423 (comment)
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
Copy link
Contributor

@SystemKeeper SystemKeeper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@mahibi
Copy link

mahibi commented May 2, 2023

what happens if an emoji is set (as implemented in #9424 )?
will isCustomAvatar be true or false?

for the android talk app, it would be great if it's true for this case

@vitormattos
Copy link
Contributor Author

We will need to do changes after merge this or #9424 but we can set isCustomAvatar to true when the avatar of room need to be an emoji.

@nickvergessen I think that will be best to merge your PR first and after this I will rebase this PR and implement the necessary to solve the @mahibi point.

@SystemKeeper
Copy link
Contributor

what happens if an emoji is set (as implemented in #9424 )? will isCustomAvatar be true or false?

for the android talk app, it would be great if it's true for this case

We agreed to not do this ;)

* Added the header X-NC-IsCustomAvatar
* Return every time a non empty string as avatarVersion

Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
When we retrieve the room avatar sometimes is necessary to check if the file
exists and in other places we only need to get the avatar file name.
With this refactor I separated the logic to get the path of file in a
different method.

Signed-off-by: Vitor Mattos <vitor@php.rio>
…tomAvatar

With the header isn't possible to check if `isCustomAvatar` without
retrieve the avatar to verify the header. Because this, isCUstomAvatar
was moved to a conversation property.

Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
#9423 (comment)
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
@vitormattos vitormattos force-pushed the bugfix/9320/expose-if-is-custom-avatar branch from 6e34509 to 0ce2366 Compare May 3, 2023 09:27
@vitormattos
Copy link
Contributor Author

Rebased to solve conflicts.

@vitormattos vitormattos requested a review from nickvergessen May 3, 2023 09:39
Didn't make sense to return true because this property is only used to
display the trash icon to remove the customized avatar.

Signed-off-by: Vitor Mattos <vitor@php.rio>
Signed-off-by: Vitor Mattos <vitor@php.rio>
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
@nickvergessen nickvergessen changed the title Expose if the room have a custom avatar Expose if the room has a custom avatar May 3, 2023
#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
@vitormattos vitormattos requested a review from nickvergessen May 3, 2023 13:24
Signed-off-by: Vitor Mattos <vitor@php.rio>
@vitormattos vitormattos force-pushed the bugfix/9320/expose-if-is-custom-avatar branch from 15c8bf3 to 6659f1b Compare May 3, 2023 14:43
@vitormattos vitormattos requested a review from nickvergessen May 3, 2023 14:43
Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen enabled auto-merge May 3, 2023 20:41
@nickvergessen
Copy link
Member

Failed scenarios:

/drone/server/apps/spreed/tests/integration/features/integration/dashboard.feature:11

I prefered to put a placeholder at URL from step to make splicit that
the URL have a version at the place of placeholder.

Signed-off-by: Vitor Mattos <vitor@php.rio>
@nickvergessen nickvergessen merged commit 31082f9 into master May 4, 2023
@nickvergessen nickvergessen deleted the bugfix/9320/expose-if-is-custom-avatar branch May 4, 2023 08:35
mishamosher pushed a commit to mishamosher/spreed that referenced this pull request May 16, 2023
nextcloud#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
mishamosher pushed a commit to mishamosher/spreed that referenced this pull request May 16, 2023
mishamosher pushed a commit to mishamosher/spreed that referenced this pull request May 16, 2023
mishamosher pushed a commit to mishamosher/spreed that referenced this pull request May 16, 2023
nextcloud#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
mishamosher pushed a commit to mishamosher/spreed that referenced this pull request May 16, 2023
nextcloud#9423 (comment)

Signed-off-by: Vitor Mattos <vitor@php.rio>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: api 🛠️ OCS API for conversations, chats and participants php

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AvatarVersion should be populated for all conversation types

4 participants