Skip to content

Conversation

@jubalh
Copy link
Member

@jubalh jubalh commented Jun 20, 2024

People with huge contact lists most likely happen to have contacts starting with popular names more often. They can use /msg Arthur to find the correct person.

But if they have 50 Arthurs it will take a while. Using the surname might be faster. So a substring search of /msg Clarke will be faster.

Fix #1984

People with huge contact lists most likely happen to have contacts starting with popular names more often.
They can use /msg Arthur to find the correct person.

But if they have 50 Arthurs it will take a while. Using the surname might be faster. So a substring search of /msg Clarke<tab> will be faster.

Fix #1984
@jubalh
Copy link
Member Author

jubalh commented Jun 24, 2024

roster_contact_autocomplete() is used for:

  • /msg
  • /info
  • /roster remvoe
  • /roster group add
  • /roster group remove
  • /otr policy
  • /pgp start
  • /pgp sendpub
  • /ox start
  • /omemo start
  • /omemo fingerprint
  • /omemo trust
  • /omemo untrust
  • /win
  • /invite send
  • /status get
  • /vcard get
  • /vcard photo open
  • /vcard photo save

@mdosch @weiss @sjaeckel
What are your opinions? Should we generally make roster_contact_autocomplete() autocomplete substrings? Or should we do it as proposed in this PR. That we have two functions, one for the exact prefix and the other for substring.
If we do the latter, do we want it for more functions than /msg?

@jubalh jubalh marked this pull request as ready for review June 24, 2024 08:19
@mdosch
Copy link
Contributor

mdosch commented Jun 26, 2024

If you have a lot of Arthurs the issue of having to tab a lot till you find the right Arthur can happen with any command, so I think we should allow the substring search everywhere. But for the ordering I'd like to rank hits starting with the search term higher.

E.g. if you have "Arthur Anchor", Arthur Boyle", "Arthur Clarke", "Arthur Dent" and "Clark Kent" /msg Clark<tab> should show "Clark Kent" first and then "Arthur Clarke".

Copy link
Member

@sjaeckel sjaeckel left a comment

Choose a reason for hiding this comment

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

LGTM

and

  1. I like the idea of @mdosch
  2. that's one of the cases where I think tests would make sense :)

return FALSE;
}

gchar*
Copy link
Member

Choose a reason for hiding this comment

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

static

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.

Enable substring autocompletion for /msg

4 participants