mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(identicon): don't set identicon as an avatar
Do not save user's identicon to a file like a normal avatar. This allows 'Use identicons' setting to affect user's own identicon.
This commit is contained in:
parent
905ca77086
commit
676be5f625
|
@ -403,7 +403,7 @@ QPixmap Profile::loadAvatar(const ToxPk& owner)
|
|||
} else {
|
||||
pic.loadFromData(avataData);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
pic.loadFromData(loadAvatarData(owner));
|
||||
}
|
||||
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user