From e5257b21b3cb6a1823159273b07a0ada25cdf8a8 Mon Sep 17 00:00:00 2001 From: Emmanuel ROHEE Date: Mon, 18 Aug 2014 17:11:08 +0200 Subject: Support room alias in rooms URL (ex: http://127.0.0.1:8000/#/room/#public:localhost:8080) --- webclient/components/matrix/matrix-service.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'webclient/components') diff --git a/webclient/components/matrix/matrix-service.js b/webclient/components/matrix/matrix-service.js index c52c94c310..47828993a1 100644 --- a/webclient/components/matrix/matrix-service.js +++ b/webclient/components/matrix/matrix-service.js @@ -165,6 +165,16 @@ angular.module('matrixService', []) return doRequest("DELETE", path, undefined, undefined); }, + // Retrieves the room ID corresponding to a room alias + resolveRoomAlias:function(room_alias) { + var path = "/matrix/client/api/v1/ds/room/$room_alias"; + room_alias = encodeURIComponent(room_alias); + + path = path.replace("$room_alias", room_alias); + + return doRequest("GET", path, undefined, {}); + }, + sendMessage: function(room_id, msg_id, content) { // The REST path spec var path = "/rooms/$room_id/messages/$from/$msg_id"; -- cgit 1.5.1