element-hq / element-hq/element-android

Getting custom keys onTimeline updated Snapshot[SDK]

Open
#8,834 1 comment 0 reactions 0 assignees View on GitHub
matrix-sdk
Dominant language
Kotlin
Stars
3.7k
Forks
917
PR merge metrics
No merged PRs in 30d

Description

### Description

I am adding a some custom keys to my message content while sending event, now when I get the message in my `onTimeLineUpdated Listener` there the custom keys are getting removed if the message is a reply to another message.

For eg :-
I am replying to a message with custom key as `attachment` which is list of custom data type.
Here's my json which I send :-
```
"{m.relates_to={m.in_reply_to={event_id=eventId}}, attachments=[{info={mtype=m.image, name=Happy Birthday GIF by Rodney Dangerfield.image/gif, size=0, type=image/gif}, url={content_uri=attachmentUrlHere}}], body=, msgtype=m.text, formatted_body=}"
```

Now, when I get this in `onTimelinUpdate` it removes `attachments` key from the object but when I try to get the TimeLineEvent with :- `roomService?.getRoom(roomId)?.getTimelineEvent(id)` it gives me all the things in my response.

Also in my message if I change `m.relates_to` to any other key like `m.attachment_relates_to` then it works and give all the things as expected.

It only happens in Android Sdk, other then that iOS, Web and others work fine.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.