fix(chat): node online status race, WELCOME peer_needed off-by-one, JOIN missing proto byte
- node_put/node_update_verified: set online=1 on INSERT (nodes created when conn is UP) - channel_peers_all: fix peer_needed calculation (atl byte was missing) - cs_send_channel_join: add proto byte to address serialization matching all parsers
This commit is contained in:
1 parent
38eb51c679
commit
f476188566
18 files changed
+431
-24
No files matched your search
@@ -229,6 +229,33 @@ QList<MessageRow> DbManager::getMessagesSince(const QString& chId, qint64 sinceI
|
||||
return list;
|
||||
}
|
||||
|
||||
MessageRow DbManager::getMessageById(const QString& chId, qint64 msgId) const {
|
||||
MessageRow m;
|
||||
QString sql = QStringLiteral(
|
||||
"SELECT id, node_id, data, timestamp, chain_hash, author_signature, local_attrs"
|
||||
" FROM \"%1\" WHERE id = ?").arg(msgTableName(chId));
|
||||
sqlite3_stmt* stmt = prepareOrNull(sql.toUtf8().constData());
|
||||
if (!stmt) return m;
|
||||
sqlite3_bind_int64(stmt, 1, msgId);
|
||||
if (sqlite3_step(stmt) == SQLITE_ROW) {
|
||||
m.id = sqlite3_column_int64(stmt, 0);
|
||||
m.authorNodeId = (quint64)sqlite3_column_int64(stmt, 1);
|
||||
QByteArray jdata = colBlob(stmt, 2);
|
||||
m.contentType = QString::fromUtf8(parseJsonField(jdata, "ct"));
|
||||
if (m.contentType.isEmpty()) m.contentType = "text/plain";
|
||||
m.data = parseJsonField(jdata, "d");
|
||||
m.timestamp = sqlite3_column_int64(stmt, 3);
|
||||
m.datahash = 0;
|
||||
m.chainHash = colBlob(stmt, 4);
|
||||
m.signature = colBlob(stmt, 5);
|
||||
m.localAttrs = QByteArray((const char*)sqlite3_column_text(stmt, 6));
|
||||
m.isOutgoing = (m.authorNodeId == m_myNodeId);
|
||||
m.isRead = true;
|
||||
}
|
||||
sqlite3_finalize(stmt);
|
||||
return m;
|
||||
}
|
||||
|
||||
/* ── peers (UI) ── */
|
||||
|
||||
int DbManager::getChannelMemberCount(const QString& chId) const {
|
||||
|
||||
Reference in new issue
Block a user