diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 98af6a07b..a71e6be11 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -262,23 +262,6 @@ void NeoChatRoom::forget() connection()->forgetRoom(id()); } -QVariantList NeoChatRoom::getUsersTyping() const -{ - auto members = membersTyping(); - members.removeAll(localMember()); - QVariantList userVariants; - for (const auto &member : members) { - if (connection()->isIgnored(member.id())) { - continue; - } - userVariants.append(QVariantMap{ - {"id"_ls, member.id()}, - {"displayName"_ls, member.displayName()}, - }); - } - return userVariants; -} - void NeoChatRoom::sendTypingNotification(bool isTyping) { connection()->callApi(BackgroundRequest, localMember().id(), id(), isTyping, 10000); diff --git a/src/neochatroom.h b/src/neochatroom.h index 6a13dfaa0..c94e17b06 100644 --- a/src/neochatroom.h +++ b/src/neochatroom.h @@ -40,27 +40,6 @@ class NeoChatRoom : public Quotient::Room QML_ELEMENT QML_UNCREATABLE("") - /** - * @brief A list of users currently typing in the room. - * - * The list does not include the local user. - * - * This is different to getting a list of Quotient::User objects - * as neither of those can provide details like the displayName or avatarMediaId - * without the room context as these can vary from room to room. This function - * provides the room context and puts the result as a list of QVariantMap objects. - * - * @return a QVariantMap for the user with the following - * parameters: - * - id - User ID. - * - avatarMediaId - Avatar id in the context of this room. - * - displayName - Display name in the context of this room. - * - display - Name in the context of this room. - * - * @sa Quotient::User - */ - Q_PROPERTY(QVariantList usersTyping READ getUsersTyping NOTIFY typingChanged) - /** * @brief Convenience function to get the QDateTime of the last event. * @@ -235,8 +214,6 @@ public: explicit NeoChatRoom(Quotient::Connection *connection, QString roomId, Quotient::JoinState joinState = {}); - [[nodiscard]] QVariantList getUsersTyping() const; - [[nodiscard]] QDateTime lastActiveTime(); /** diff --git a/src/qml/TimelineView.qml b/src/qml/TimelineView.qml index 358c06e27..01227664b 100644 --- a/src/qml/TimelineView.qml +++ b/src/qml/TimelineView.qml @@ -263,8 +263,8 @@ QQC2.ScrollView { TypingPane { id: typingPane - visible: root.currentRoom && root.currentRoom.usersTyping.length > 0 - labelText: visible ? i18ncp("Message displayed when some users are typing", "%2 is typing", "%2 are typing", root.currentRoom.usersTyping.length, root.currentRoom.usersTyping.map(user => user.displayName).join(", ")) : "" + visible: root.currentRoom && root.currentRoom.otherMembersTyping.length > 0 + labelText: visible ? i18ncp("Message displayed when some users are typing", "%2 is typing", "%2 are typing", root.currentRoom.otherMembersTyping.length, root.currentRoom.otherMembersTyping.map(member => member.displayName).join(", ")) : "" anchors.left: parent.left anchors.bottom: parent.bottom height: visible ? implicitHeight : 0