diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-24 14:43:03 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-02-24 19:48:35 +0900 |
commit | e09c740c85e2e9a861e84f706680ce1ec662a4bc (patch) | |
tree | d4f81ab5d61664aa1f2d28deeb81bc2c96ee264c /room.h | |
parent | c12f5cc213ecbb40c506e304e6b41c1437ca0d33 (diff) | |
download | libquotient-e09c740c85e2e9a861e84f706680ce1ec662a4bc.tar.gz libquotient-e09c740c85e2e9a861e84f706680ce1ec662a4bc.zip |
User/Room: signal that a user/member is about to change the name
Enables to address QMatrixClient/Quaternion#284. Also fixes a gibberish condition in Room::Private::renameMember() that led to improper warnings and a too early return.
Diffstat (limited to 'room.h')
-rw-r--r-- | room.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -301,6 +301,7 @@ namespace QMatrixClient void avatarChanged(); void userAdded(User* user); void userRemoved(User* user); + void memberAboutToRename(User* user, QString newName); void memberRenamed(User* user); void memberListChanged(); @@ -345,12 +346,13 @@ namespace QMatrixClient explicit MemberSorter(const Room* r) : room(r) { } bool operator()(User* u1, User* u2) const; + bool operator()(User* u1, const QString& u2name) const; - template <typename ContT> + template <typename ContT, typename ValT> typename ContT::size_type lowerBoundIndex(const ContT& c, - typename ContT::value_type v) const + const ValT& v) const { - return std::lower_bound(c.begin(), c.end(), v, *this) - c.begin(); + return std::lower_bound(c.begin(), c.end(), v, *this) - c.begin(); } private: |