mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 09:06:06 -04:00
Merge branch 'master' of github.com:matrix-org/synapse into sql_refactor
Conflicts: tests/rest/test_presence.py tests/rest/test_rooms.py tests/utils.py
This commit is contained in:
commit
347242a5c4
29 changed files with 1258 additions and 393 deletions
|
@ -54,13 +54,14 @@ angular.module('matrixService', [])
|
|||
|
||||
params.access_token = config.access_token;
|
||||
|
||||
if (path.indexOf(prefixPath) !== 0) {
|
||||
path = prefixPath + path;
|
||||
}
|
||||
|
||||
return doBaseRequest(config.homeserver, method, path, params, data, undefined);
|
||||
};
|
||||
|
||||
var doBaseRequest = function(baseUrl, method, path, params, data, headers) {
|
||||
if (path.indexOf(prefixPath) !== 0) {
|
||||
path = prefixPath + path;
|
||||
}
|
||||
return $http({
|
||||
method: method,
|
||||
url: baseUrl + path,
|
||||
|
@ -165,6 +166,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";
|
||||
|
@ -309,6 +320,17 @@ angular.module('matrixService', [])
|
|||
return doBaseRequest(config.identityServer, "POST", path, {}, data, headers);
|
||||
},
|
||||
|
||||
uploadContent: function(file) {
|
||||
var path = "/matrix/content";
|
||||
var headers = {
|
||||
"Content-Type": undefined // undefined means angular will figure it out
|
||||
};
|
||||
var params = {
|
||||
access_token: config.access_token
|
||||
};
|
||||
return doBaseRequest(config.homeserver, "POST", path, params, file, headers);
|
||||
},
|
||||
|
||||
// start listening on /events
|
||||
getEventStream: function(from, timeout) {
|
||||
var path = "/events";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue