mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 11:00:48 +03:00
Merge pull request #1222 from Nheko-Reborn/dbusStatus
Add status message to D-Bus API
This commit is contained in:
commit
a81aaa182a
4 changed files with 20 additions and 0 deletions
|
@ -152,6 +152,15 @@ directChat(const QString &userId)
|
||||||
interface.isValid())
|
interface.isValid())
|
||||||
interface.call(QDBus::NoBlock, QStringLiteral("directChat"), userId);
|
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
|
} // nheko::dbus
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -80,6 +80,9 @@ joinRoom(const QString &alias);
|
||||||
//! desired).
|
//! desired).
|
||||||
void
|
void
|
||||||
directChat(const QString &userId);
|
directChat(const QString &userId);
|
||||||
|
//! Sets the user's status message (if supported by the homeserver).
|
||||||
|
void
|
||||||
|
setStatusMessage(const QString &message);
|
||||||
|
|
||||||
QDBusArgument &
|
QDBusArgument &
|
||||||
operator<<(QDBusArgument &arg, const RoomInfoItem &item);
|
operator<<(QDBusArgument &arg, const RoomInfoItem &item);
|
||||||
|
|
|
@ -100,6 +100,12 @@ NhekoDBusBackend::directChat(const QString &userId) const
|
||||||
ChatPage::instance()->startChat(userId);
|
ChatPage::instance()->startChat(userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
NhekoDBusBackend::setStatusMessage(const QString &message)
|
||||||
|
{
|
||||||
|
ChatPage::instance()->setStatus(message);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
NhekoDBusBackend::bringWindowToTop() const
|
NhekoDBusBackend::bringWindowToTop() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,6 +37,8 @@ public slots:
|
||||||
//! Starts or activates a direct chat. It is your responsibility to ask for confirmation (if
|
//! Starts or activates a direct chat. It is your responsibility to ask for confirmation (if
|
||||||
//! desired).
|
//! desired).
|
||||||
Q_SCRIPTABLE void directChat(const QString &userId) const;
|
Q_SCRIPTABLE void directChat(const QString &userId) const;
|
||||||
|
//! Sets the user's status message.
|
||||||
|
Q_SCRIPTABLE void setStatusMessage(const QString &message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void bringWindowToTop() const;
|
void bringWindowToTop() const;
|
||||||
|
|
Loading…
Reference in a new issue