Rebrand files names Spectral -> NeoChat

This commit is contained in:
Carl Schwan
2020-11-08 23:17:30 +01:00
parent c2c49c69fe
commit 122a7cdd2f
71 changed files with 787 additions and 273 deletions

33
src/neochatuser.cpp Normal file
View File

@@ -0,0 +1,33 @@
#include "neochatuser.h"
#include "csapi/profile.h"
QColor NeoChatUser::color()
{
return QColor::fromHslF(hueF(), 0.7, 0.5, 1);
}
//TODO libQuotient 0.7: remove default name
void NeoChatUser::setDefaultName(QString defaultName)
{
rename(defaultName);
connect(this, &Quotient::User::defaultNameChanged, this, [this]() {
m_defaultName = "";
qDebug() << "asdf";
Q_EMIT nameChanged();
});
}
QString NeoChatUser::defaultName()
{
if(m_defaultName.isEmpty()) {
GetDisplayNameJob *job = connection()->callApi<GetDisplayNameJob>(id());
connect(job, &BaseJob::success, this, [this, job] {
if(job->displayname().isEmpty())
m_defaultName = id();
else
m_defaultName = job->displayname();
Q_EMIT nameChanged();
});
}
return m_defaultName;
}