debug(chatgui): add online status trace across full chain

- cs_is_peer_online: log found/init/links/online
- cs_on_peer_status_changed: log channel_count + found_in_channel
- cs_handle_welcome/cs_handle_channel_join: log before cs_post_channel_online
- MainWindow::onChannelPeersOnline: log cid+online
- ChannelList::setChannelPeersOnline: log search/rows, each row cid+match, SET or NOT FOUND
- ChannelList::loadChannels: log each added row cid+name
This commit is contained in:
Evgeny committed 2026-07-19 10:58:25 +03:00
1 parent 9de16be012
commit ac0d1c18ed
3 files changed
+33 -6

No files matched your search

+19 -4
View File
@@ -7,6 +7,7 @@
#include <QPushButton>
#include <QPainter>
#include <QPixmap>
#include <QDebug>
#include <QMouseEvent>
/* QListView that prevents deselection, handles invite plus-button clicks */
@@ -180,6 +181,8 @@ void ChannelList::loadChannels() {
item->setData(QString(), ChannelLastMessageRole);
item->setData(makeChannelIcon(colors[ci % 6], letter), ChannelIconRole);
m_model->appendRow(item);
qDebug() << "ChannelList::loadChannels row=" << (m_model->rowCount()-1)
<< "cid='" << ch.channelId << "' name='" << ch.name << "'";
ci++;
}
@@ -204,14 +207,26 @@ void ChannelList::selectChannel(const QString& channelId) {
}
void ChannelList::setChannelPeersOnline(const QString& channelId, int count) {
int found = 0;
qDebug() << "ChannelList::setChannelPeersOnline search='" << channelId
<< "' online=" << count << " rows=" << m_model->rowCount();
for (int row = 0; row < m_model->rowCount(); row++) {
QStandardItem* item = m_model->item(row);
if (item && item->data(ChannelChannelIdRole).toString() == channelId) {
item->setData(count, ChannelPeersOnlineRole);
item->setData(m_autoConnectActive ? 1 : 0, ChannelAutoConnectActiveRole);
break;
if (item) {
QString itemCid = item->data(ChannelChannelIdRole).toString();
int match = (itemCid == channelId) ? 1 : 0;
qDebug() << " row=" << row << "cid='" << itemCid << "' match=" << match;
if (match) {
item->setData(count, ChannelPeersOnlineRole);
item->setData(m_autoConnectActive ? 1 : 0, ChannelAutoConnectActiveRole);
qDebug() << " SET online=" << count;
found = 1;
break;
}
}
}
if (!found)
qDebug() << " NOT FOUND in model";
}
void ChannelList::setAutoConnectActive(bool active) {
+1
View File
@@ -297,6 +297,7 @@ void MainWindow::onAutoConnectStatus(uint8_t status, uint16_t /*total_tried*/,
void MainWindow::onChannelPeersOnline(const char* ch_id, int ch_id_len, uint16_t online) {
if (m_channelList) {
QString cid = QString::fromUtf8(ch_id, ch_id_len);
qDebug() << "MainWindow::onChannelPeersOnline cid=" << cid << "online=" << online;
m_channelList->setChannelPeersOnline(cid, (int)online);
}
}