mirror of
https://github.com/chatmail/core.git
synced 2026-04-29 11:26:29 +03:00
feat: Resend the last 10 messages to new broadcast member (#8151)
Last 10 messages in a broadcast channel are resent. They are sent and encrypted only to the new member, not to other subscribers. Close #7678 Based on https://github.com/chatmail/core/pull/7854, with the following changes: - Refactor and simplify code, don't reuse the existing `get_chat_msgs()` function - Document that Param::Arg4 is also used for resent messagescc818d9099- It's unclear how exactly to resend webxdc status updates. After discussing with @r10s, don't resend webxdc's at all for now.38d57ebb30- Don't set fake `msg_id` in resent messagese7d0687d90Setting the msg_id to `u32::MAX` is hacky, and may just as well break things as it may fix things, because some code may use the msg.id to load information from the database, like `get_iroh_topic_for_msg()`. From reading the code, I couldn't find any problem with leaving the correct `msg_id`, and if there is one, then we should add a function parameter `is_resending` that is checked in the corresponding places. Easiest to review file-by-file rather than individual commits, probably. I'll squash-merge this. --------- Co-authored-by: iequidoo <dgreshilov@gmail.com>
This commit is contained in:
@@ -244,6 +244,9 @@ Here is what to do:
|
||||
|
||||
If you have any questions, please send an email to delta@merlinux.eu or ask at https://support.delta.chat/."#;
|
||||
|
||||
/// How many recent messages should be re-sent to a new broadcast member.
|
||||
pub(crate) const N_MSGS_TO_NEW_BROADCAST_MEMBER: usize = 10;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use num_traits::FromPrimitive;
|
||||
|
||||
Reference in New Issue
Block a user