aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-26 08:05:01 -0400
committerKitsune Ral <Kitsune-Ral@users.sf.net>2018-03-26 08:05:01 -0400
commit93dc89d9353e9f30d42528d8ffaba992f58139aa (patch)
tree4a3c4e74f5f157002fb3f32baaa4f911655c3d3c
parentde05579f18a5c264fe0dbea68ea83abcff526d00 (diff)
downloadlibquotient-93dc89d9353e9f30d42528d8ffaba992f58139aa.tar.gz
libquotient-93dc89d9353e9f30d42528d8ffaba992f58139aa.zip
Room: isDirectChat() and directChatUsers()
isDirectChat() has been declared previously but not implemented, hence a bit of strangeness in the commit.
-rw-r--r--room.cpp10
-rw-r--r--room.h3
2 files changed, 13 insertions, 0 deletions
diff --git a/room.cpp b/room.cpp
index 48c27ba0..01055013 100644
--- a/room.cpp
+++ b/room.cpp
@@ -631,6 +631,16 @@ bool Room::isLowPriority() const
return d->tags.contains(LowPriorityTag);
}
+bool Room::isDirectChat() const
+{
+ return connection()->isDirectChat(id());
+}
+
+QList<const User*> Room::directChatUsers() const
+{
+ return connection()->directChatUsers(this);
+}
+
const RoomMessageEvent*
Room::Private::getEventWithFile(const QString& eventId) const
{
diff --git a/room.h b/room.h
index 0eb5ecc3..59566092 100644
--- a/room.h
+++ b/room.h
@@ -269,6 +269,9 @@ namespace QMatrixClient
/** Check whether this room is a direct chat */
bool isDirectChat() const;
+ /** Get the list of users this room is a direct chat with */
+ QList<const User*> directChatUsers() const;
+
Q_INVOKABLE QUrl urlToThumbnail(const QString& eventId);
Q_INVOKABLE QUrl urlToDownload(const QString& eventId);
Q_INVOKABLE QString fileNameToDownload(const QString& eventId);