diff options
author | Matthew Hodgson <matthew@matrix.org> | 2014-11-15 01:34:33 +0000 |
---|---|---|
committer | Matthew Hodgson <matthew@matrix.org> | 2014-11-15 01:34:33 +0000 |
commit | adf582dba785f0f40fc68d7b1f079fabd210cabe (patch) | |
tree | aa458f0c8f450e7d390e8a3d518c6513881d3f15 /syweb/webclient/room/room-controller.js | |
parent | improve notif setting text (diff) | |
download | synapse-adf582dba785f0f40fc68d7b1f079fabd210cabe.tar.xz |
merge in msg.__room_member usage to new message display template
Diffstat (limited to 'syweb/webclient/room/room-controller.js')
-rw-r--r-- | syweb/webclient/room/room-controller.js | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/syweb/webclient/room/room-controller.js b/syweb/webclient/room/room-controller.js index cf9bc1fcdb..fdd10d7c9a 100644 --- a/syweb/webclient/room/room-controller.js +++ b/syweb/webclient/room/room-controller.js @@ -495,6 +495,7 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a }); }; + // used to send an image based on just a URL, rather than uploading one $scope.sendImage = function(url, body) { scrollToBottom(true); @@ -507,23 +508,23 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput', 'a }); }; - $scope.imageFileToSend; - $scope.$watch("imageFileToSend", function(newValue, oldValue) { - if ($scope.imageFileToSend) { - // Upload this image with its thumbnail to Internet - mFileUpload.uploadImageAndThumbnail($scope.imageFileToSend, THUMBNAIL_SIZE).then( - function(imageMessage) { - // imageMessage is complete message structure, send it as is - matrixService.sendMessage($scope.room_id, undefined, imageMessage).then( + $scope.fileToSend; + $scope.$watch("fileToSend", function(newValue, oldValue) { + if ($scope.fileToSend) { + // Upload this file + mFileUpload.uploadFileAndThumbnail($scope.fileToSend, THUMBNAIL_SIZE).then( + function(fileMessage) { + // fileMessage is complete message structure, send it as is + matrixService.sendMessage($scope.room_id, undefined, fileMessage).then( function() { - console.log("Image message sent"); + console.log("File message sent"); }, function(error) { - $scope.feedback = "Failed to send image message: " + error.data.error; + $scope.feedback = "Failed to send file message: " + error.data.error; }); }, function(error) { - $scope.feedback = "Can't upload image"; + $scope.feedback = "Can't upload file"; } ); } |