Cover radio phone policy, BGP color flags, retries and caller choice timeout
This commit is contained in:
1 parent
4683c98c08
commit
79b4235960
2 files changed
+82
-11
No files matched your search
@@ -70,6 +70,7 @@ extern "C" {
|
||||
extern "C" {
|
||||
#include "chat/chat_core.h"
|
||||
#include "call/call.h"
|
||||
#include "call/call_proto.h"
|
||||
#include "radio/radio_call.h"
|
||||
#include "dm/dm_core.h"
|
||||
#include "../../lib/mem.h"
|
||||
@@ -776,7 +777,7 @@ void MainWindow::onRadioCallRequested(const QString& channel, quint64 peer) {
|
||||
/* Один диалог на незавершённое приглашение; принятая рация живёт своим обычным циклом. */
|
||||
void MainWindow::onRadioCallEvent(const uint8_t* data, int len) {
|
||||
if (!data || len != 27 || data[24] < RADIO_CALL_OUTGOING || data[24] > RADIO_CALL_WAIT_DECISION ||
|
||||
data[25] > RADIO_CALL_AUDIO_ERROR || data[26] > 1) {
|
||||
data[25] > RADIO_CALL_PHONE_BUSY || data[26] > 1) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_RADIO, "desktop invalid radio call event bytes=%d", len); return;
|
||||
}
|
||||
quint64 id, group, peer;
|
||||
@@ -798,7 +799,7 @@ void MainWindow::onRadioCallEvent(const uint8_t* data, int len) {
|
||||
if (reason == RADIO_CALL_ACCEPTED) return;
|
||||
}
|
||||
if ((incoming && reason != RADIO_CALL_AUDIO_ERROR) || reason == RADIO_CALL_CANCELLED) return;
|
||||
const char* text = reason == RADIO_CALL_DECLINED ? "Radio call declined" :
|
||||
const char* text = reason == RADIO_CALL_PHONE_BUSY ? "Subscriber is on a phone call" : reason == RADIO_CALL_DECLINED ? "Radio call declined" :
|
||||
reason == RADIO_CALL_BUSY ? "Subscriber is busy" : reason == RADIO_CALL_NO_ANSWER ? "No answer" :
|
||||
reason == RADIO_CALL_AUDIO_ERROR ? "Could not start channel radio" : "Subscriber is unavailable";
|
||||
auto* notice = new QMessageBox(QMessageBox::Information, QCoreApplication::translate("ChatGui", "Radio call"),
|
||||
@@ -953,11 +954,16 @@ void MainWindow::onCallAccepted(quint64 callId) {
|
||||
}
|
||||
|
||||
void MainWindow::onCallEnded(quint64 callId, uint8_t reason) {
|
||||
Q_UNUSED(reason);
|
||||
const bool phoneBusy = reason == CALL_REASON_PHONE_BUSY && m_activeCalls.contains(callId);
|
||||
/* тон завершения (~450мс) → авто-teardown аудио-движка */
|
||||
if (CallAudioEngine::instance()->callId() == callId)
|
||||
CallAudioEngine::instance()->beginEnd(callId);
|
||||
closeCallWindow(callId);
|
||||
if (phoneBusy) {
|
||||
auto* notice = new QMessageBox(QMessageBox::Information, QStringLiteral("vibechat"),
|
||||
QCoreApplication::translate("ChatGui", "Subscriber is on a phone call"), QMessageBox::Ok, this);
|
||||
notice->setAttribute(Qt::WA_DeleteOnClose); notice->show();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::onCallError(quint64 callId, uint8_t err) {
|
||||
|
||||
Reference in new issue
Block a user