summary refs log tree commit diff
path: root/syweb
diff options
context:
space:
mode:
Diffstat (limited to 'syweb')
-rw-r--r--syweb/webclient/components/matrix/matrix-service.js4
-rw-r--r--syweb/webclient/test/unit/matrix-service.spec.js6
2 files changed, 5 insertions, 5 deletions
diff --git a/syweb/webclient/components/matrix/matrix-service.js b/syweb/webclient/components/matrix/matrix-service.js
index 5b63fb4a3b..e1e5b88b3e 100644
--- a/syweb/webclient/components/matrix/matrix-service.js
+++ b/syweb/webclient/components/matrix/matrix-service.js
@@ -375,9 +375,9 @@ angular.module('matrixService', [])
         
         
         sendStateEvent: function(room_id, eventType, content, state_key) {
-            var path = "/rooms/$room_id/state/"+eventType;
+            var path = "/rooms/$room_id/state/"+ encodeURIComponent(eventType);
             if (state_key !== undefined) {
-                path += "/" + state_key;
+                path += "/" + encodeURIComponent(state_key);
             }
             room_id = encodeURIComponent(room_id);
             path = path.replace("$room_id", room_id);
diff --git a/syweb/webclient/test/unit/matrix-service.spec.js b/syweb/webclient/test/unit/matrix-service.spec.js
index 95a43057c4..b54163a641 100644
--- a/syweb/webclient/test/unit/matrix-service.spec.js
+++ b/syweb/webclient/test/unit/matrix-service.spec.js
@@ -238,7 +238,7 @@ describe('MatrixService', function() {
             homeserver: "http://example.com"
         });
         var roomId = "!fh38hfwfwef:example.com";
-        var eventType = "com.example.events.test";
+        var eventType = "com.example.events.test:special@characters";
         var content = {
             testing: "1 2 3"
         };
@@ -262,11 +262,11 @@ describe('MatrixService', function() {
             homeserver: "http://example.com"
         });
         var roomId = "!fh38hfwfwef:example.com";
-        var eventType = "com.example.events.test";
+        var eventType = "com.example.events.test:special@characters";
         var content = {
             testing: "1 2 3"
         };
-        var stateKey = "version1";
+        var stateKey = "version:1";
         matrixService.sendStateEvent(roomId, eventType, content, stateKey).then(
         function(response) {
             expect(response.data).toEqual({});