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
@@ -18,7 +18,7 @@ QVariant MemberListModel::data(const QModelIndex& index, int role) const {
|
||||
|
||||
auto it = m_cache.find(index.row());
|
||||
if (it != m_cache.end()) {
|
||||
if (role == Qt::DisplayRole) return it->name;
|
||||
if (role == Qt::DisplayRole) return it->localNick.isEmpty() ? it->name : it->localNick;
|
||||
if (role == Qt::DecorationRole) return QVariant::fromValue(QIcon(it->avatar));
|
||||
if (role == Qt::UserRole + 1) {
|
||||
QString sub;
|
||||
@@ -93,6 +93,7 @@ void MemberListModel::loadBatch(int from, int count) {
|
||||
item.online = members[i].online;
|
||||
QString shortId = QString("%1").arg(members[i].nodeId, 8, 16, QChar('0')).right(4).toUpper();
|
||||
item.name = members[i].name.isEmpty() ? shortId : members[i].name;
|
||||
item.localNick = members[i].localNick;
|
||||
QColor c = members[i].online ? QColor("#4CAF50") : QColor("#9E9E9E");
|
||||
item.avatar = makeAvatar(c, item.name[0]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user