some more methods for archive to store avatar states

This commit is contained in:
Blue 2019-10-14 23:18:51 +03:00
parent 323a549eca
commit c678a790e5
6 changed files with 168 additions and 55 deletions

View file

@ -20,9 +20,10 @@
#include <QDebug>
Core::RosterItem::RosterItem(const QString& pJid, const QString& account, QObject* parent):
Core::RosterItem::RosterItem(const QString& pJid, const QString& pAccount, QObject* parent):
QObject(parent),
jid(pJid),
account(pAccount),
name(),
archiveState(empty),
archive(new Archive(jid)),
@ -331,3 +332,15 @@ bool Core::RosterItem::isMuc() const
{
return muc;
}
QString Core::RosterItem::avatarHash() const
{
return archive->getAvatarHash();
}
QString Core::RosterItem::avatarPath() const
{
QString path(QStandardPaths::writableLocation(QStandardPaths::CacheLocation));
path += "/" + account + "/" + jid + "/avatar." + archive->getAvatarType();
return path;
}