Rebrand files names Spectral -> NeoChat
This commit is contained in:
33
src/neochatuser.cpp
Normal file
33
src/neochatuser.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user