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

]Add OpenContacts Integration for Contact Name Resolution in SMS #190

Open
GitHubTpac opened this issue Nov 30, 2024 · 0 comments
Open

]Add OpenContacts Integration for Contact Name Resolution in SMS #190

GitHubTpac opened this issue Nov 30, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@GitHubTpac
Copy link

Description:
I would like to request integration with the opencontacts app to resolve contact names in SMS threads. Currently, Quik relies on the system contact book to display contact names for phone numbers. However, for users like me who prioritize privacy and store their contacts exclusively in opencontacts, the app only shows phone numbers in SMS threads. This makes it inconvenient to identify senders or recipients without memorizing their numbers.

Proposed Solution:

Query opencontacts for contact names based on phone numbers.

Use its ContentProvider if available:

Uri uri = Uri.parse("content://opencontacts/contacts");
Cursor cursor = getContentResolver().query(uri, null, null, null, null);

while (cursor.moveToNext()) {
String name = cursor.getString(cursor.getColumnIndex("name"));
String phone = cursor.getString(cursor.getColumnIndex("phone"));
// Map phone numbers to names
}
cursor.close();

As a fallback, access the opencontacts database directly:

SQLiteDatabase db = SQLiteDatabase.openDatabase(
"/data/data/opencontacts.open.com.opencontacts/databases/contacts.db",
null,
SQLiteDatabase.OPEN_READONLY
);
Cursor cursor = db.rawQuery("SELECT name, phone FROM contacts", null);

while (cursor.moveToNext()) {
String name = cursor.getString(0);
String phone = cursor.getString(1);
// Map phone numbers to names
}
cursor.close();
db.close();

Replace phone numbers in SMS threads with the resolved names, falling back to the number if no match is found.

Why This is Needed:

Users who prefer not to store contacts in the system contact book (e.g., for privacy reasons) currently cannot see names in SMS threads.

This feature will enhance the user experience for privacy-conscious users while maintaining the existing functionality for others.

Potential Impact:

Improves usability for users storing contacts in alternative apps like opencontacts.

Does not affect users who rely on the system contact book.

Thank you for considering this feature!
https://gitlab.com/sultanahamer/OpenContacts

@GitHubTpac GitHubTpac added the enhancement New feature or request label Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant