-
-
Notifications
You must be signed in to change notification settings - Fork 129
fix: Update the channel title after joining if the QR code included a wrong title #8260
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
base: main
Are you sure you want to change the base?
Changes from all commits
6c617f4
64a3c81
1d2d962
eb65880
5dee638
76b28bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1782,9 +1782,7 @@ impl Chat { | |
| ); | ||
| bail!("Cannot set message, contact for {} not found.", self.id); | ||
| } | ||
| } else if matches!(self.typ, Chattype::Group | Chattype::OutBroadcast) | ||
| && self.param.get_int(Param::Unpromoted).unwrap_or_default() == 1 | ||
| { | ||
| } else if self.param.get_int(Param::Unpromoted).unwrap_or_default() == 1 { | ||
| msg.param.set_int(Param::AttachChatAvatarAndDescription, 1); | ||
| self.param | ||
| .remove(Param::Unpromoted) | ||
|
|
@@ -3626,9 +3624,6 @@ pub(crate) async fn create_group_ex( | |
| /// because the word "channel" already appears a lot in the code, | ||
| /// which would make it hard to grep for it. | ||
| /// | ||
| /// After creation, the chat contains no recipients and is in _unpromoted_ state; | ||
| /// see [`create_group`] for more information on the unpromoted state. | ||
| /// | ||
| /// Returns the created chat's id. | ||
| pub async fn create_broadcast(context: &Context, chat_name: String) -> Result<ChatId> { | ||
| let grpid = create_id(); | ||
|
|
@@ -3660,17 +3655,20 @@ pub(crate) async fn create_out_broadcast_ex( | |
| |row| row.get(0), | ||
| )?; | ||
| ensure!(cnt == 0, "{cnt} chats exist with grpid {grpid}"); | ||
| let mut params: Params = Params::new(); | ||
| params.update_timestamp(Param::GroupNameTimestamp, time())?; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not clear why this is needed for broadcasts, but not for groups. Why doesn't
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because of
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then the check in /// After creation, the chat contains no recipients and is in _unpromoted_ state;
Should be fixed as well. But the reason why for groups
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Good catch!
Actually there is no need at all to check for the chat type there, I will just remove that check.
The logic is already different, and in separate functions, but either way of fixing this would be fine (it's a very small bug in the first place). |
||
|
|
||
| t.execute( | ||
| "INSERT INTO chats | ||
| (type, name, name_normalized, grpid, created_timestamp) | ||
| VALUES(?, ?, ?, ?, ?)", | ||
| (type, name, name_normalized, grpid, created_timestamp, param) | ||
| VALUES(?, ?, ?, ?, ?, ?)", | ||
| ( | ||
| Chattype::OutBroadcast, | ||
| &chat_name, | ||
| normalize_text(&chat_name), | ||
| &grpid, | ||
| timestamp, | ||
| params.to_string(), | ||
| ), | ||
| )?; | ||
| let chat_id = ChatId::new(t.last_insert_rowid().try_into()?); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then maybe add
ensure_and_debug_assert!here that this is aGroupbecause below group-related params are set?