Skip to content

Linux + iPhone Continuity / iMessage / SMS

feat(ui): call button on contact card

Zack Bartel09c84149bee8
diff --git a/po/cs.po b/po/cs.po
index 1016fa8..d8affa2 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -1798,7 +1798,9 @@ msgid "Outgoing"
msgstr "Odchozí"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Volat {}"
@@ -1817,7 +1819,7 @@ msgstr ""
msgid "Number to call"
msgstr "Číslo k volání"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Volat"
diff --git a/po/de.po b/po/de.po
index aca907f..25074a8 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -1839,7 +1839,9 @@ msgid "Outgoing"
msgstr "Ausgehend"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "{} anrufen"
@@ -1857,7 +1859,7 @@ msgstr ""
msgid "Number to call"
msgstr "Zu wählende Nummer"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Anrufen"
diff --git a/po/es.po b/po/es.po
index 5bf26fe..acbcae2 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -1826,7 +1826,9 @@ msgid "Outgoing"
msgstr "Saliente"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Llamar a {}"
@@ -1845,7 +1847,7 @@ msgstr ""
msgid "Number to call"
msgstr "Número al que llamar"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Llamar"
diff --git a/po/fr.po b/po/fr.po
index 36405e8..652a3fa 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -1831,7 +1831,9 @@ msgid "Outgoing"
msgstr "Sortant"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Appeler {}"
@@ -1850,7 +1852,7 @@ msgstr ""
msgid "Number to call"
msgstr "Numéro à appeler"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Appeler"
diff --git a/po/it.po b/po/it.po
index 9661901..cdea537 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -1823,7 +1823,9 @@ msgid "Outgoing"
msgstr "In uscita"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Chiama {}"
@@ -1842,7 +1844,7 @@ msgstr ""
msgid "Number to call"
msgstr "Numero da chiamare"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Chiama"
diff --git a/po/ja.po b/po/ja.po
index fff6784..bd85b5b 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -1793,7 +1793,9 @@ msgid "Outgoing"
msgstr "発信"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "{}に発信"
@@ -1811,7 +1813,7 @@ msgstr ""
msgid "Number to call"
msgstr "発信先の番号"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "発信"
diff --git a/po/ko.po b/po/ko.po
index 191ab5d..5e614a3 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -1771,7 +1771,9 @@ msgid "Outgoing"
msgstr "발신"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "{}에게 전화"
@@ -1788,7 +1790,7 @@ msgstr "통화 제어가 꺼져 있습니다. 'tether --bt-calls-enable on'으
msgid "Number to call"
msgstr "전화를 걸 번호"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "전화 걸기"
diff --git a/po/nl.po b/po/nl.po
index ec47903..802eaa7 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -1815,7 +1815,9 @@ msgid "Outgoing"
msgstr "Uitgaand"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "{} bellen"
@@ -1834,7 +1836,7 @@ msgstr ""
msgid "Number to call"
msgstr "Te bellen nummer"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Bellen"
diff --git a/po/pl.po b/po/pl.po
index c496dc6..a1a398c 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -1815,7 +1815,9 @@ msgid "Outgoing"
msgstr "Wychodzące"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Zadzwoń do {}"
@@ -1834,7 +1836,7 @@ msgstr ""
msgid "Number to call"
msgstr "Numer do wybrania"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Zadzwoń"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 9fa7dbd..e3a20b3 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -1816,7 +1816,9 @@ msgid "Outgoing"
msgstr "Efetuada"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Ligar para {}"
@@ -1835,7 +1837,7 @@ msgstr ""
msgid "Number to call"
msgstr "Número para ligar"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Ligar"
diff --git a/po/ru.po b/po/ru.po
index c0682a7..7de5457 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -1814,7 +1814,9 @@ msgid "Outgoing"
msgstr "Исходящий"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Позвонить {}"
@@ -1833,7 +1835,7 @@ msgstr ""
msgid "Number to call"
msgstr "Номер для вызова"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Позвонить"
diff --git a/po/sv.po b/po/sv.po
index 5e6bb86..ce1f842 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -1799,7 +1799,9 @@ msgid "Outgoing"
msgstr "Utgående"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Ring {}"
@@ -1816,7 +1818,7 @@ msgstr "Samtalsstyrningen är av. Slå på den med 'tether --bt-calls-enable on'
msgid "Number to call"
msgstr "Nummer att ringa"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Ring"
diff --git a/po/tether.pot b/po/tether.pot
index babe3e5..625b3e3 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether 0.2.36\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -1622,7 +1622,9 @@ msgid "Outgoing"
msgstr ""
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr ""
@@ -1639,7 +1641,7 @@ msgstr ""
msgid "Number to call"
msgstr ""
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr ""
diff --git a/po/tr.po b/po/tr.po
index b80befa..4ef43bc 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -1798,7 +1798,9 @@ msgid "Outgoing"
msgstr "Giden"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "{} ara"
@@ -1815,7 +1817,7 @@ msgstr "Çağrı denetimi kapalı. 'tether --bt-calls-enable on' ile açın."
msgid "Number to call"
msgstr "Aranacak numara"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Ara"
diff --git a/po/uk.po b/po/uk.po
index 524c4c2..3ba430c 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -1811,7 +1811,9 @@ msgid "Outgoing"
msgstr "Вихідний"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "Зателефонувати {}"
@@ -1830,7 +1832,7 @@ msgstr ""
msgid "Number to call"
msgstr "Номер для виклику"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "Подзвонити"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index bce8f7b..cc8343e 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-10-09 20:43-0700\n"
+"POT-Creation-Date: 2026-10-10 13:51-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -1729,7 +1729,9 @@ msgid "Outgoing"
msgstr "呼出"
#. TRANSLATORS: Button that calls a recent caller back, {} is their name or number.
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#. TRANSLATORS: Spoken name of the call button beside a phone number.
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
+#: src/tui/contacts.cpp
#, c++-format
msgid "Call {}"
msgstr "呼叫 {}"
@@ -1746,7 +1748,7 @@ msgstr "通话控制已关闭。使用 'tether --bt-calls-enable on' 开启。"
msgid "Number to call"
msgstr "要拨打的号码"
-#: src/gtk/calls_view.cpp src/tui/calls.cpp
+#: src/gtk/calls_view.cpp src/gtk/contacts_view.cpp src/tui/calls.cpp
msgid "Call"
msgstr "拨打"
diff --git a/src/gtk/calls_view.cpp b/src/gtk/calls_view.cpp
index fe6b798..9bcf71e 100644
--- a/src/gtk/calls_view.cpp
+++ b/src/gtk/calls_view.cpp
@@ -68,21 +68,14 @@ namespace tether::ui {
const std::string number = text ? text : "";
if (number.empty())
return;
- nlohmann::json j;
- j["command"] = "bt_call_dial";
- j["number"] = number;
- daemon_send(j);
+ calls_view_dial(number);
gtk_entry_set_text(GTK_ENTRY(g_calls.entry), "");
}
void on_redial_clicked(GtkButton* button, gpointer) {
const char* number = static_cast<const char*>(g_object_get_data(G_OBJECT(button), "call-number"));
- if (!number || !*number)
- return;
- nlohmann::json j;
- j["command"] = "bt_call_dial";
- j["number"] = number;
- daemon_send(j);
+ if (number && *number)
+ calls_view_dial(number);
}
void attach_path(GtkWidget* button, const std::string& path) {
@@ -242,6 +235,13 @@ namespace tether::ui {
} // namespace
+ void calls_view_dial(const std::string& number) {
+ nlohmann::json j;
+ j["command"] = "bt_call_dial";
+ j["number"] = number;
+ daemon_send(j);
+ }
+
void calls_view_set_visible(bool visible) {
g_calls.visible = visible;
if (!visible)
diff --git a/src/gtk/calls_view.hpp b/src/gtk/calls_view.hpp
index 5289035..5891611 100644
--- a/src/gtk/calls_view.hpp
+++ b/src/gtk/calls_view.hpp
@@ -2,6 +2,7 @@
#include <gtk/gtk.h>
#include <nlohmann/json.hpp>
+#include <string>
namespace tether::ui {
@@ -14,4 +15,7 @@ namespace tether::ui {
// still arrives, because the daemon pushes those unasked.
void calls_view_set_visible(bool visible);
+ // Failures come back as bt_call_result, which this view reports.
+ void calls_view_dial(const std::string& number);
+
} // namespace tether::ui
diff --git a/src/gtk/contacts_view.cpp b/src/gtk/contacts_view.cpp
index dc2cdfc..e9419f7 100644
--- a/src/gtk/contacts_view.cpp
+++ b/src/gtk/contacts_view.cpp
@@ -18,7 +18,9 @@ namespace tether::ui {
std::string search_needle;
std::string shown;
bool visible = false;
+ bool calls_available = false;
void (*open_thread)(const std::string&) = nullptr;
+ void (*start_call)(const std::string&) = nullptr;
};
ContactsState g_contacts;
@@ -107,6 +109,21 @@ namespace tether::ui {
g_contacts.open_thread(stashed(GTK_WIDGET(button)));
}));
gtk_box_pack_end(GTK_BOX(box), message, FALSE, FALSE, 0);
+
+ // ponytail: availability is read when the card first opens; a link
+ // lost later surfaces as the Calls page's bt_call_result status.
+ if (is_tel && g_contacts.calls_available) {
+ GtkWidget* call = action_button("call-start-symbolic",
+ display_address(key),
+ _("Call"),
+ // TRANSLATORS: Spoken name of the call button beside a phone number.
+ tether::tr_format(_("Call {}"), display_address(key)),
+ G_CALLBACK(+[](GtkButton* button, gpointer) {
+ if (g_contacts.start_call)
+ g_contacts.start_call(stashed(GTK_WIDGET(button)));
+ }));
+ gtk_box_pack_end(GTK_BOX(box), call, FALSE, FALSE, 0);
+ }
return box;
}
@@ -215,13 +232,20 @@ namespace tether::ui {
}
bool contacts_view_handle_event(const nlohmann::json& event) {
- if (event.value("command", "") == "bt_contacts")
+ const std::string command = event.value("command", "");
+ if (command == "bt_contacts")
show_contacts(event);
+ else if (command == "bt_connection_changed") {
+ const auto& calls = event.contains("calls") ? event["calls"] : nlohmann::json();
+ g_contacts.calls_available = calls.is_object() && calls.value("available", false);
+ }
return false;
}
- GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key)) {
+ GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key),
+ void (*start_call)(const std::string& number)) {
g_contacts.open_thread = open_thread;
+ g_contacts.start_call = start_call;
g_contacts.stack = gtk_stack_new();
GtkWidget* status_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 10);
diff --git a/src/gtk/contacts_view.hpp b/src/gtk/contacts_view.hpp
index 2d00de6..d7bc19f 100644
--- a/src/gtk/contacts_view.hpp
+++ b/src/gtk/contacts_view.hpp
@@ -7,7 +7,8 @@
namespace tether::ui {
// The iPhone's address book, pulled over PBAP.
- GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key));
+ GtkWidget* contacts_view_new(void (*open_thread)(const std::string& thread_key),
+ void (*start_call)(const std::string& number));
// Returns true when the event belonged to this view.
bool contacts_view_handle_event(const nlohmann::json& event);
diff --git a/src/gtk/main.cpp b/src/gtk/main.cpp
index 0420524..d6b3d7f 100644
--- a/src/gtk/main.cpp
+++ b/src/gtk/main.cpp
@@ -276,10 +276,15 @@ namespace {
g_calls_page = page_frame(calls_view_new(), _("Calls"), "calls");
gtk_stack_add_titled(GTK_STACK(stack), g_calls_page, "calls", _("Calls"));
gtk_stack_add_titled(GTK_STACK(stack),
- page_frame(contacts_view_new([](const std::string& thread_key) {
- show_view("messages");
- messages_view_open_thread(thread_key);
- }),
+ page_frame(contacts_view_new(
+ [](const std::string& thread_key) {
+ show_view("messages");
+ messages_view_open_thread(thread_key);
+ },
+ [](const std::string& number) {
+ calls_view_dial(number);
+ show_view("calls");
+ }),
_("Contacts"),
"contacts"),
"contacts",
diff --git a/src/tui/contacts.cpp b/src/tui/contacts.cpp
index 06658a5..681fc76 100644
--- a/src/tui/contacts.cpp
+++ b/src/tui/contacts.cpp
@@ -117,6 +117,13 @@ namespace tether::tui {
messages_open_thread(key);
};
rows.push_back(row);
+ if (is_tel && available_) {
+ const std::string number = ui::display_address(key);
+ rows.push_back(action_row(tr_format(_("Call {}"), number), [number] {
+ app::send({{"command", "bt_call_dial"}, {"number", number}});
+ app::show_page("calls");
+ }));
+ }
}
return rows;
}
@@ -130,9 +137,14 @@ namespace tether::tui {
}
bool handle_event(const json& event) override {
- if (event.value("command", "") == "bt_contacts")
+ const std::string command = event.value("command", "");
+ if (command == "bt_contacts")
contacts_ =
event.contains("contacts") && event["contacts"].is_array() ? event["contacts"] : json::array();
+ else if (command == "bt_connection_changed") {
+ const json& calls = event.contains("calls") ? event["calls"] : json();
+ available_ = calls.is_object() && calls.value("available", false);
+ }
return false;
}
@@ -155,6 +167,7 @@ namespace tether::tui {
json contacts_ = json::array();
std::string selected_;
+ bool available_ = false;
};
} // namespace