mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix replay chatview with new gummys (#2340)
Fix #2334 This update fixes the violation that happens when watching replays to determin the proper user privlevel in order to generate the correct gummy.
This commit is contained in:
parent
847d959326
commit
dbf7d7f748
7 changed files with 12 additions and 12 deletions
|
|
@ -122,7 +122,7 @@ void ChatView::appendUrlTag(QTextCursor &cursor, QString url)
|
|||
cursor.setCharFormat(oldFormat);
|
||||
}
|
||||
|
||||
void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType, QString sender, UserLevelFlags userLevel, bool playerBold)
|
||||
void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType, QString sender, UserLevelFlags userLevel, QString UserPrivLevel, bool playerBold)
|
||||
{
|
||||
bool atBottom = verticalScrollBar()->value() >= verticalScrollBar()->maximum();
|
||||
bool sameSender = (sender == lastSender) && !lastSender.isEmpty();
|
||||
|
|
@ -159,9 +159,7 @@ void ChatView::appendMessage(QString message, RoomMessageTypeFlags messageType,
|
|||
if (!sender.isEmpty() && tabSupervisor->getUserListsTab()) {
|
||||
const int pixelSize = QFontInfo(cursor.charFormat().font()).pixelSize();
|
||||
QMap<QString, UserListTWI *> buddyList = tabSupervisor->getUserListsTab()->getBuddyList()->getUsers();
|
||||
QMap<QString, UserListTWI *> userList = tabSupervisor->getUserListsTab()->getAllUsersList()->getUsers();
|
||||
UserListTWI *vlu = userList.value(sender);
|
||||
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, buddyList.contains(sender), QString::fromStdString(vlu->getUserInfo().privlevel())).toImage());
|
||||
cursor.insertImage(UserLevelPixmapGenerator::generatePixmap(pixelSize, userLevel, buddyList.contains(sender), UserPrivLevel).toImage());
|
||||
cursor.insertText(" ");
|
||||
}
|
||||
cursor.setCharFormat(senderFormat);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue