fix: Set GroupNameTimestamp on group promotion (#6729)

Otherwise if an invite link is generated and the group is renamed then before the promotion, the
joined member will have the group name from the invite link, not the new one.
This commit is contained in:
iequidoo
2025-04-03 03:08:29 -03:00
committed by iequidoo
parent 66e3dc7226
commit 89a73d775e
4 changed files with 33 additions and 5 deletions

View File

@@ -2063,7 +2063,9 @@ impl Chat {
&& self.param.get_int(Param::Unpromoted).unwrap_or_default() == 1
{
msg.param.set_int(Param::AttachGroupImage, 1);
self.param.remove(Param::Unpromoted);
self.param
.remove(Param::Unpromoted)
.set_i64(Param::GroupNameTimestamp, timestamp);
self.update_param(context).await?;
// TODO: Remove this compat code needed because Core <= v1.143:
// - doesn't accept synchronization of QR code tokens for unpromoted groups, so we also
@@ -3917,7 +3919,9 @@ pub(crate) async fn add_contact_to_chat_ex(
let sync_qr_code_tokens;
if from_handshake && chat.param.get_int(Param::Unpromoted).unwrap_or_default() == 1 {
chat.param.remove(Param::Unpromoted);
chat.param
.remove(Param::Unpromoted)
.set_i64(Param::GroupNameTimestamp, smeared_time(context));
chat.update_param(context).await?;
sync_qr_code_tokens = true;
} else {