hyperlink mxids and room aliases: open room when clicking on a room id or room alias #442

Do nothing with click on event id because we cannot know the id of the room it belongs to.
This commit is contained in:
manuroe
2016-08-26 16:16:49 +02:00
parent e9f8659290
commit 14f63a0ff6
2 changed files with 11 additions and 1 deletions
@@ -1774,6 +1774,17 @@
[self performSegueWithIdentifier:@"showContactDetails" sender:self];
}
}
// Open the clicked room
else if ([MXTools isMatrixRoomIdentifier:url.absoluteString] || [MXTools isMatrixRoomAlias:url.absoluteString])
{
shouldDoAction = NO;
NSString *roomIdOrAlias = url.absoluteString;
// Open the room or preview it
NSString *fragment = [NSString stringWithFormat:@"/room/%@", [roomIdOrAlias stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[AppDelegate theDelegate] handleUniversalLinkFragment:fragment];
}
}
return shouldDoAction;