diff --git a/tools/chatgui/src/mainwindow.cpp b/tools/chatgui/src/mainwindow.cpp index 39493aaa..1e9d93d2 100644 --- a/tools/chatgui/src/mainwindow.cpp +++ b/tools/chatgui/src/mainwindow.cpp @@ -32,9 +32,8 @@ extern "C" { static MainWindow* s_mainWindow = nullptr; static void onMsgReceivedCallback(const char* ch_id, int ch_id_len, uint64_t author) { - Q_UNUSED(ch_id_len); if (s_mainWindow) - s_mainWindow->onMessageReceived(ch_id, author); + s_mainWindow->onMessageReceived(ch_id, ch_id_len, author); } static void onChannelUpdatedCallback(const char* ch_id, int ch_id_len) { @@ -334,8 +333,8 @@ void MainWindow::showSettings() { dlg.exec(); } -void MainWindow::onMessageReceived(const char* ch_id, uint64_t author) { - QString cid = QString::fromUtf8(ch_id); +void MainWindow::onMessageReceived(const char* ch_id, int ch_id_len, uint64_t author) { + QString cid = QString::fromUtf8(ch_id, ch_id_len); DEBUG_INFO(DEBUG_CATEGORY_DEBUG, "MainWindow::onMessageReceived ch=%s author=%llu cur=%s", qPrintable(cid), (unsigned long long)author, qPrintable(m_currentChannelId)); if (m_db && author != m_db->myNodeId()) diff --git a/tools/chatgui/src/mainwindow.h b/tools/chatgui/src/mainwindow.h index 3b7ee783..814f3a2b 100644 --- a/tools/chatgui/src/mainwindow.h +++ b/tools/chatgui/src/mainwindow.h @@ -31,7 +31,7 @@ private slots: void showSettings(); public: - void onMessageReceived(const char* ch_id, uint64_t author); + void onMessageReceived(const char* ch_id, int ch_id_len, uint64_t author); void onMembersChanged(const char* ch_id); void onAutoConnectStatus(uint8_t status, uint16_t total, uint16_t totalNodes, uint16_t connected); void onChannelPeersOnline(const char* ch_id, int ch_id_len, uint16_t online);