mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-11-30 20:36:36 -05:00
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
This commit is contained in:
parent
3b5644c474
commit
ccee594a28
16 changed files with 207 additions and 142 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ private:
|
|||
FeedHolder *mParent;
|
||||
uint32_t mFeedId;
|
||||
|
||||
RsPeerId mPeerId;
|
||||
ChatId mPeerId;
|
||||
std::string mMsgId;
|
||||
|
||||
bool mIsHome;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue