Make Neochat compile against libQuotient 0.6
This commit is contained in:
committed by
Carl Schwan
parent
516ad863b8
commit
4e2b68dc0a
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user