ement.el icon indicating copy to clipboard operation
ement.el copied to clipboard

Grouped membership event splitting

Open Stebalien opened this issue 2 years ago • 5 comments

With respect to this comment:

https://github.com/alphapapa/ement.el/blob/b8356417ffce3c47cb5b1e2a338d42add17d5f29/ement-room.el#L3023-L3024

I think the answer is that the grouped membership change event needs to get split. I.e.:

  1. Order by earliest/latest, it doesn't matter.
  2. After inserting the new event, check if a grouped membership event immediately before/after (when ordering by earliest/latest) "straddles" the event. If so, split it.

Stebalien avatar May 27 '23 04:05 Stebalien

I don't understand what you mean. And that labels function just returns an EWOC node's data's timestamp for comparison purposes.

alphapapa avatar May 27 '23 21:05 alphapapa

Right now, given a coalesced membership event G spanning timestamps T1-T4, if a new event M is inserted with a timestamp of T2, it will be placed after the coalesced membership event. Instead, G should be split into G1 spanning T1-T2 and G2 spanning T2-T4 with M getting inserted in the middle.

Stebalien avatar May 28 '23 00:05 Stebalien

Sorry, I still don't understand:

  1. AFAIK this already works correctly. (But there may be bugs I'm unaware of, of course.)
  2. Given a coalesced set of events G (note they're a set of events, not an event), if a new membership event M were received whose timestamp falls in the range spanned by G, why would G be split into two sets, rather than just inserting M into that set and re-rendering it?

alphapapa avatar May 28 '23 22:05 alphapapa

I mean if a new message is received, not a new membership event.

For example:

screen

Here, I actually joined after summeremacs posted "worked for me". Specifically:

Message from Korven:      1684858155544
PurplG left:              1684858155939
Message from summeremacs: 1684858158687
Stebalien joined:         1684859990109
Gerogaga joined:          1684863110636

Stebalien avatar May 28 '23 23:05 Stebalien

Ah, yes, thank you. Sorry for being dense there. Yes, I think this is a known (to me, anyway) issue, and it should indeed be fixed.

alphapapa avatar May 28 '23 23:05 alphapapa