|
@@ -17,7 +17,18 @@
|
|
|
|
|
|
import {ContactControllerModel} from '../controller_model/contact';
|
|
import {ContactControllerModel} from '../controller_model/contact';
|
|
import {supportsPassive, throttle} from '../helpers';
|
|
import {supportsPassive, throttle} from '../helpers';
|
|
|
|
+import {ContactService} from '../services/contact';
|
|
|
|
+import {ControllerService} from '../services/controller';
|
|
|
|
+import {ControllerModelService} from '../services/controller_model';
|
|
import {ExecuteService} from '../services/execute';
|
|
import {ExecuteService} from '../services/execute';
|
|
|
|
+import {FingerPrintService} from '../services/fingerprint';
|
|
|
|
+import {TrustedKeyStoreService} from '../services/keystore';
|
|
|
|
+import {MimeService} from '../services/mime';
|
|
|
|
+import {NotificationService} from '../services/notification';
|
|
|
|
+import {ReceiverService} from '../services/receiver';
|
|
|
|
+import {SettingsService} from '../services/settings';
|
|
|
|
+import {StateService} from '../services/state';
|
|
|
|
+import {WebClientService} from '../services/webclient';
|
|
import {ControllerModelMode} from '../types/enums';
|
|
import {ControllerModelMode} from '../types/enums';
|
|
|
|
|
|
abstract class DialogController {
|
|
abstract class DialogController {
|
|
@@ -88,8 +99,8 @@ class SettingsController {
|
|
|
|
|
|
public $mdDialog: ng.material.IDialogService;
|
|
public $mdDialog: ng.material.IDialogService;
|
|
public $window: ng.IWindowService;
|
|
public $window: ng.IWindowService;
|
|
- public settingsService: threema.SettingsService;
|
|
|
|
- private notificationService: threema.NotificationService;
|
|
|
|
|
|
+ public settingsService: SettingsService;
|
|
|
|
+ private notificationService: NotificationService;
|
|
public activeElement: HTMLElement | null;
|
|
public activeElement: HTMLElement | null;
|
|
|
|
|
|
private desktopNotifications: boolean;
|
|
private desktopNotifications: boolean;
|
|
@@ -99,8 +110,8 @@ class SettingsController {
|
|
|
|
|
|
constructor($mdDialog: ng.material.IDialogService,
|
|
constructor($mdDialog: ng.material.IDialogService,
|
|
$window: ng.IWindowService,
|
|
$window: ng.IWindowService,
|
|
- settingsService: threema.SettingsService,
|
|
|
|
- notificationService: threema.NotificationService) {
|
|
|
|
|
|
+ settingsService: SettingsService,
|
|
|
|
+ notificationService: NotificationService) {
|
|
this.$mdDialog = $mdDialog;
|
|
this.$mdDialog = $mdDialog;
|
|
this.$window = $window;
|
|
this.$window = $window;
|
|
this.settingsService = settingsService;
|
|
this.settingsService = settingsService;
|
|
@@ -150,10 +161,10 @@ class ConversationController {
|
|
private $scope: ng.IScope;
|
|
private $scope: ng.IScope;
|
|
|
|
|
|
// Own services
|
|
// Own services
|
|
- private webClientService: threema.WebClientService;
|
|
|
|
- private receiverService: threema.ReceiverService;
|
|
|
|
- private stateService: threema.StateService;
|
|
|
|
- private mimeService: threema.MimeService;
|
|
|
|
|
|
+ private webClientService: WebClientService;
|
|
|
|
+ private receiverService: ReceiverService;
|
|
|
|
+ private stateService: StateService;
|
|
|
|
+ private mimeService: MimeService;
|
|
|
|
|
|
// Third party services
|
|
// Third party services
|
|
private $mdDialog: ng.material.IDialogService;
|
|
private $mdDialog: ng.material.IDialogService;
|
|
@@ -201,10 +212,10 @@ class ConversationController {
|
|
$mdToast: ng.material.IToastService,
|
|
$mdToast: ng.material.IToastService,
|
|
$location,
|
|
$location,
|
|
$translate: ng.translate.ITranslateService,
|
|
$translate: ng.translate.ITranslateService,
|
|
- webClientService: threema.WebClientService,
|
|
|
|
- stateService: threema.StateService,
|
|
|
|
- receiverService: threema.ReceiverService,
|
|
|
|
- mimeService: threema.MimeService) {
|
|
|
|
|
|
+ webClientService: WebClientService,
|
|
|
|
+ stateService: StateService,
|
|
|
|
+ receiverService: ReceiverService,
|
|
|
|
+ mimeService: MimeService) {
|
|
this.$stateParams = $stateParams;
|
|
this.$stateParams = $stateParams;
|
|
this.$timeout = $timeout;
|
|
this.$timeout = $timeout;
|
|
this.$log = $log;
|
|
this.$log = $log;
|
|
@@ -577,10 +588,10 @@ class NavigationController {
|
|
|
|
|
|
public name = 'navigation';
|
|
public name = 'navigation';
|
|
|
|
|
|
- private webClientService: threema.WebClientService;
|
|
|
|
- private receiverService: threema.ReceiverService;
|
|
|
|
- private stateService: threema.StateService;
|
|
|
|
- private trustedKeyStoreService: threema.TrustedKeyStoreService;
|
|
|
|
|
|
+ private webClientService: WebClientService;
|
|
|
|
+ private receiverService: ReceiverService;
|
|
|
|
+ private stateService: StateService;
|
|
|
|
+ private trustedKeyStoreService: TrustedKeyStoreService;
|
|
|
|
|
|
private activeTab: 'contacts' | 'conversations' = 'conversations';
|
|
private activeTab: 'contacts' | 'conversations' = 'conversations';
|
|
private searchVisible = false;
|
|
private searchVisible = false;
|
|
@@ -597,9 +608,9 @@ class NavigationController {
|
|
|
|
|
|
constructor($log: ng.ILogService, $state: ng.ui.IStateService,
|
|
constructor($log: ng.ILogService, $state: ng.ui.IStateService,
|
|
$mdDialog: ng.material.IDialogService, $translate: ng.translate.ITranslateService,
|
|
$mdDialog: ng.material.IDialogService, $translate: ng.translate.ITranslateService,
|
|
- webClientService: threema.WebClientService, stateService: threema.StateService,
|
|
|
|
- receiverService: threema.ReceiverService,
|
|
|
|
- trustedKeyStoreService: threema.TrustedKeyStoreService) {
|
|
|
|
|
|
+ webClientService: WebClientService, stateService: StateService,
|
|
|
|
+ receiverService: ReceiverService,
|
|
|
|
+ trustedKeyStoreService: TrustedKeyStoreService) {
|
|
|
|
|
|
// Redirect to welcome if necessary
|
|
// Redirect to welcome if necessary
|
|
if (stateService.state === 'error') {
|
|
if (stateService.state === 'error') {
|
|
@@ -783,9 +794,9 @@ class NavigationController {
|
|
|
|
|
|
class MessengerController {
|
|
class MessengerController {
|
|
public name = 'messenger';
|
|
public name = 'messenger';
|
|
- private receiverService: threema.ReceiverService;
|
|
|
|
|
|
+ private receiverService: ReceiverService;
|
|
private $state;
|
|
private $state;
|
|
- private webClientService: threema.WebClientService;
|
|
|
|
|
|
+ private webClientService: WebClientService;
|
|
|
|
|
|
public static $inject = [
|
|
public static $inject = [
|
|
'$scope', '$state', '$log', '$mdDialog', '$translate',
|
|
'$scope', '$state', '$log', '$mdDialog', '$translate',
|
|
@@ -793,8 +804,8 @@ class MessengerController {
|
|
];
|
|
];
|
|
constructor($scope, $state, $log: ng.ILogService, $mdDialog: ng.material.IDialogService,
|
|
constructor($scope, $state, $log: ng.ILogService, $mdDialog: ng.material.IDialogService,
|
|
$translate: ng.translate.ITranslateService,
|
|
$translate: ng.translate.ITranslateService,
|
|
- stateService: threema.StateService, receiverService: threema.ReceiverService,
|
|
|
|
- webClientService: threema.WebClientService, controllerService: threema.ControllerService) {
|
|
|
|
|
|
+ stateService: StateService, receiverService: ReceiverService,
|
|
|
|
+ webClientService: WebClientService, controllerService: ControllerService) {
|
|
// Redirect to welcome if necessary
|
|
// Redirect to welcome if necessary
|
|
if (stateService.state === 'error') {
|
|
if (stateService.state === 'error') {
|
|
$log.debug('MessengerController: WebClient not yet running, redirecting to welcome screen');
|
|
$log.debug('MessengerController: WebClient not yet running, redirecting to welcome screen');
|
|
@@ -859,8 +870,8 @@ class ReceiverDetailController {
|
|
public receiver: threema.Receiver;
|
|
public receiver: threema.Receiver;
|
|
public title: string;
|
|
public title: string;
|
|
public fingerPrint?: string;
|
|
public fingerPrint?: string;
|
|
- private fingerPrintService: threema.FingerPrintService;
|
|
|
|
- private contactService: threema.ContactService;
|
|
|
|
|
|
+ private fingerPrintService: FingerPrintService;
|
|
|
|
+ private contactService: ContactService;
|
|
private showGroups = false;
|
|
private showGroups = false;
|
|
private showDistributionLists = false;
|
|
private showDistributionLists = false;
|
|
private inGroups: threema.GroupReceiver[] = [];
|
|
private inGroups: threema.GroupReceiver[] = [];
|
|
@@ -875,8 +886,8 @@ class ReceiverDetailController {
|
|
'WebClientService', 'FingerPrintService', 'ContactService', 'ControllerModelService',
|
|
'WebClientService', 'FingerPrintService', 'ContactService', 'ControllerModelService',
|
|
];
|
|
];
|
|
constructor($log: ng.ILogService, $stateParams, $state: ng.ui.IStateService, $mdDialog: ng.material.IDialogService,
|
|
constructor($log: ng.ILogService, $stateParams, $state: ng.ui.IStateService, $mdDialog: ng.material.IDialogService,
|
|
- webClientService: threema.WebClientService, fingerPrintService: threema.FingerPrintService,
|
|
|
|
- contactService: threema.ContactService, controllerModelService: threema.ControllerModelService) {
|
|
|
|
|
|
+ webClientService: WebClientService, fingerPrintService: FingerPrintService,
|
|
|
|
+ contactService: ContactService, controllerModelService: ControllerModelService) {
|
|
|
|
|
|
this.$mdDialog = $mdDialog;
|
|
this.$mdDialog = $mdDialog;
|
|
this.$state = $state;
|
|
this.$state = $state;
|
|
@@ -983,7 +994,7 @@ class ReceiverEditController {
|
|
];
|
|
];
|
|
constructor($log: ng.ILogService, $stateParams, $state: ng.ui.IStateService,
|
|
constructor($log: ng.ILogService, $stateParams, $state: ng.ui.IStateService,
|
|
$mdDialog, $timeout: ng.ITimeoutService, $translate: ng.translate.ITranslateService,
|
|
$mdDialog, $timeout: ng.ITimeoutService, $translate: ng.translate.ITranslateService,
|
|
- webClientService: threema.WebClientService, controllerModelService: threema.ControllerModelService) {
|
|
|
|
|
|
+ webClientService: WebClientService, controllerModelService: ControllerModelService) {
|
|
|
|
|
|
this.$mdDialog = $mdDialog;
|
|
this.$mdDialog = $mdDialog;
|
|
this.$state = $state;
|
|
this.$state = $state;
|
|
@@ -1073,7 +1084,7 @@ class ReceiverCreateController {
|
|
|
|
|
|
constructor($stateParams: threema.CreateReceiverStateParams, $mdDialog, $mdToast, $translate,
|
|
constructor($stateParams: threema.CreateReceiverStateParams, $mdDialog, $mdToast, $translate,
|
|
$timeout: ng.ITimeoutService, $state: ng.ui.IStateService, $log: ng.ILogService,
|
|
$timeout: ng.ITimeoutService, $state: ng.ui.IStateService, $log: ng.ILogService,
|
|
- controllerModelService: threema.ControllerModelService) {
|
|
|
|
|
|
+ controllerModelService: ControllerModelService) {
|
|
this.$mdDialog = $mdDialog;
|
|
this.$mdDialog = $mdDialog;
|
|
this.$timeout = $timeout;
|
|
this.$timeout = $timeout;
|
|
this.$state = $state;
|
|
this.$state = $state;
|