Browse Source

Expose explicit desktop radio activation for accepted invitations

stream-multiview
evgeny 6 days ago
parent
commit
427794fed8
  1. 9
      tools/chatgui/src/messagelist.cpp
  2. 1
      tools/chatgui/src/messagelist.h

9
tools/chatgui/src/messagelist.cpp

@ -1599,6 +1599,15 @@ void MessageList::onStreamSources(const uint8_t* data, int len) {
DEBUG_INFO(DEBUG_CATEGORY_STREAM, "desktop stream header group=%llx sources=%d", (unsigned long long)group, (int)m_streamSources.size());
}
bool MessageList::enableRadio() {
if (m_currentChannelId.isEmpty() || isDmChannel(m_currentChannelId)) return false;
if (!m_radioOn) onRadioToggled(true);
QSignalBlocker blocker(m_radioBtn);
m_radioBtn->setChecked(m_radioOn);
return m_radioOn && RadioAudioEngine::instance()->isActive()
&& RadioAudioEngine::instance()->groupId() == m_currentChannelId.toULongLong();
}
void MessageList::onRadioToggled(bool on) {
if (m_currentChannelId.isEmpty() || isDmChannel(m_currentChannelId)) return;

1
tools/chatgui/src/messagelist.h

@ -48,6 +48,7 @@ public:
void onMessageSubmitted(const uint8_t* data, int len);
void onAttachmentKeysChanged(const uint8_t* data, int len);
void onRadioTalk(quint64 groupId, quint64 srcNodeId, bool on); /* индикация говорящего */
bool enableRadio(); /* идемпотентное включение рации выбранного канала, false при ошибке аудио */
void onStreamSources(const uint8_t* data, int len);
void clearStreams();
void watchStreams();

Loading…
Cancel
Save