feat: improve autocomplete for JIDs #167
Open
jabber.developer
wants to merge 2 commits from
feat/disco-ac into master
pull from: feat/disco-ac
merge into: devs:master
devs:master
devs:feat/ai-api-type
devs:fix/editor-terminal-size
devs:ci/docker-hub-publishing
devs:feat/privacy-enhancements
devs:fix/clientid-regression
devs:fix/ai-chat-completions-followup
devs:feat/ai-custom
devs:fix/unencrypted-send
devs:rollback/pre-upstream-merge
devs:fix/autoping-warning-null-domain
devs:fix/pad-dead-space-reclaim
devs:feat/autoping-warning
devs:chore/untrack-gitversion
devs:fix/multiline-pad-clip
devs:fix/issue-112-followups
devs:fix/issue-128-migrate-v3-dedup
devs:fix/delay-timestamp-validation
devs:ref/light-cleanup
devs:fix/history-scroll-pad-redraw-storm
devs:fix/plugin-post-display-incoming-only
devs:merge/upstream-full
devs:merge-improve
devs:chore/remove-chatlog-stage-1
devs:fix/ai-json-encoding
devs:feat/no-db-backlog-114
devs:fix/scroll-non-chat-windows
devs:fix/paged-non-chat-windows
devs:fix/ai-leaks
devs:feat/ai
devs:fix/ai-followups
devs:test/ai-coverage-unit-only
devs:test/ai-coverage
devs:refactor/scroll-mechanism
devs:fix/verify-per-contact-context
devs:feat/no-db-mode
devs:feat/ai-json
devs:feat/pikaur-parity-arch
devs:fix-pikaur-build
devs:feat/upstream-sync
devs:feat/functest-speedup
devs:fix/cwe-134-format-string-audit
devs:ci/separate-build-step
devs:test/autoping-functional-tests
devs:test/db-functional-tests
devs:fix/arch-build
devs:fix/xep-0030-disco-items-error-handling
devs:fix/xep-0030-empty-disco-items
devs:playground/fix/src_refactoring
devs:tests/disco
devs:fix/test-CI-stability
devs:feat/parallel-tests-clean
devs:feat/parallel-functional-tests
devs:fix/functional_tests_v2
devs:fix/functional_tests
devs:fix/connect_max_args
devs:feat/extended_debug_info
devs:playground/fix/scroll-stuck
devs:build/multicore
devs:build/reenable-fedora
devs:build/autoupdate
No Reviewers
Labels
Clear labels
Compat/Breaking
Breaking change that won't be backward compatible
Kind/Bug
Something is not working
Kind/Documentation
Documentation changes
Kind/Enhancement
Improve existing functionality
Kind/Feature
New functionality
Kind/Security
This is security issue
Kind/Testing
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Low
4
The priority is low
Priority
Medium
3
The priority is medium
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: devs/cproof#167
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "feat/disco-ac"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Resolves #164
Nice cleanup — folding the scattered contact/barejid/fulljid completion into
_roster_jid_autocomplete, and the nickname→JID conversion into_resolve_contact_jid, reads well and seems to cover what #164 asks for. The_resolve_contact_jidownership looks fine too:roster_barejid_from_name()returns a borrowed pointer into the roster table (and the fallback returns the caller'sname), so nothing there needs freeing.One thing that might be worth a second look:
_roster_jid_autocompleteseems to be called with the rawinput, whereas the/msgpath that #164 points at as the reference strips quotes first and passesunquoted:The new helper, as used in
_win_autocomplete,_vcard_autocomplete(roster branch) and_status_autocomplete(/status get), getsinputinstead:If that reading is right, a couple of things seem to follow:
/msgpattern #164 holds up as the standard._win_autocompleteand the_vcard_autocompleteroster branch,unquotednow appears to be computed and freed without being used anywhere — harmless at runtime, but a bit misleading (and it wouldn't trip-Wunused, since it's still passed tofree()).Perhaps the cleanest option would be to strip quotes once inside
_roster_jid_autocompleteand drop the now-redundant localunquotedat the call sites that only kept it for that. That would line the helper up with/msgand remove the dead locals in one go, which seems in keeping with the "standardize" goal of the issue.A few smaller things, likely intentional but maybe worth confirming:
/history verify|export|import <jid>completion now sits behind aJABBER_CONNECTEDcheck. Since/historyworks against the local DB offline, tab-completing a past contact's JID while disconnected wouldn't work anymore. The roster is empty offline anyway, so the practical effect may be nil — just flagging in case offline completion was expected._invite_autocompleteseems to now run the/invite decline(muc_invites_find) completion unconditionally, where it used to be inside the connected branch. That looks harmless for local invite state, possibly even more correct, but it is a change in when it fires._resolve_contact_jidreturnsconst gchar*after a(char*)namecast, which can read as if it owns something. A one-line note that it returns a borrowed roster/arg pointer (not to be freed) might save a future reader a double-take.Overall the core of #164 looks handled; the
inputvs `unquoView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.