mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-05 01:54:57 -04:00
Remove old polling stuff from RoomController. Added service comments. Do not start the event stream on startup unless you have credentials.
This commit is contained in:
parent
7ddb7a5cbb
commit
5ac87292c4
4 changed files with 20 additions and 45 deletions
|
@ -16,6 +16,12 @@ limitations under the License.
|
|||
|
||||
'use strict';
|
||||
|
||||
/*
|
||||
This service wraps up Matrix API calls.
|
||||
|
||||
This serves to isolate the caller from changes to the underlying url paths, as
|
||||
well as attach common params (e.g. access_token) to requests.
|
||||
*/
|
||||
angular.module('matrixService', [])
|
||||
.factory('matrixService', ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
|
||||
|
||||
|
@ -36,10 +42,16 @@ angular.module('matrixService', [])
|
|||
var MAPPING_PREFIX = "alias_for_";
|
||||
|
||||
var doRequest = function(method, path, params, data) {
|
||||
if (!config) {
|
||||
console.warn("No config exists. Cannot perform request to "+path);
|
||||
return;
|
||||
}
|
||||
|
||||
// Inject the access token
|
||||
if (!params) {
|
||||
params = {};
|
||||
}
|
||||
|
||||
params.access_token = config.access_token;
|
||||
|
||||
return doBaseRequest(config.homeserver, method, path, params, data, undefined);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue