Skip to content
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

feat: Remove subject prefix from ad-hoc group names (#5385) #5693

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

iequidoo
Copy link
Collaborator

Just a small improvement while looking at #5385. See commit messages.

src/stock_str.rs Outdated
@@ -443,6 +443,9 @@ pub enum StockMessage {
fallback = "Could not yet establish guaranteed end-to-end encryption, but you may already send a message."
))]
SecurejoinWaitTimeout = 191,

#[strum(props(fallback = "Unnamed group"))]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, i'd suggest to make it "👥📧" or even "..." not to translate it. Not a frequent case anyway

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me, the less stock strings we need to "carry around" the better

Copy link
Collaborator Author

@iequidoo iequidoo Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I think 👥📧 is the better option. I'd even say it is nicer than any black-on-white text

@iequidoo iequidoo marked this pull request as ready for review June 16, 2024 18:59
@gerryfrancis
Copy link
Contributor

@iequidoo Thank you for your engagement! Unfortunately I am no programmer, therefore i cannot review the code. Please let someone else review it, thanks! :)

@iequidoo
Copy link
Collaborator Author

@iequidoo Thank you for your engagement! Unfortunately I am no programmer, therefore i cannot review the code. Please let someone else review it, thanks! :)

You can review the behaviour described in the commit messages :) So, in the #5385 scenario after merging this you will have two chats with the same name. Then we can think how to merge them into one (i'd suggest to merge chats with the same names and participants, but it's outside of this PR's scope)

@gerryfrancis
Copy link
Contributor

You can review the behaviour described in the commit messages :)

@iequidoo I can do that, of course, as soon as I have an APK to test with. 👍

@iequidoo iequidoo requested review from Hocuri and link2xt June 18, 2024 16:07
Comment on lines 2130 to 2135
// See create_or_lookup_group() for explanation
// See create_group() for explanation.
.map(|s| s.trim())
{
if let Some(grpname) = mime_parser
.get_header(HeaderDef::ChatGroupName)
// See create_or_lookup_group() for explanation
// See create_group() for explanation.
Copy link
Collaborator

@Hocuri Hocuri Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not totally related to this PR, but: Explanation what for, anyway? For why we trim() the group name?

Copy link
Collaborator Author

@iequidoo iequidoo Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly. There is a comment there that is longer than the corresponding code:

// W/a for "Space added before long group names after MIME serialization/deserialization                                                                                                                 
// #3650" issue. DC itself never creates group names with leading/trailing whitespace.

I'd prefer not to duplicate it

Copy link
Collaborator

@Hocuri Hocuri Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know what "W/a" means?

I'd prefer not to duplicate it

Me too; we could remove it (or just the two lines here) if we don't think it adds value. For me it wouldn't add value while reading at least because I neither would have wondered why we trim() - we trim() all the time - nor would I have understood it. But we can also just keep it if other people exist who did find it understandable.

Also, do you know what "W/a" means?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, do you know what "W/a" means?

I guess it is an abbreviation for "workaround"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed these two referencing comments. Not that important indeed

@iequidoo
Copy link
Collaborator Author

iequidoo commented Jun 18, 2024

@iequidoo I can do that, of course, as soon as I have an APK to test with. 👍

I think we will merge this (or not), then you can test a new nightly build against your scenario. EDIT: Anyway this is not a fix yet, only some improvement, so it's up to you.

Delta Chat -style groups have names w/o prefixes like "Re: " even if the user is added to an already
existing group, so let's remove prefixes from ad-hoc group names too. Usually it's not very
important that the group is a classic email thread existed before, this info just eats up screen
space. Also this way a group name is likely to preserve if the first message was missed.
@iequidoo iequidoo merged commit 501f41f into main Jun 19, 2024
37 checks passed
@iequidoo iequidoo deleted the iequidoo/adhoc-grp-name branch June 19, 2024 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants