Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Ordered buffer #55

Merged
merged 15 commits into from
Oct 23, 2018
Merged

Ordered buffer #55

merged 15 commits into from
Oct 23, 2018

Conversation

alphapapa
Copy link
Owner

@alphapapa alphapapa commented Oct 14, 2018

I think this is simpler and more generalized than the old code. Seems to be working well. When you approve, I'll squash and merge.

I think after merging this into client-ng we should probably go ahead and merge client-ng into master. What do you think?

This may not be the best way to do this.  It is simple, and should be
fast enough, but there might be a cleaner way to handle this.
Probably need to refactor a bit, or add some functionality to
ordered-buffer to cleanly handle inserting from both ends.  But this
isn't bad.  The only issue now is that, when inserting old messages, a
new timestamp header is always inserted, even if the timestamp
difference is within the delta setting, which is not necessarily a bad
thing, because it makes it easier to see where the newly fetched
messages are.

It gets a little complicated because, when inserting old messages, if
we insert from the top (which makes sense), we need to insert the
messages in a different order so the prefix-fn looks at the right
event to determine whether to insert a new header.
alphapapa and others added 2 commits October 16, 2018 12:07
Since some clients include newlines between and before and after the
HTML tags, we need a more flexible solution, and esxml is that,
thankfully.
See element-hq/element-ios#2080

Not fully tested yet, so feel free to revert.
@jgkamat
Copy link
Collaborator

jgkamat commented Oct 17, 2018

The client-ng stuff is way past the point of doing a thorough review, and it works pretty well, so I'd recommend just going for it! I've just pushed a legacy-client branch to keep the current master, so people can downgrade if they see issues, but I think it's better to just put everything on master and let people test it, since client-ng is so much better than the old one :)

@@ -235,7 +235,7 @@ If HTML is non-nil, treat input as HTML."
input (concat "> <" sender "> " quoted-body "\n\n" input)
extra-content (a-list 'format format
'formatted_body formatted-body
'm.relates_to (list 'm.in_reply_to (a-list 'event_id event-id))))))
'm.relates_to (a-list 'm.in_reply_to (a-list 'event_id event-id))))))
Copy link
Owner Author

Choose a reason for hiding this comment

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

I was afraid I wasn't doing that right, because I wasn't sure of how the JSON structure mapped to the lists here. Thanks for fixing this while I was AFK. :)

@alphapapa alphapapa merged commit 35c8bc9 into client-ng Oct 23, 2018
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.

2 participants