|
@@ -190,7 +190,10 @@ class ConversationController {
|
|
private hasMore = true;
|
|
private hasMore = true;
|
|
private latestRefMsgId: number = null;
|
|
private latestRefMsgId: number = null;
|
|
private messages: threema.Message[];
|
|
private messages: threema.Message[];
|
|
- private draft: string;
|
|
|
|
|
|
+ public initialData: threema.InitialConversationData = {
|
|
|
|
+ draft: '',
|
|
|
|
+ initialText: '',
|
|
|
|
+ };
|
|
private $translate: ng.translate.ITranslateService;
|
|
private $translate: ng.translate.ITranslateService;
|
|
private locked = false;
|
|
private locked = false;
|
|
public maxTextLength: number;
|
|
public maxTextLength: number;
|
|
@@ -207,7 +210,7 @@ class ConversationController {
|
|
'$mdDialog', '$mdToast', '$location', '$translate',
|
|
'$mdDialog', '$mdToast', '$location', '$translate',
|
|
'WebClientService', 'StateService', 'ReceiverService', 'MimeService',
|
|
'WebClientService', 'StateService', 'ReceiverService', 'MimeService',
|
|
];
|
|
];
|
|
- constructor($stateParams,
|
|
|
|
|
|
+ constructor($stateParams: threema.ConversationStateParams,
|
|
$state: ng.ui.IStateService,
|
|
$state: ng.ui.IStateService,
|
|
$timeout: ng.ITimeoutService,
|
|
$timeout: ng.ITimeoutService,
|
|
$log: ng.ILogService,
|
|
$log: ng.ILogService,
|
|
@@ -267,7 +270,7 @@ class ConversationController {
|
|
|
|
|
|
// Set receiver and type
|
|
// Set receiver and type
|
|
try {
|
|
try {
|
|
- this.receiver = webClientService.receivers.getData($stateParams);
|
|
|
|
|
|
+ this.receiver = webClientService.receivers.getData({type: $stateParams.type, id: $stateParams.id});
|
|
this.type = $stateParams.type;
|
|
this.type = $stateParams.type;
|
|
|
|
|
|
if (this.receiver.type === undefined) {
|
|
if (this.receiver.type === undefined) {
|
|
@@ -299,7 +302,10 @@ class ConversationController {
|
|
},
|
|
},
|
|
);
|
|
);
|
|
|
|
|
|
- this.draft = webClientService.getDraft(this.receiver);
|
|
|
|
|
|
+ this.initialData = {
|
|
|
|
+ draft: webClientService.getDraft(this.receiver),
|
|
|
|
+ initialText: $stateParams.initParams ? $stateParams.initParams.text : '',
|
|
|
|
+ };
|
|
|
|
|
|
if (this.receiver.type === 'contact') {
|
|
if (this.receiver.type === 'contact') {
|
|
this.isTyping = () => this.webClientService.isTyping(this.receiver as threema.ContactReceiver);
|
|
this.isTyping = () => this.webClientService.isTyping(this.receiver as threema.ContactReceiver);
|
|
@@ -960,14 +966,22 @@ class ReceiverDetailController {
|
|
}
|
|
}
|
|
|
|
|
|
public chat(): void {
|
|
public chat(): void {
|
|
- this.$state.go('messenger.home.conversation', this.receiver);
|
|
|
|
|
|
+ this.$state.go('messenger.home.conversation', {
|
|
|
|
+ type: this.receiver.type,
|
|
|
|
+ id: this.receiver.id,
|
|
|
|
+ initParams: null,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
public edit(): void {
|
|
public edit(): void {
|
|
if (!this.controllerModel.canEdit()) {
|
|
if (!this.controllerModel.canEdit()) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- this.$state.go('messenger.home.edit', this.receiver);
|
|
|
|
|
|
+ this.$state.go('messenger.home.edit', {
|
|
|
|
+ type: this.receiver.type,
|
|
|
|
+ id: this.receiver.id,
|
|
|
|
+ initParams: null,
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
public goBack(): void {
|
|
public goBack(): void {
|
|
@@ -1190,6 +1204,7 @@ angular.module('3ema.messenger', ['ngMaterial'])
|
|
templateUrl: 'partials/messenger.conversation.html',
|
|
templateUrl: 'partials/messenger.conversation.html',
|
|
controller: 'ConversationController',
|
|
controller: 'ConversationController',
|
|
controllerAs: 'ctrl',
|
|
controllerAs: 'ctrl',
|
|
|
|
+ params: {initParams: null},
|
|
})
|
|
})
|
|
|
|
|
|
.state('messenger.home.detail', {
|
|
.state('messenger.home.detail', {
|