chatgui: local nicknames per channel member — edit via MemberPropsDialog, override display everywhere
This commit is contained in:
1 parent
373a2e4687
commit
85bdc00aaf
9 files changed
+87
-16
No files matched your search
@@ -130,6 +130,21 @@ void AccountList::showMemberDetail(quint64 nodeId) {
|
||||
if (m_detailName.isEmpty())
|
||||
m_detailName = QString("0x%1").arg(nodeId, 8, 16, QChar('0')).right(4).toUpper();
|
||||
|
||||
/* prefer local nickname */
|
||||
QString tbl = m_db->peersTableName(m_channelId);
|
||||
sqlite3_stmt* nickSt = nullptr;
|
||||
QByteArray nickSql = QString(
|
||||
"SELECT local_nick FROM \"%1\" WHERE node_id=?"
|
||||
).arg(tbl).toUtf8();
|
||||
if (sqlite3_prepare_v2(d, nickSql.constData(), -1, &nickSt, nullptr) == SQLITE_OK) {
|
||||
sqlite3_bind_int64(nickSt, 1, (sqlite3_int64)nodeId);
|
||||
if (sqlite3_step(nickSt) == SQLITE_ROW) {
|
||||
QString n = DbManager::colText(nickSt, 0);
|
||||
if (!n.isEmpty()) m_detailName = n;
|
||||
}
|
||||
sqlite3_finalize(nickSt);
|
||||
}
|
||||
|
||||
sqlite3_stmt* na = nullptr;
|
||||
sqlite3_prepare_v2(d,
|
||||
"SELECT family, protocol, address, port FROM node_addresses WHERE node_id=? ORDER BY family, port",
|
||||
|
||||
Reference in new issue
Block a user