Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor transmitted-messages code #110

Merged
merged 1 commit into from
Mar 17, 2016
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Mar 17, 2016

This is some preparatory work for fixing up the problems with the timeline ordering of unsent messages
(element-hq/element-web#1120). The functional changes here should be minimal (bar an extra Room.localEchoUpdated when the local echo is first added to the timeline).

Give MatrixClient.sendEvent its own entry point Room.addPendingMessage instead of pushing it through addEventsToTimeline; this considerably simplifies the implementation of the latter and also means that we can contain the _txnId ming to MatrixClient.

Move the code which deals with a successful /send response from MatrixClient into Room.updatePendingEvent, since it involves fiddling with the innards of the Room.

Also adds a new EventStatus 'SENT' for events which have been successfully sent but whose remote echo we still haven't received.

This is some preparatory work for fixing up the problems with te timeline
ordering of unsent messages
(element-hq/element-web#1120). The functional changes
here should be minimal (bar an extra `Room.localEchoUpdated` when the local
echo is first added to the timeline).

Give `MatrixClient.sendEvent` its own entry point `Room.addPendingMessage`
instead of pushing it through `addEventsToTimeline`; this considerably
simplifies the implementation of the latter and also means that we can contain
the `_txnId` ming to MatrixClient.

Move the code which deals with a successful `/send` response from
`MatrixClient` into `Room.updatePendingEvent`, since it involves fiddling with
the innards of the Room.

Also adds a new EventStatus 'SENT' for events which have been successfully sent
but whose remote echo we still haven't received.
@dbkr
Copy link
Member

dbkr commented Mar 17, 2016

lgtm

@dbkr dbkr assigned richvdh and unassigned dbkr Mar 17, 2016
richvdh added a commit that referenced this pull request Mar 17, 2016
@richvdh richvdh merged commit fdbc7a3 into develop Mar 17, 2016
@richvdh richvdh deleted the rav/refactor_remote_echo branch March 17, 2016 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants