diff --git a/src/controllers/pages/MatrixChat.js b/src/controllers/pages/MatrixChat.js
index e56d835267b7b8680b1eb6a8412dd9cc9f5629bb..e1f6afb95efc7a7e5499ece747631bb48151a261 100644
--- a/src/controllers/pages/MatrixChat.js
+++ b/src/controllers/pages/MatrixChat.js
@@ -70,10 +70,12 @@ module.exports = {
 
         // this can technically be done anywhere but doing this here keeps all
         // the routing url path logic together.
-        linkifyMatrix.onAliasClick = function(event, alias) {
-            dis.dispatch({action: 'view_room_alias', room_alias: alias});
-            event.preventDefault();
-        };
+        if (this.onAliasClick) {
+            linkifyMatrix.onAliasClick = this.onAliasClick;
+        }
+        if (this.onUserClick) {
+            linkifyMatrix.onUserClick = this.onUserClick;
+        }
     },
 
     componentWillUnmount: function() {