Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
fix(identicon): don't set identicon as an avatar
Browse files Browse the repository at this point in the history
Do not save user's identicon to a file like a normal avatar. This allows
'Use identicons' setting to affect user's own identicon.
  • Loading branch information
tox-user committed Nov 22, 2017
1 parent 905ca77 commit 676be5f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/persistence/profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ QPixmap Profile::loadAvatar(const ToxPk& owner)
} else {
pic.loadFromData(avataData);
}

} else {
pic.loadFromData(loadAvatarData(owner));
}
Expand Down Expand Up @@ -477,10 +477,7 @@ void Profile::setAvatar(QByteArray pic, const ToxPk& owner)
// with IDENTICON_ROWS=5 this gives a 160x160 image file
const QImage identicon = Identicon(owner.getKey()).toImage(32);
pixmap = QPixmap::fromImage(identicon);
QBuffer buf(&avatarData);
buf.open(QIODevice::WriteOnly);
identicon.save(&buf, "png");


} else {
pixmap.load(":/img/contact_dark.svg");
}
Expand Down

0 comments on commit 676be5f

Please sign in to comment.