mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
added avatars for GXS ids in distant chat
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7928 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a7b902a0ee
commit
b731999f99
4 changed files with 33 additions and 9 deletions
|
@ -60,7 +60,7 @@ protected:
|
|||
virtual void addChatMsg(const ChatMessage& msg);
|
||||
//virtual void onChatChanged(int list, int type);
|
||||
|
||||
private:
|
||||
protected:
|
||||
bool manualDelete;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
|
|
|
@ -63,8 +63,11 @@ void PopupDistantChatDialog::init(const RsGxsId &gxs_id,const QString & title)
|
|||
_pid = gxs_id ;
|
||||
PopupChatDialog::init(ChatId(gxs_id), title) ;
|
||||
|
||||
// hide avatar frame, because it does not have funcntionality for gxs
|
||||
showAvatarFrame(false);
|
||||
RsGxsId own_gxs_id ;
|
||||
uint32_t status ;
|
||||
|
||||
if(rsMsgs->getDistantChatStatus(gxs_id,status,&own_gxs_id))
|
||||
ui.ownAvatarWidget->setOwnId(own_gxs_id);
|
||||
}
|
||||
|
||||
void PopupDistantChatDialog::updateDisplay()
|
||||
|
@ -164,5 +167,14 @@ QString PopupDistantChatDialog::getPeerName(const ChatId &id) const
|
|||
|
||||
QString PopupDistantChatDialog::getOwnName() const
|
||||
{
|
||||
return QString("me (TODO: gxs-name)");
|
||||
uint32_t status= RS_DISTANT_CHAT_STATUS_UNKNOWN;
|
||||
RsGxsId from_gxs_id ;
|
||||
|
||||
rsMsgs->getDistantChatStatus(_pid,status,&from_gxs_id) ;
|
||||
|
||||
RsIdentityDetails details ;
|
||||
if(rsIdentity->getIdDetails(from_gxs_id,details))
|
||||
return QString::fromUtf8( details.mNickname.c_str() ) ;
|
||||
else
|
||||
return QString::fromStdString(from_gxs_id.toStdString()) ;
|
||||
}
|
||||
|
|
|
@ -135,7 +135,12 @@ void AvatarWidget::setId(const ChatId &id)
|
|||
refreshAvatarImage();
|
||||
refreshStatus();
|
||||
}
|
||||
void AvatarWidget::setOwnId(const RsGxsId& own_gxs_id)
|
||||
{
|
||||
mFlag.isOwnId = true;
|
||||
|
||||
setId(ChatId(own_gxs_id));
|
||||
}
|
||||
void AvatarWidget::setOwnId()
|
||||
{
|
||||
mFlag.isOwnId = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue