Skip to content
Snippets Groups Projects
Commit de3cdd59 authored by Loren Burkholder's avatar Loren Burkholder
Browse files

Add status message to D-Bus API

parent 76347f1c
Branches dbusStatus
No related tags found
No related merge requests found
Pipeline #3915 passed
......@@ -152,6 +152,15 @@ directChat(const QString &userId)
interface.isValid())
interface.call(QDBus::NoBlock, QStringLiteral("directChat"), userId);
}
void
setStatusMessage(const QString &message)
{
if (QDBusInterface interface{QStringLiteral(NHEKO_DBUS_SERVICE_NAME), QStringLiteral("/")};
interface.isValid())
interface.call(QDBus::NoBlock, QStringLiteral("setStatusMessage"), message);
}
} // nheko::dbus
/**
......
......@@ -80,6 +80,9 @@ joinRoom(const QString &alias);
//! desired).
void
directChat(const QString &userId);
//! Sets the user's status message (if supported by the homeserver).
void
setStatusMessage(const QString &message);
QDBusArgument &
operator<<(QDBusArgument &arg, const RoomInfoItem &item);
......
......@@ -100,6 +100,12 @@ NhekoDBusBackend::directChat(const QString &userId) const
ChatPage::instance()->startChat(userId);
}
void
NhekoDBusBackend::setStatusMessage(const QString &message)
{
ChatPage::instance()->setStatus(message);
}
void
NhekoDBusBackend::bringWindowToTop() const
{
......
......@@ -37,6 +37,8 @@ public slots:
//! Starts or activates a direct chat. It is your responsibility to ask for confirmation (if
//! desired).
Q_SCRIPTABLE void directChat(const QString &userId) const;
//! Sets the user's status message.
Q_SCRIPTABLE void setStatusMessage(const QString &message);
private:
void bringWindowToTop() const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment