|
@@ -15,21 +15,26 @@
|
|
* along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with Threema Web. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
+import {MediaboxService} from '../services/mediabox';
|
|
import {MessageService} from '../services/message';
|
|
import {MessageService} from '../services/message';
|
|
import {WebClientService} from '../services/webclient';
|
|
import {WebClientService} from '../services/webclient';
|
|
|
|
|
|
export default [
|
|
export default [
|
|
'WebClientService',
|
|
'WebClientService',
|
|
|
|
+ 'MediaboxService',
|
|
'MessageService',
|
|
'MessageService',
|
|
'$rootScope',
|
|
'$rootScope',
|
|
'$mdDialog',
|
|
'$mdDialog',
|
|
'$timeout',
|
|
'$timeout',
|
|
'$log',
|
|
'$log',
|
|
'$filter',
|
|
'$filter',
|
|
- function(webClientService: WebClientService, messageService: MessageService,
|
|
|
|
|
|
+ function(webClientService: WebClientService,
|
|
|
|
+ mediaboxService: MediaboxService,
|
|
|
|
+ messageService: MessageService,
|
|
$rootScope: ng.IRootScopeService,
|
|
$rootScope: ng.IRootScopeService,
|
|
$mdDialog: ng.material.IDialogService,
|
|
$mdDialog: ng.material.IDialogService,
|
|
- $timeout: ng.ITimeoutService, $log: ng.ILogService,
|
|
|
|
|
|
+ $timeout: ng.ITimeoutService,
|
|
|
|
+ $log: ng.ILogService,
|
|
$filter: ng.IFilterService) {
|
|
$filter: ng.IFilterService) {
|
|
return {
|
|
return {
|
|
restrict: 'EA',
|
|
restrict: 'EA',
|
|
@@ -161,6 +166,8 @@ export default [
|
|
|
|
|
|
switch (this.message.type) {
|
|
switch (this.message.type) {
|
|
case 'image':
|
|
case 'image':
|
|
|
|
+ mediaboxService.setMedia(buffer);
|
|
|
|
+ break;
|
|
case 'video':
|
|
case 'video':
|
|
saveAs(new Blob([buffer]), messageService.getFileName(message));
|
|
saveAs(new Blob([buffer]), messageService.getFileName(message));
|
|
break;
|
|
break;
|