Fix issue with joining public rooms with no guest access.

This fixes #2888.

Signed-off-by: Chris Moos <chris@chrismoos.com>
This commit is contained in:
Chris Moos
2019-12-22 14:37:39 -07:00
parent 5e3f06ebb0
commit 29a7763d18
3 changed files with 17 additions and 5 deletions
+9 -2
View File
@@ -51,12 +51,17 @@
if (self)
{
// Report public room data
_roomName = publicRoom.name;
_roomName = publicRoom.displayname;
_roomAvatarUrl = publicRoom.avatarUrl;
_roomTopic = publicRoom.topic;
_roomAliases = publicRoom.aliases;
_numJoinedMembers = publicRoom.numJoinedMembers;
// First try to fallback to the name if displayname isn't present
if (!_roomName.length) {
_roomName = publicRoom.name;
}
if (!_roomName.length)
{
// Consider the room aliases to define a default room name.
@@ -109,7 +114,9 @@
} failure:^(NSError *error) {
MXStrongifyAndReturnIfNil(self);
self->_roomName = self->_roomId;
if(self->_roomName == nil || self->_roomName.length == 0) {
self->_roomName = self->_roomId;
}
completion(NO);
}];
}