Make Neochat compile against libQuotient 0.6

This commit is contained in:
Tobias Fella
2020-11-18 22:20:01 +01:00
committed by Carl Schwan
parent 516ad863b8
commit 4e2b68dc0a
7 changed files with 15 additions and 53 deletions

View File

@@ -11,27 +11,3 @@ 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 = "";
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;
}