Threema actions are missing in contact details because Threema's raw contacts have no name

Đang mở
#643 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
backend, mobile

Hướng nghiên cứu

Start with the named ContactsHelper.kt, ViewContactActivity.kt, and Context-contacts.kt references to trace how raw contacts are loaded and how social actions are found. The report says the reporter has already prepared and tested an implementation; coordinate with them before starting. Done means nameless Threema raw contacts appear as contact sources and offer the existing message and call actions.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug needs triage
Checklist
  • I can reproduce the bug with the latest version given here.
  • I made sure that there are no existing issues - open or closed - to which I could contribute my information.
  • I made sure that there are no existing discussions - open or closed - to which I could contribute my information.
  • I have read the FAQs inside the app (Menu -> About -> FAQs) and my problem isn't listed.
  • I have taken the time to fill in all the required details. I understand that the bug report will be dismissed otherwise.
  • This issue contains only one bug.
  • I have read and understood the contribution guidelines.
Affected app version

1.6.0

Affected Android/Custom ROM version

GrapheneOS 2026102101 (Android 17)

Affected device model

Pixel 9 Pro XL

How did you install the app?

F-Droid / IzzyOnDroid

Steps to reproduce the bug
  1. Install Threema Libre 6.5.3l (build 1216), enable contact synchronization in Threema and grant it access to contacts.
  2. Make sure a contact in the address book has a phone number or email address that belongs to a Threema user. Threema then links its own raw contact to that contact.
  3. Open this contact in Fossify Contacts (with the "Contact source" field visible).
  4. Optionally open the filter dialog in the contact list.
Expected behavior

The contact sources list a Threema entry with the Threema icon, and tapping it offers "Message" / "Call", like it already works for WhatsApp. The stock contacts app on the same device shows these Threema actions for the same contact.

Actual behavior

There is no Threema entry and no way to reach the Threema actions from the contact details. In the filter dialog, the Threema source is listed and enabled, but with (0) contacts. WhatsApp entries on the same device are shown correctly.

Already ruled out: Threema contact sync is on, Fossify Contacts has full contacts permission, account sync is active, "Show only contacts with phone numbers" is off.

Screenshots/Screen recordings
ignoreImageMinify ignoreImageMinify
Additional information

Root cause

Threema creates one raw contact per linked contact in its own account. That raw contact only has two data rows (vnd.ch.threema.app.profile and vnd.ch.threema.app.call) and is joined to the existing contact with AggregationExceptions.TYPE_KEEP_TOGETHER. The code for a StructuredName row is present but commented out:
https://github.com/threema-ch/threema-android/blob/d44a2b53b2ea2c0bf1065bdaa96987570e5b4e6d/app/src/main/java/ch/threema/app/utils/AndroidContactUtil.java#L157-L219

Fossify only loads raw contacts that have a StructuredName or Organization row, so Threema's raw contacts are never loaded:
https://github.com/FossifyOrg/Commons/blob/675cd53384c9d1c09a8f7308dacb81757599ef50/commons/src/main/kotlin/org/fossify/commons/helpers/ContactsHelper.kt#L141

As a result the filter shows (0), the Threema raw contact never becomes one of the contact's sources, and the existing Threema branch in setupContactSources() is never reached:
https://github.com/FossifyOrg/Contacts/blob/59e96245420f5ed1f6bad5e50c244b0fecd0a36f/app/src/main/kotlin/org/fossify/contacts/activities/ViewContactActivity.kt#L667-L673

Fossify already knows Threema's mimetypes in getSocialActions(), which looks up data rows by raw contact id and does not need a name row:
https://github.com/FossifyOrg/Commons/blob/675cd53384c9d1c09a8f7308dacb81757599ef50/commons/src/main/kotlin/org/fossify/commons/extensions/Context-contacts.kt#L281-L330

WhatsApp is not affected because it writes a name and phone number into its raw contact. The stock contacts app reads all data rows of the aggregated contact, whether a name row exists or not.

I use Threema Libre. It creates its account with the name "Threema Libre" and type ch.threema.app.libre, but uses the same mimetypes as regular Threema, so a fix based on mimetypes covers both. The existing branch in setupContactSources() checks the account name for "threema" and would not match Threema Libre even if its raw contacts were loaded.

Proposed fix

  1. Commons: add a lookup for raw contacts aggregated into a contact (Data.CONTACT_ID) that carry a known messenger mimetype but neither a name nor an organization row.
  2. Contacts: in ViewContactActivity, list those raw contacts as additional contact sources with the messenger icon; tapping them opens the existing social actions dialog.

This keeps contact loading untouched, so no empty entries show up in the contact list. It is not specific to Threema; it covers any supported messenger that links nameless raw contacts. The "(0)" count in the filter dialog stays as it is, since those raw contacts are still not loaded as contacts of their own.

Note on opening the chat

With the fix applied, the dialog offers "Message to <Threema ID>" and "Call …" as expected (the label text comes from Threema's DATA3). On my Pixel, tapping "Message" currently opens an empty Threema screen. The stock GrapheneOS contacts app shows exactly the same behavior for the same contact, so this is not caused by Fossify. On a Samsung Galaxy S20 FE, the same action from the stock contacts app opens the chat normally. I will look into this on the Threema side separately.

Related: in https://github.com/orgs/FossifyOrg/discussions/770 the connected apps (Signal, Threema, WhatsApp) were requested, and the answer was that Fossify Contacts already shows them as contact sources with the app icon. That works for WhatsApp, but not for Threema, for the reason above. #230 is about alternative Telegram/Signal clients that use their own account types, which is a different cause: Threema Libre uses the standard Threema mimetypes, the problem here is the missing name row.

I have prepared an implementation (about 70 lines in Commons, 50 in Contacts) and tested it on my device (see the screenshots above). I would like to submit the PRs if this gets the "help wanted" label.

Ngôn ngữ chính
Kotlin
Star
917
Fork
73
Merge trung bình
2 ngày 8 giờ
Pull request đã merge (30 ngày)
7

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của FossifyOrg/Contacts

Tất cả issue của FossifyOrg/Contacts

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.