From ccee594a28eafe489b7b8b55408f14e04bbb2f16 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 7 Feb 2015 22:43:53 +0000 Subject: [PATCH] half way through enabling GXS avatars into distant chat. Converted AvatarWidget to use a generic ChatId instead of RsPeerId. Still need to add own Id to PopupDistantChatDialog and properly compute own name. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7924 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- retroshare-gui/src/gui/FriendsDialog.cpp | 2 +- .../src/gui/chat/PopupChatDialog.cpp | 5 +- retroshare-gui/src/gui/common/AvatarDefs.cpp | 48 ++-- retroshare-gui/src/gui/common/AvatarDefs.h | 10 +- .../src/gui/common/AvatarWidget.cpp | 216 ++++++++++-------- retroshare-gui/src/gui/common/AvatarWidget.h | 16 +- retroshare-gui/src/gui/common/FriendList.cpp | 4 +- .../src/gui/connect/ConfCertDialog.cpp | 2 +- retroshare-gui/src/gui/feeds/ChatMsgItem.cpp | 2 +- retroshare-gui/src/gui/feeds/MsgItem.cpp | 30 ++- retroshare-gui/src/gui/feeds/MsgItem.h | 2 +- retroshare-gui/src/gui/feeds/PeerItem.cpp | 2 +- retroshare-gui/src/gui/feeds/SecurityItem.cpp | 2 +- .../src/gui/toaster/ChatToaster.cpp | 2 +- .../src/gui/toaster/GroupChatToaster.cpp | 2 +- .../src/gui/toaster/OnlineToaster.cpp | 4 +- 16 files changed, 207 insertions(+), 142 deletions(-) diff --git a/retroshare-gui/src/gui/FriendsDialog.cpp b/retroshare-gui/src/gui/FriendsDialog.cpp index dbd03116e..3261081ff 100644 --- a/retroshare-gui/src/gui/FriendsDialog.cpp +++ b/retroshare-gui/src/gui/FriendsDialog.cpp @@ -87,8 +87,8 @@ FriendsDialog::FriendsDialog(QWidget *parent) connect( ui.actionSet_your_Avatar, SIGNAL(triggered()), this, SLOT(getAvatar())); connect( ui.actionSet_your_Personal_Message, SIGNAL(triggered()), this, SLOT(statusmessage())); - ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME); ui.avatar->setOwnId(); + ui.avatar->setFrameType(AvatarWidget::STATUS_FRAME); ui.tabWidget->setTabPosition(QTabWidget::North); ui.tabWidget->addTab(networkView = new NetworkView(),QIcon(IMAGE_NETWORK2), tr("Network graph")); diff --git a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp index b23c953eb..f8a5460ee 100644 --- a/retroshare-gui/src/gui/chat/PopupChatDialog.cpp +++ b/retroshare-gui/src/gui/chat/PopupChatDialog.cpp @@ -58,9 +58,8 @@ void PopupChatDialog::init(const ChatId &chat_id, const QString &title) /* Hide or show the avatar frames */ showAvatarFrame(PeerSettings->getShowAvatarFrame(chat_id)); - ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); - ui.avatarWidget->setId(chat_id.toPeerId()); // not 100% correct, since this code is also used for distant chat - // but distance peers don't have a status anyway + ui.avatarWidget->setId(chat_id); + ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); ui.ownAvatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); ui.ownAvatarWidget->setOwnId(); diff --git a/retroshare-gui/src/gui/common/AvatarDefs.cpp b/retroshare-gui/src/gui/common/AvatarDefs.cpp index 59d91020a..f4bcb20c1 100644 --- a/retroshare-gui/src/gui/common/AvatarDefs.cpp +++ b/retroshare-gui/src/gui/common/AvatarDefs.cpp @@ -23,6 +23,8 @@ #include #include +#include +#include #include "AvatarDefs.h" @@ -44,37 +46,57 @@ void AvatarDefs::getOwnAvatar(QPixmap &avatar, const QString& defaultImage) delete[] data; } +void AvatarDefs::getAvatarFromSslId(const RsPeerId& sslId, QPixmap &avatar, const QString& defaultImage) +{ + unsigned char *data = NULL; + int size = 0; -void AvatarDefs::getAvatarFromSslId(const std::string& sslId, QPixmap &avatar, const QString& defaultImage) + /* get avatar */ + rsMsgs->getAvatarData(RsPeerId(sslId), data, size); + if (size == 0) { + avatar = QPixmap(defaultImage); + return; + } + + /* load image */ + avatar.loadFromData(data, size, "PNG") ; + + delete[] data; +} +void AvatarDefs::getAvatarFromGxsId(const RsGxsId& gxsId, QPixmap &avatar, const QString& defaultImage) { unsigned char *data = NULL; - int size = 0; + int size = 0; - /* get avatar */ - rsMsgs->getAvatarData(RsPeerId(sslId), data, size); - if (size == 0) { - avatar = QPixmap(defaultImage); - return; - } + /* get avatar */ + RsIdentityDetails details ; - /* load image */ - avatar.loadFromData(data, size, "PNG") ; + if(!rsIdentity->getIdDetails(gxsId, details)) + { + avatar = QPixmap(defaultImage); + return ; + } + + /* load image */ + + if(details.mAvatar.mSize == 0 || !avatar.loadFromData(details.mAvatar.mData, details.mAvatar.mSize, "PNG")) + avatar = QPixmap::fromImage(GxsIdDetails::makeDefaultIcon(gxsId)); delete[] data; } -void AvatarDefs::getAvatarFromGpgId(const std::string& gpgId, QPixmap &avatar, const QString& defaultImage) +void AvatarDefs::getAvatarFromGpgId(const RsPgpId& gpgId, QPixmap &avatar, const QString& defaultImage) { unsigned char *data = NULL; int size = 0; - if (RsPgpId(gpgId) == rsPeers->getGPGOwnId()) { + if (gpgId == rsPeers->getGPGOwnId()) { /* Its me */ rsMsgs->getOwnAvatarData(data,size); } else { /* get the first available avatar of one of the ssl ids */ std::list sslIds; - if (rsPeers->getAssociatedSSLIds(RsPgpId(gpgId), sslIds)) { + if (rsPeers->getAssociatedSSLIds(gpgId, sslIds)) { std::list::iterator sslId; for (sslId = sslIds.begin(); sslId != sslIds.end(); ++sslId) { rsMsgs->getAvatarData(*sslId, data, size); diff --git a/retroshare-gui/src/gui/common/AvatarDefs.h b/retroshare-gui/src/gui/common/AvatarDefs.h index c79a3a797..d468e8546 100644 --- a/retroshare-gui/src/gui/common/AvatarDefs.h +++ b/retroshare-gui/src/gui/common/AvatarDefs.h @@ -25,6 +25,8 @@ #include #include +#include +#include #define AVATAR_DEFAULT_IMAGE ":/images/no_avatar_background.png" @@ -33,9 +35,11 @@ class QPixmap; class AvatarDefs { public: - static void getOwnAvatar(QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); - static void getAvatarFromSslId(const std::string& sslId, QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); - static void getAvatarFromGpgId(const std::string& gpgId, QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); + static void getOwnAvatar(QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); + + static void getAvatarFromSslId(const RsPeerId& sslId, QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); + static void getAvatarFromGpgId(const RsPgpId & gpgId, QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); + static void getAvatarFromGxsId(const RsGxsId & gxsId, QPixmap &avatar, const QString& defaultImage = AVATAR_DEFAULT_IMAGE); }; #endif diff --git a/retroshare-gui/src/gui/common/AvatarWidget.cpp b/retroshare-gui/src/gui/common/AvatarWidget.cpp index 02fc3b9c8..b90f7e214 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.cpp +++ b/retroshare-gui/src/gui/common/AvatarWidget.cpp @@ -116,138 +116,160 @@ void AvatarWidget::setFrameType(FrameType type) break; } - refreshStatus(); - updateAvatar(QString::fromStdString(mId.toStdString())); - Rshare::refreshStyleSheet(this, false); + //refreshAvatarImage(); + refreshStatus(); + Rshare::refreshStyleSheet(this, false); } -void AvatarWidget::setId(const RsPeerId &id) +void AvatarWidget::setId(const ChatId &id) { mId = id; // mPgpId = rsPeers->getGPGId(id) ; // mFlag.isGpg = false ; - if (mId == rsPeers->getOwnId()) { - mFlag.isOwnId = true; - setToolTip(tr("Click to change your avatar")); - } - setPixmap(QPixmap()); - if (id.isNull()) { + if (id.isNotSet()) { setEnabled(false); } + refreshAvatarImage(); refreshStatus(); - updateAvatar(QString::fromStdString(mId.toStdString())); } void AvatarWidget::setOwnId() { - setId(rsPeers->getOwnId()); + mFlag.isOwnId = true; + setToolTip(tr("Click to change your avatar")); + + setId(ChatId(rsPeers->getOwnId())); } -void AvatarWidget::setDefaultAvatar(const QString &avatar) +void AvatarWidget::setDefaultAvatar(const QString &avatar_file_name) { - defaultAvatar = avatar; - updateAvatar(QString::fromStdString(mId.toStdString())); + defaultAvatar = avatar_file_name; + refreshAvatarImage(); } void AvatarWidget::refreshStatus() { - switch (mFrameType) { - case NO_FRAME: - case NORMAL_FRAME: - { - Rshare::refreshStyleSheet(this, false); - break; - } - case STATUS_FRAME: - { - StatusInfo statusInfo; + switch (mFrameType) + { + case NO_FRAME: + case NORMAL_FRAME: + { + Rshare::refreshStyleSheet(this, false); + break; + } + case STATUS_FRAME: + { + uint32_t status ; - if (mFlag.isOwnId) { - rsStatus->getOwnStatus(statusInfo); - } else { - // No check of return value. Non existing status info is handled as offline. - rsStatus->getStatus(mId, statusInfo); - } - updateStatus(QString::fromStdString(statusInfo.id.toStdString()), statusInfo.status); - break; - } - } + if(mId.isNotSet()) + return ; + + if (mFlag.isOwnId) + { + if(mId.isPeerId()) + { + StatusInfo statusInfo; + rsStatus->getOwnStatus(statusInfo); + status = statusInfo.status ; + } + else if(mId.isGxsId()) + status = RS_STATUS_ONLINE ; + else + { + std::cerr << "Unhandled chat id type in AvatarWidget::refreshStatus()" << std::endl; + return ; + } + } + else + { + // No check of return value. Non existing status info is handled as offline. + if(mId.isPeerId()) + { + StatusInfo statusInfo; + rsStatus->getStatus(mId.toPeerId(), statusInfo); + status = statusInfo.status ; + } + else if(mId.isGxsId()) + { + if(!rsMsgs->getDistantChatStatus(mId.toGxsId(),status)) + status = RS_STATUS_OFFLINE ; + } + else + { + std::cerr << "Unhandled chat id type in AvatarWidget::refreshStatus()" << std::endl; + return ; + } + } + updateStatus(status); + break; + } + } } -void AvatarWidget::updateStatus(const QString peerId, int status) +void AvatarWidget::updateStatus(const QString& peerId, int status) { - if (mFrameType != STATUS_FRAME) { - return; - } + if (mId.isPeerId() && mId.toPeerId() == RsPeerId(peerId.toStdString())) + updateStatus(status) ; +} - if (mId.isNull()) { - mPeerState = status; - Rshare::refreshStyleSheet(this, false); - } else { - /* set style for status */ - if (mId.toStdString() == peerId.toStdString()) { - // the peers status has changed - mPeerState = status; - setEnabled(((uint32_t) status == RS_STATUS_OFFLINE) ? false : true); - Rshare::refreshStyleSheet(this, false); - } - } +void AvatarWidget::updateStatus(int status) +{ + if (mFrameType != STATUS_FRAME) + return; + + mPeerState = status; + + setEnabled(((uint32_t) status == RS_STATUS_OFFLINE) ? false : true); + Rshare::refreshStyleSheet(this, false); } void AvatarWidget::updateAvatar(const QString &peerId) { - if (mId.isNull()) { - QPixmap avatar(defaultAvatar); - setPixmap(avatar); - return; - } + if(mId.isPeerId() && mId.toPeerId() == RsPeerId(peerId.toStdString())) + refreshAvatarImage() ; - if (mFlag.isOwnId) { - QPixmap avatar; - AvatarDefs::getOwnAvatar(avatar); - setPixmap(avatar); - return; - } - - //if (mFlag.isGpg) { - // if (mId == peerId.toStdString()) { - // /* called from AvatarWidget with gpg id */ - // QPixmap avatar; - // AvatarDefs::getAvatarFromGpgId(mId, avatar, defaultAvatar); - // setPixmap(avatar); - // return; - // } - // - // /* Is this one of the ssl ids of the gpg id ? */ - // std::list sslIds; - // if (rsPeers->getAssociatedSSLIds(mId, sslIds) == false) { - // return; - // } - // - // if (std::find(sslIds.begin(), sslIds.end(), peerId.toStdString()) != sslIds.end()) { - // /* One of the ssl ids of the gpg id */ - // QPixmap avatar; - // AvatarDefs::getAvatarFromGpgId(mId, avatar, defaultAvatar); - // setPixmap(avatar); - // } - // - // return; - //} - - if (mId.toStdString() == peerId.toStdString()) { - QPixmap avatar; - AvatarDefs::getAvatarFromSslId(mId.toStdString(), avatar, defaultAvatar); - setPixmap(avatar); - return; - } + if(mId.isGxsId() && mId.toGxsId() == RsGxsId(peerId.toStdString())) + refreshAvatarImage() ; +} +void AvatarWidget::refreshAvatarImage() +{ + if (mId.isNotSet()) + { + QPixmap avatar(defaultAvatar); + setPixmap(avatar); + return; + } + else if (mFlag.isOwnId && mId.isPeerId()) + { + QPixmap avatar; + AvatarDefs::getOwnAvatar(avatar); + setPixmap(avatar); + return; + } + else if (mId.isPeerId()) + { + QPixmap avatar; + AvatarDefs::getAvatarFromSslId(mId.toPeerId(), avatar, defaultAvatar); + setPixmap(avatar); + return; + } + else if (mId.isGxsId()) + { + QPixmap avatar; + AvatarDefs::getAvatarFromGxsId(mId.toGxsId(), avatar, defaultAvatar); + setPixmap(avatar); + return; + } + else + std::cerr << "WARNING: unhandled situation in AvatarWidget::refreshAvatarImage()" << std::endl; } void AvatarWidget::updateOwnAvatar() { - if (mFlag.isOwnId) { - updateAvatar(QString::fromStdString(mId.toStdString())); - } + if (mFlag.isOwnId) + refreshAvatarImage() ; } + diff --git a/retroshare-gui/src/gui/common/AvatarWidget.h b/retroshare-gui/src/gui/common/AvatarWidget.h index c7626a494..61db1bada 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.h +++ b/retroshare-gui/src/gui/common/AvatarWidget.h @@ -25,6 +25,7 @@ #include #include #include +#include namespace Ui { class AvatarWidget; @@ -48,25 +49,28 @@ public: QString frameState(); void setFrameType(FrameType type); - void setId(const RsPeerId &id) ; + void setId(const ChatId& id) ; void setOwnId(); - void setDefaultAvatar(const QString &avatar); + void setOwnId(const RsGxsId&); + void setDefaultAvatar(const QString &avatar_file_name); protected: void mouseReleaseEvent(QMouseEvent *event); private slots: - void updateStatus(const QString peerId, int status); + void updateStatus(const QString& peerId, int status); void updateAvatar(const QString& peerId); - void updateOwnAvatar(); + void updateOwnAvatar(); private: - void refreshStatus(); + void refreshAvatarImage() ; + void refreshStatus(); + void updateStatus(int status); QString defaultAvatar; Ui::AvatarWidget *ui; - RsPeerId mId; + ChatId mId; struct { bool isOwnId : 1; diff --git a/retroshare-gui/src/gui/common/FriendList.cpp b/retroshare-gui/src/gui/common/FriendList.cpp index 4789c1af0..9d5aecd03 100644 --- a/retroshare-gui/src/gui/common/FriendList.cpp +++ b/retroshare-gui/src/gui/common/FriendList.cpp @@ -562,7 +562,7 @@ void FriendList::updateAvatar(const QString& id) if ((*it)->type() == TYPE_SSL && id == (*it)->data(COLUMN_DATA, ROLE_ID).toString()) { if ((*it)->parent() != NULL && (*it)->parent()->type() == TYPE_GPG) { QPixmap avatar; - AvatarDefs::getAvatarFromSslId(id.toStdString(), avatar); + AvatarDefs::getAvatarFromSslId(RsPeerId(id.toStdString()), avatar); QIcon avatar_icon(avatar); (*it)->parent()->setIcon(COLUMN_AVATAR, avatar_icon); } @@ -1145,7 +1145,7 @@ void FriendList::insertPeers() // only set the avatar image the first time, or when it changed // otherwise getAvatarFromSslId sends request packages to peers. QPixmap avatar; - AvatarDefs::getAvatarFromSslId(bestSslId.toStdString(), avatar); + AvatarDefs::getAvatarFromSslId(bestSslId, avatar); QIcon avatar_icon(avatar); gpgItem->setIcon(COLUMN_AVATAR, avatar_icon); } diff --git a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp index 0fe72988d..f3fd8abdf 100644 --- a/retroshare-gui/src/gui/connect/ConfCertDialog.cpp +++ b/retroshare-gui/src/gui/connect/ConfCertDialog.cpp @@ -189,7 +189,7 @@ void ConfCertDialog::load() if (!detail.isOnlyGPGdetail) { - ui.avatar->setId(peerId); + ui.avatar->setId(ChatId(peerId)); ui.loc->setText(QString::fromUtf8(detail.location.c_str())); // Dont Show a timestamp in RS calculate the day diff --git a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp index adad3ae2c..54f9863a0 100644 --- a/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/ChatMsgItem.cpp @@ -64,7 +64,7 @@ ChatMsgItem::ChatMsgItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &pe connect(NotifyQt::getInstance(), SIGNAL(peerHasNewAvatar(const QString&)), this, SLOT(updateAvatar(const QString&))); - avatar->setId(mPeerId); + avatar->setId(ChatId(mPeerId)); updateItemStatic(); updateItem(); diff --git a/retroshare-gui/src/gui/feeds/MsgItem.cpp b/retroshare-gui/src/gui/feeds/MsgItem.cpp index f153d1caf..add5dc91a 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.cpp +++ b/retroshare-gui/src/gui/feeds/MsgItem.cpp @@ -80,18 +80,32 @@ void MsgItem::updateItemStatic() if (!rsMsgs->getMessage(mMsgId, mi)) return; - /* get peer Id */ - mPeerId = mi.rspeerid_srcId; + /* get peer Id */ + + if(mi.msgflags & RS_MSG_SIGNED) + mPeerId = ChatId(mi.rsgxsid_srcId); + else + mPeerId = ChatId(mi.rspeerid_srcId); avatar->setId(mPeerId); QString title; - QString srcName; - if ((mi.msgflags & RS_MSG_SYSTEM) && mi.rspeerid_srcId == rsPeers->getOwnId()) { + QString srcName; + + if ((mi.msgflags & RS_MSG_SYSTEM) && mi.rspeerid_srcId == rsPeers->getOwnId()) srcName = "RetroShare"; - } else { - srcName = QString::fromUtf8(rsPeers->getPeerName(mi.rspeerid_srcId).c_str()); - } + else + { + if(mi.msgflags & RS_MSG_SIGNED) + { + RsIdentityDetails details ; + rsIdentity->getIdDetails(mi.rsgxsid_srcId, details) ; + + srcName = QString::fromUtf8(details.mNickname.c_str()); + } + else + srcName = QString::fromUtf8(rsPeers->getPeerName(mi.rspeerid_srcId).c_str()); + } timestampLabel->setText(DateTime::formatLongDateTime(mi.ts)); @@ -102,7 +116,7 @@ void MsgItem::updateItemStatic() else { /* subject */ - uint32_t box = mi.msgflags & RS_MSG_BOXMASK; + uint32_t box = mi.msgflags & RS_MSG_BOXMASK; switch(box) { case RS_MSG_SENTBOX: diff --git a/retroshare-gui/src/gui/feeds/MsgItem.h b/retroshare-gui/src/gui/feeds/MsgItem.h index be5f74035..a71703bd3 100644 --- a/retroshare-gui/src/gui/feeds/MsgItem.h +++ b/retroshare-gui/src/gui/feeds/MsgItem.h @@ -58,7 +58,7 @@ private: FeedHolder *mParent; uint32_t mFeedId; - RsPeerId mPeerId; + ChatId mPeerId; std::string mMsgId; bool mIsHome; diff --git a/retroshare-gui/src/gui/feeds/PeerItem.cpp b/retroshare-gui/src/gui/feeds/PeerItem.cpp index 50b6abd00..9225cfea3 100644 --- a/retroshare-gui/src/gui/feeds/PeerItem.cpp +++ b/retroshare-gui/src/gui/feeds/PeerItem.cpp @@ -59,7 +59,7 @@ PeerItem::PeerItem(FeedHolder *parent, uint32_t feedId, const RsPeerId &peerId, connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem())); - avatar->setId(RsPeerId(mPeerId));// TODO: remove unnecesary converstation + avatar->setId(ChatId(mPeerId));// TODO: remove unnecesary converstation expandFrame->hide(); diff --git a/retroshare-gui/src/gui/feeds/SecurityItem.cpp b/retroshare-gui/src/gui/feeds/SecurityItem.cpp index 234089184..c90b9448c 100644 --- a/retroshare-gui/src/gui/feeds/SecurityItem.cpp +++ b/retroshare-gui/src/gui/feeds/SecurityItem.cpp @@ -73,7 +73,7 @@ SecurityItem::SecurityItem(FeedHolder *parent, uint32_t feedId, const RsPgpId &g connect(NotifyQt::getInstance(), SIGNAL(friendsChanged()), this, SLOT(updateItem())); - avatar->setId(mSslId); + avatar->setId(ChatId(mSslId)); expandFrame->hide(); diff --git a/retroshare-gui/src/gui/toaster/ChatToaster.cpp b/retroshare-gui/src/gui/toaster/ChatToaster.cpp index 48e25e0ee..0da74f301 100644 --- a/retroshare-gui/src/gui/toaster/ChatToaster.cpp +++ b/retroshare-gui/src/gui/toaster/ChatToaster.cpp @@ -37,7 +37,7 @@ ChatToaster::ChatToaster(const RsPeerId &peer_id, const QString &message) : QWid ui.textLabel->setText(RsHtml().formatText(NULL, message, RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS | RSHTML_FORMATTEXT_CLEANSTYLE)); ui.toasterLabel->setText(QString::fromUtf8(rsPeers->getPeerName(mPeerId).c_str())); ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); - ui.avatarWidget->setId(mPeerId); + ui.avatarWidget->setId(ChatId(mPeerId)); } void ChatToaster::chatButtonSlot() diff --git a/retroshare-gui/src/gui/toaster/GroupChatToaster.cpp b/retroshare-gui/src/gui/toaster/GroupChatToaster.cpp index f701b73fc..1e077c3e6 100644 --- a/retroshare-gui/src/gui/toaster/GroupChatToaster.cpp +++ b/retroshare-gui/src/gui/toaster/GroupChatToaster.cpp @@ -38,7 +38,7 @@ GroupChatToaster::GroupChatToaster(const RsPeerId &peerId, const QString &messag ui.toasterLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str())); ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); ui.avatarWidget->setDefaultAvatar(":/images/user/personal64.png"); - ui.avatarWidget->setId(peerId); + ui.avatarWidget->setId(ChatId(peerId)); } void GroupChatToaster::chatButtonSlot() diff --git a/retroshare-gui/src/gui/toaster/OnlineToaster.cpp b/retroshare-gui/src/gui/toaster/OnlineToaster.cpp index 776c9518e..f53e796b9 100644 --- a/retroshare-gui/src/gui/toaster/OnlineToaster.cpp +++ b/retroshare-gui/src/gui/toaster/OnlineToaster.cpp @@ -35,8 +35,8 @@ OnlineToaster::OnlineToaster(const RsPeerId &peerId) : QWidget(NULL) /* set informations */ ui.textLabel->setText(QString::fromUtf8(rsPeers->getPeerName(peerId).c_str())); - ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); - ui.avatarWidget->setId(peerId); + ui.avatarWidget->setId(ChatId(peerId)); + ui.avatarWidget->setFrameType(AvatarWidget::STATUS_FRAME); } void OnlineToaster::chatButtonSlot()