diff --git a/core/account.cpp b/core/account.cpp index 89ce95c..9811dd2 100644 --- a/core/account.cpp +++ b/core/account.cpp @@ -1556,7 +1556,11 @@ void Core::Account::onOwnVCardReceived(const QXmppVCardIq& card) QString Core::Account::getAvatarPath() const { - return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + name + "/" + "avatar." + avatarType; + if (avatarType.size() == 0) { + return ""; + } else { + return QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + "/" + name + "/" + "avatar." + avatarType; + } } void Core::Account::onContactAvatarChanged(Shared::Avatar type, const QString& path) diff --git a/ui/utils/messageline.cpp b/ui/utils/messageline.cpp index d692308..013d94c 100644 --- a/ui/utils/messageline.cpp +++ b/ui/utils/messageline.cpp @@ -212,8 +212,8 @@ void MessageLine::setPalAvatar(const QString& jid, const QString& path) void MessageLine::dropPalAvatar(const QString& jid) { std::map::iterator itr = palAvatars.find(jid); - if (itr != palNames.end()) { - palNames.erase(itr); + if (itr != palAvatars.end()) { + palAvatars.erase(itr); std::map::iterator pItr = palMessages.find(jid); if (pItr != palMessages.end()) { diff --git a/ui/widgets/conversation.cpp b/ui/widgets/conversation.cpp index 89a2a7f..ef06dd6 100644 --- a/ui/widgets/conversation.cpp +++ b/ui/widgets/conversation.cpp @@ -386,7 +386,11 @@ void Conversation::onClearButton() void Conversation::setAvatar(const QString& path) { - m_ui->avatar->setPixmap(path.size() == 0 ? Shared::iconPath("user", true) : path); + if (path.size() == 0) { + m_ui->avatar->setPixmap(Shared::icon("user", true).pixmap(QSize(50, 50))); + } else { + m_ui->avatar->setPixmap(path); + } } void Conversation::onAttachResize(const QSize& oldSize, const QSize& newSize) diff --git a/ui/widgets/conversation.ui b/ui/widgets/conversation.ui index acdc80b..75ca7c5 100644 --- a/ui/widgets/conversation.ui +++ b/ui/widgets/conversation.ui @@ -7,7 +7,7 @@ 0 0 572 - 485 + 484 @@ -95,11 +95,26 @@ + + + 0 + 0 + + + + + 16777215 + 16777215 + + - true + false + + + Qt::AlignCenter @@ -149,18 +164,33 @@ + + + 0 + 0 + + 60 60 + + + 50 + 50 + + true + + 5 +