Add Android boot startup, lazy settings, emoji and DM calls

Add battery optimization controls and configurable boot startup. Keep message sounds in the application and render general settings lazily to avoid ANRs. Add animated emoji controls and live BGP availability for direct-message calls on Android and desktop.
This commit is contained in:
evgeny committed 2026-10-02 17:18:24 +03:00
1 parent 66afcc8625
commit 23368a5bbe
40 files changed
+1165 -180

No files matched your search

+24 -1
View File
@@ -168,6 +168,8 @@ MainWindow::MainWindow(QWidget *parent, DbManager* db, const QString& cfgPath,
MainWindow::~MainWindow() {
s_mainWindow = nullptr;
m_autoPlayTimer->stop();
gui_bridge_set_network_changed_cb(nullptr);
gui_bridge_set_dm_call_route_cb(nullptr);
gui_bridge_set_msg_received_cb(nullptr);
gui_bridge_set_channel_updated_cb(nullptr);
gui_bridge_set_member_list_cb(nullptr);
@@ -488,6 +490,20 @@ void MainWindow::setupBridgeCallbacks() {
if (s_mainWindow)
s_mainWindow->onDmMsgReceived(QString::fromUtf8(conv_id, conv_id_len), author);
});
gui_bridge_set_network_changed_cb([](int type) {
if (!s_mainWindow) return;
if (type == 13) {
s_mainWindow->m_messageList->clearDmCallRoute();
s_mainWindow->m_channelList->clearDmPresence();
} else {
s_mainWindow->m_channelList->refreshDmPresence();
}
});
gui_bridge_set_dm_call_route_cb([](const uint8_t* data, int len) {
if (!s_mainWindow) return;
s_mainWindow->m_messageList->onDmCallRoute(data, len);
s_mainWindow->m_channelList->onDmCallRoute(data, len);
});
gui_bridge_set_dm_messages_cb([](const uint8_t* data, int len) {
if (s_mainWindow)
s_mainWindow->m_messageList->onDmMessages(data, len);
@@ -527,6 +543,7 @@ void MainWindow::setupConnects() {
connect(m_accountList, &AccountList::memberRenamed,
m_messageList, &MessageList::reloadLocalNicks);
connect(m_accountList, &AccountList::callRequested, this, &MainWindow::onCallRequested);
connect(m_messageList, &MessageList::callRequested, this, &MainWindow::onCallRequested);
connect(m_accountList, &AccountList::pmRequested, this, &MainWindow::onPmRequested);
connect(m_messageList, &MessageList::readPositionChanged,
this, [this](const QString& channelId, qint64 lastReadMsgId) {
@@ -542,11 +559,17 @@ void MainWindow::setupConnects() {
/* ── звонки ── */
void MainWindow::onCallRequested(const QString& chId, quint64 nodeId, const QString& name) {
if (chId.startsWith(QStringLiteral("dm:")) && !m_activeCalls.isEmpty()) {
auto* w = m_activeCalls.constBegin().value();
DEBUG_INFO(DEBUG_CATEGORY_CALL, "PM call: existing call window id=%llu", (unsigned long long)w->callId());
w->show(); w->raise(); w->activateWindow();
return;
}
quint64 callId = QRandomGenerator::global()->generate64();
if (!callId) callId = 1;
struct call_start_arg* a = (struct call_start_arg*)u_malloc(sizeof(*a));
if (!a) return;
if (!a) { DEBUG_ERROR(DEBUG_CATEGORY_CALL, "Call start: allocation failed"); return; }
memset(a, 0, sizeof(*a));
a->inst = gui_bridge_get_inst();
strncpy(a->ch_id, chId.toUtf8().constData(), sizeof(a->ch_id) - 1);