|
|
@ -2,6 +2,7 @@
|
|
|
|
/* global Backbone: false */
|
|
|
|
/* global Backbone: false */
|
|
|
|
/* global BlockedNumberController: false */
|
|
|
|
/* global BlockedNumberController: false */
|
|
|
|
/* global ConversationController: false */
|
|
|
|
/* global ConversationController: false */
|
|
|
|
|
|
|
|
/* global clipboard: false */
|
|
|
|
/* global i18n: false */
|
|
|
|
/* global i18n: false */
|
|
|
|
/* global profileImages: false */
|
|
|
|
/* global profileImages: false */
|
|
|
|
/* global storage: false */
|
|
|
|
/* global storage: false */
|
|
|
@ -415,10 +416,17 @@
|
|
|
|
text: this.lastMessage,
|
|
|
|
text: this.lastMessage,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
isOnline: this.isOnline(),
|
|
|
|
isOnline: this.isOnline(),
|
|
|
|
|
|
|
|
isMe: this.isMe(),
|
|
|
|
|
|
|
|
hasNickname: !!this.getNickname(),
|
|
|
|
|
|
|
|
|
|
|
|
onClick: () => this.trigger('select', this),
|
|
|
|
onClick: () => this.trigger('select', this),
|
|
|
|
onBlockContact: () => this.block(),
|
|
|
|
onBlockContact: () => this.block(),
|
|
|
|
onUnblockContact: () => this.unblock(),
|
|
|
|
onUnblockContact: () => this.unblock(),
|
|
|
|
|
|
|
|
onChangeNickname: () => this.changeNickname(),
|
|
|
|
|
|
|
|
onClearNickname: () => this.setNickname(null),
|
|
|
|
|
|
|
|
onCopyPublicKey: () => this.copyPublicKey(),
|
|
|
|
|
|
|
|
onDeleteContact: () => this.deleteContact(),
|
|
|
|
|
|
|
|
onDeleteMessages: () => this.deleteMessages(),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
@ -2044,6 +2052,35 @@
|
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
copyPublicKey() {
|
|
|
|
|
|
|
|
clipboard.writeText(this.id);
|
|
|
|
|
|
|
|
window.Whisper.events.trigger('showToast', {
|
|
|
|
|
|
|
|
message: i18n('copiedPublicKey'),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
changeNickname() {
|
|
|
|
|
|
|
|
window.Whisper.events.trigger('showNicknameDialog', {
|
|
|
|
|
|
|
|
pubKey: this.id,
|
|
|
|
|
|
|
|
nickname: this.getNickname(),
|
|
|
|
|
|
|
|
onOk: newName => this.setNickname(newName),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteContact() {
|
|
|
|
|
|
|
|
Whisper.events.trigger('showConfirmationDialog', {
|
|
|
|
|
|
|
|
message: i18n('deleteContactConfirmation'),
|
|
|
|
|
|
|
|
onOk: () => ConversationController.deleteContact(this.id),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
deleteMessages() {
|
|
|
|
|
|
|
|
Whisper.events.trigger('showConfirmationDialog', {
|
|
|
|
|
|
|
|
message: i18n('deleteConversationConfirmation'),
|
|
|
|
|
|
|
|
onOk: () => this.destroyMessages(),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
async destroyMessages() {
|
|
|
|
async destroyMessages() {
|
|
|
|
await window.Signal.Data.removeAllMessagesInConversation(this.id, {
|
|
|
|
await window.Signal.Data.removeAllMessagesInConversation(this.id, {
|
|
|
|
MessageCollection: Whisper.MessageCollection,
|
|
|
|
MessageCollection: Whisper.MessageCollection,
|
|
|
|