1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Broadcast new avatars when changed

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-09-24 18:22:09 +02:00
parent ff2994a0fd
commit 86e483303f

View File

@ -455,10 +455,12 @@ void Core::onFileDataCallback(Tox*, int32_t friendnumber, uint8_t filenumber, co
}
void Core::onAvatarInfoCallback(Tox*, int32_t friendnumber, uint8_t format,
uint8_t *, void *)
uint8_t *, void* core)
{
qDebug() << "Core: Got avatar info from "<<friendnumber
<<": format "<<format;
tox_request_avatar_data(static_cast<Core*>(core)->tox, friendnumber);
}
void Core::onAvatarDataCallback(Tox*, int32_t friendnumber, uint8_t,
@ -786,6 +788,11 @@ void Core::setAvatar(uint8_t format, const QByteArray& data)
pic.loadFromData(data);
Settings::getInstance().saveAvatar(pic, getSelfId().toString());
emit selfAvatarChanged(pic);
// Broadcast our new avatar!
const uint32_t friendCount = tox_count_friendlist(tox);;
for (unsigned i=0; i<friendCount; i++)
tox_send_avatar_info(tox, i);
}
ToxID Core::getSelfId()