diff options
author | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-27 13:34:52 +0900 |
---|---|---|
committer | Kitsune Ral <Kitsune-Ral@users.sf.net> | 2018-04-27 13:34:52 +0900 |
commit | 3a763fd470b8aeffa3d412e6f605231492fb5b0c (patch) | |
tree | 4759fe9eb980f5de1b0bca7dabfeecdc75668b30 /lib/connection.cpp | |
parent | e74e48507f68e36c289c5dbe4b75f32a6910f3c1 (diff) | |
download | libquotient-3a763fd470b8aeffa3d412e6f605231492fb5b0c.tar.gz libquotient-3a763fd470b8aeffa3d412e6f605231492fb5b0c.zip |
Fix broken User::displayName() logic
Also, add an assert to Connection::user() to make sure it doesn't create users with invalid ids. Closes #201.
Diffstat (limited to 'lib/connection.cpp')
-rw-r--r-- | lib/connection.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/connection.cpp b/lib/connection.cpp index 241fa43d..f2bbf903 100644 --- a/lib/connection.cpp +++ b/lib/connection.cpp @@ -590,6 +590,7 @@ Room* Connection::invitation(const QString& roomId) const User* Connection::user(const QString& userId) { + Q_ASSERT(userId.startsWith('@') && userId.contains(':')); if( d->userMap.contains(userId) ) return d->userMap.value(userId); auto* user = userFactory(this, userId); |