From 0985bfb77584ea77c60c4bf8b3e95c104e2fa3f5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 30 Oct 2014 16:31:47 +0000 Subject: [PATCH] SYWEB-12: Allow edited state events to be submitted. --- webclient/room/room-controller.js | 11 +++++++++-- webclient/room/room.html | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index ce513990f..df93ccf5b 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -1043,12 +1043,19 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $modalInstance.close("redact"); }; }) -.controller('RoomInfoController', function($scope, $modalInstance, $filter) { +.controller('RoomInfoController', function($scope, $modalInstance, $filter, matrixService) { console.log("Displaying room info."); $scope.submit = function(event) { if (event.content) { - console.error("submit >>> " + JSON.stringify(event)); + console.log("submit >>> " + JSON.stringify(event.content)); + matrixService.sendStateEvent($scope.room_id, event.type, + event.content, event.state_key).then(function(response) { + $modalInstance.dismiss(); + }, function(err) { + $scope.feedback = err.data.error; + } + ); } }; diff --git a/webclient/room/room.html b/webclient/room/room.html index 627918223..16c35c032 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -24,7 +24,7 @@
Set by: {{ event.user_id }}
-