removed member gxs_id from ChatId class, because ChatId now uses tunnel ids stored in distant_chat_id for distant chat.

reverted naming confusion in in libresapi ChatHandler and fixed author of distant chat messages (distant chat is still unfinished)
This commit is contained in:
electron128 2015-12-05 17:00:57 +01:00
parent 0ac76d621e
commit 7cd880e1e4
9 changed files with 43 additions and 55 deletions

View file

@ -124,19 +124,33 @@ void AvatarWidget::setFrameType(FrameType type)
void AvatarWidget::setId(const ChatId &id)
{
mId = id;
mGxsId.clear();
setPixmap(QPixmap());
if (id.isNotSet()) {
setEnabled(false);
}
if(mId.isGxsId())
std::cerr << "(EE) AvatarWidget should not be set to a GXS id." << std::endl;
refreshAvatarImage();
refreshStatus();
}
void AvatarWidget::setGxsId(const RsGxsId &id)
{
mId = ChatId();
mGxsId = id;
setPixmap(QPixmap());
if (id.isNull()) {
setEnabled(false);
}
refreshAvatarImage();
refreshStatus();
}
void AvatarWidget::setOwnId()
{
mFlag.isOwnId = true;
@ -242,6 +256,14 @@ void AvatarWidget::updateAvatar(const QString &peerId)
}
void AvatarWidget::refreshAvatarImage()
{
if (mGxsId.isNull()==false)
{
QPixmap avatar;
AvatarDefs::getAvatarFromGxsId(mGxsId, avatar, defaultAvatar);
setPixmap(avatar);
return;
}
if (mId.isNotSet())
{
QPixmap avatar(defaultAvatar);
@ -262,14 +284,6 @@ void AvatarWidget::refreshAvatarImage()
setPixmap(avatar);
return;
}
// else if (mId.isGxsId())
// {
// QPixmap avatar;
//
// AvatarDefs::getAvatarFromGxsId(mId.toGxsId(), avatar, defaultAvatar);
// setPixmap(avatar);
// return;
// }
else if (mId.isDistantChatId())
{
QPixmap avatar;