pass ServerInfo_User down the chain (#5542)

This commit is contained in:
RickyRister 2025-02-01 17:04:49 -08:00 committed by GitHub
parent 26c0cdc072
commit 0fc05e15cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 17 additions and 28 deletions

View file

@ -149,11 +149,12 @@ void ChatView::appendUrlTag(QTextCursor &cursor, QString url)
void ChatView::appendMessage(QString message,
RoomMessageTypeFlags messageType,
const QString &userName,
UserLevelFlags userLevel,
QString UserPrivLevel,
const ServerInfo_User &userInfo,
bool playerBold)
{
const QString userName = QString::fromStdString(userInfo.name());
const UserLevelFlags userLevel = UserLevelFlags(userInfo.user_level());
bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum();
// messageType should be Event_RoomSay::UserMessage though we don't actually check
bool isUserMessage = !(userName.toLower() == "servatrice" || userName.isEmpty());
@ -189,8 +190,9 @@ void ChatView::appendMessage(QString message,
} else {
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
bool isBuddy = userListProxy->isUserBuddy(userName);
const QString privLevel = userInfo.has_privlevel() ? QString::fromStdString(userInfo.privlevel()) : "NONE";
cursor.insertImage(
UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, UserPrivLevel).toImage());
UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, isBuddy, privLevel).toImage());
cursor.insertText(" ");
cursor.setCharFormat(senderFormat);
cursor.insertText(userName);