mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
pass ServerInfo_User down the chain (#5542)
This commit is contained in:
parent
26c0cdc072
commit
0fc05e15cd
7 changed files with 17 additions and 28 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ public:
|
|||
QString optionalFontColor = QString());
|
||||
void appendMessage(QString message,
|
||||
RoomMessageTypeFlags messageType = {},
|
||||
const QString &userName = QString(),
|
||||
UserLevelFlags userLevel = UserLevelFlags(),
|
||||
QString UserPrivLevel = "NONE",
|
||||
const ServerInfo_User &userInfo = {},
|
||||
bool playerBold = false);
|
||||
void clearChat();
|
||||
void redactMessages(const QString &userName, int amount);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue