Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

MXKRoomBubbleCellDataStoring: Introduce target user ID, display name and avatar URL for room membership events #793

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Mar 25, 2021

As reported in element-hq/element-ios#4102, collapsed membership changes in the Element iOS app currently always display the sender avatar. In contrast, the Element web app shows the avatar of the user whose membership has changed in this case.

This commit introduces new properties targetId, targetDisplayName, targetAvatarUrl and targetAvatarPlaceholder on MXKRoomBubbleCellDataStoring. The values are populated from the event (in case it is an m.room.member event) in the initializer of MXKRoomBubbleCellData (where the corresponding sender properties are already being assigned). This way, clients can easily choose to present the target avatar instead of the sender avatar when processing the bubble data.

Note that the "target" terminology was taken over from matrix-js-sdk which populates the target property on MatrixEvent objects when they are added to the timeline.

Signed-off-by: Johannes Marbach n0-0ne+github@mailbox.org

Pull Request Checklist

  • Pull request is based on the develop branch
  • Pull request updates CHANGES.rst
  • Pull request includes a sign off

…and avatar URL for room membership events

As reported in vector-im/element-ios/#4102, collapsed membership changes in the Element iOS app
currently _always_ display the sender avatar. In contrast, the Element web app shows the avatar of
the user whose membership has changed in this case.

This commit introduces new properties `targetId`, `targetDisplayName`, `targetAvatarUrl` and
`targetAvatarPlaceholder` on `MXKRoomBubbleCellDataStoring`. The values are populated from the
event (in case it is an `m.room.member` event) in the initializer of `MXKRoomBubbleCellData`
(where the corresponding sender properties are already being assigned). This way, clients can
easily choose to present the target avatar instead of the sender avatar when processing the
bubble data.

Note that the "target" terminology was taken over from matrix-js-sdk which populates the
`target` property on `MatrixEvent` objects when they are added to the timeline.

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Johennes added a commit to Johennes/element-ios that referenced this pull request Mar 25, 2021
This commit switches to displaying the target user's avatar for collapsed membership
changes which addresses the avatar issue reported in element-hq#4102.

Depends on: matrix-org/matrix-ios-kit#793

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Johennes added a commit to Johennes/element-ios that referenced this pull request Mar 26, 2021
This commit switches to displaying the target user's avatar for collapsed membership
changes which addresses the avatar issue reported in element-hq#4102.

Depends on: matrix-org/matrix-ios-kit#793

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
@manuroe
Copy link
Contributor

manuroe commented Apr 9, 2021

This is awesome. Thanks!

@manuroe manuroe merged commit 726e2e1 into matrix-org:develop Apr 9, 2021
stefanceriu pushed a commit to element-hq/element-ios that referenced this pull request Feb 7, 2022
This commit switches to displaying the target user's avatar for collapsed membership
changes which addresses the avatar issue reported in #4102.

Depends on: matrix-org/matrix-ios-kit#793

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
stefanceriu pushed a commit to element-hq/element-ios that referenced this pull request Feb 7, 2022
This commit switches to displaying the target user's avatar for collapsed membership
changes which addresses the avatar issue reported in #4102.

Depends on: matrix-org/matrix-ios-kit#793

Signed-off-by: Johannes Marbach <n0-0ne+github@mailbox.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants