-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support inserting messages out-of-order by timestamp? #322
Comments
Hello, and thanks for the suggestion! Support for deletion of messages is rather new, and introduced the message ID concept at all. I don't see a reason not to support updating or out of order insertion now as well. :-) |
Thanks, that sounds great. About deduplication, if you are interested in that: I guess scanning a large buffer of messages for a text-property with a certain value might get slower over time, as the buffer grows, so perhaps a hash-table could optionally be used for deduplication as well. |
Hm. If you add that, make sure it's an optional feature, since many applications do not use it at all. That might even be something for the user of lui, not lui itself, to handle. I.e. lui provides |
FYI we've added this feature to The issue of scanning the whole buffer for message IDs is mitigated by using date headers and message timestamps, so after finding the correct place to insert a message (go to correct header, then go to correct timestamp position before the next header), only the following message ID needs to be compared. |
Could be useful for: |
Hi,
We're looking into using LUI for our Matrix client: alphapapa/matrix-client.el#15 However, Matrix messages need to be deduplicated by message ID and inserted in order by timestamp, e.g. when resyncing with a room or loading earlier messages. LUI already supports timestamps and messages IDs, but the insertion function seems to just insert new messages at the end of the buffer.
Would you be open to enhancing LUI to support insertion by timestamp, and conditionally on whether a message ID already exists in the buffer? Maybe the insertion function could be set with a variable so we could just rewrite that function for our own use, binding to our function around our code that calls LUI functions.
Thanks.
The text was updated successfully, but these errors were encountered: