Add `Whisper.Types` namespace

This avoids namespace collision for `Whisper.Message`.
This commit is contained in:
Daniel Gasienica 2018-02-13 12:56:32 -05:00
parent 785a949fce
commit 8ad0b066a3
4 changed files with 4 additions and 5 deletions

View File

@ -19,7 +19,7 @@
;(function() {
'use strict';
const { Attachment } = window.Whisper;
const { Attachment } = window.Whisper.Types;
// Implicitly used in `indexeddb-backbonejs-adapter`:
// https://github.com/signalapp/Signal-Desktop/blob/4033a9f8137e62ed286170ed5d4941982b1d3a64/components/indexeddb-backbonejs-adapter/backbone-indexeddb.js#L569

View File

@ -10,7 +10,7 @@
'use strict';
window.Whisper = window.Whisper || {};
const { Attachment } = window.Whisper;
const { Attachment } = window.Whisper.Types;
// TODO: Factor out private and group subclasses of Conversation

View File

@ -9,8 +9,6 @@
'use strict';
window.Whisper = window.Whisper || {};
const {Attachment} = window.Whisper;
Whisper.FileSizeToast = Whisper.ToastView.extend({
templateName: 'file-size-modal',
render_attributes: function() {

View File

@ -77,7 +77,8 @@
// ES2015+ modules
window.Whisper = window.Whisper || {};
window.Whisper.Attachment = require('./js/modules/types/attachment');
window.Whisper.Types = window.Whisper.Types || {};
window.Whisper.Types.Attachment = require('./js/modules/types/attachment');
// We pull this in last, because the native module involved appears to be sensitive to
// /tmp mounted as noexec on Linux.