chat: гейт авто-синхронизации db_sync до member_sync/pubkeys + member tags (verified/deleted) в chatgui

This commit is contained in:
evgeny committed 2026-09-05 20:38:22 +03:00
1 parent 079f56b3ba
commit f5ba67149a
8 files changed
+83 -3

No files matched your search

+18
View File
@@ -43,6 +43,8 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
/* load current nick and version from DB (local_nick is local-only, ver is in adm_tags) */
QString curNick;
bool curVerified = false;
bool curDeleted = false;
m_currentVer = 0;
if (m_db->m_db) {
QString tbl = m_db->peersTableName(channelId);
@@ -57,6 +59,10 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
if (tags) {
const char* vp = strstr(tags, "\"ver\":\"");
if (vp) { vp += 7; m_currentVer = atoi(vp); }
const char* vr = strstr(tags, "\"verified\":\"");
if (vr) { vr += 12; curVerified = (strncmp(vr, "yes", 3) == 0); }
const char* dl = strstr(tags, "\"deleted\":\"");
if (dl) { dl += 11; curDeleted = (strncmp(dl, "yes", 3) == 0); }
}
curNick = DbManager::colText(st, 1);
}
@@ -95,6 +101,16 @@ MemberPropsDialog::MemberPropsDialog(DbManager* db, const QString& channelId,
m_storageCb->setEnabled(haveKey);
layout->addWidget(m_storageCb);
m_verifiedCb = new QCheckBox("Verified", this);
m_verifiedCb->setChecked(curVerified);
m_verifiedCb->setEnabled(haveKey);
layout->addWidget(m_verifiedCb);
m_deletedCb = new QCheckBox("Deleted", this);
m_deletedCb->setChecked(curDeleted);
m_deletedCb->setEnabled(haveKey);
layout->addWidget(m_deletedCb);
if (!haveKey) {
auto* hint = new QLabel("(Admin/Super require channel private key)", this);
hint->setStyleSheet("color: gray; font-size: 11px;");
@@ -157,6 +173,8 @@ void MemberPropsDialog::onSave() {
json += QString(",\"admin\":\"%1\"").arg(m_adminCb->isChecked() ? "yes" : "no");
json += QString(",\"supernode\":\"%1\"").arg(m_superCb->isChecked() ? "yes" : "no");
json += QString(",\"storage\":\"%1\"").arg(m_storageCb->isChecked() ? "yes" : "no");
json += QString(",\"verified\":\"%1\"").arg(m_verifiedCb->isChecked() ? "yes" : "no");
json += QString(",\"deleted\":\"%1\"").arg(m_deletedCb->isChecked() ? "yes" : "no");
json += "}";
struct chat_member_tags_req* req = (struct chat_member_tags_req*)