invite contacts dialog functioning.
parent
59b02a5ed4
commit
8c0bec7a97
@ -1,58 +1,58 @@
|
|||||||
/* global Whisper */
|
// /* global Whisper */
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
// // eslint-disable-next-line func-names
|
||||||
(function() {
|
// (function() {
|
||||||
'use strict';
|
// 'use strict';
|
||||||
|
|
||||||
window.Whisper = window.Whisper || {};
|
// window.Whisper = window.Whisper || {};
|
||||||
|
|
||||||
Whisper.InviteContactsDialogView = Whisper.View.extend({
|
// Whisper.InviteContactsDialogView = Whisper.View.extend({
|
||||||
className: 'loki-dialog modal',
|
// className: 'loki-dialog modal',
|
||||||
initialize(convo) {
|
// initialize(convo) {
|
||||||
this.close = this.close.bind(this);
|
// this.close = this.close.bind(this);
|
||||||
this.theme = convo.theme;
|
// this.theme = convo.theme;
|
||||||
const convos = window.getConversationController().getConversations();
|
// const convos = window.getConversationController().getConversations();
|
||||||
|
|
||||||
this.contacts = convos.filter(
|
// this.contacts = convos.filter(
|
||||||
d => !!d && !d.isBlocked() && d.isPrivate() && !d.isMe() && !!d.get('active_at')
|
// d => !!d && !d.isBlocked() && d.isPrivate() && !d.isMe() && !!d.get('active_at')
|
||||||
);
|
// );
|
||||||
if (!convo.isPublic()) {
|
// if (!convo.isPublic()) {
|
||||||
// filter our zombies and current members from the list of contact we can add
|
// // filter our zombies and current members from the list of contact we can add
|
||||||
|
|
||||||
const members = convo.get('members') || [];
|
// const members = convo.get('members') || [];
|
||||||
const zombies = convo.get('zombies') || [];
|
// const zombies = convo.get('zombies') || [];
|
||||||
this.contacts = this.contacts.filter(
|
// this.contacts = this.contacts.filter(
|
||||||
d => !members.includes(d.id) && !zombies.includes(d.id)
|
// d => !members.includes(d.id) && !zombies.includes(d.id)
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
this.chatName = convo.get('name');
|
// this.chatName = convo.get('name');
|
||||||
this.chatServer = convo.get('server');
|
// this.chatServer = convo.get('server');
|
||||||
this.channelId = convo.get('channelId');
|
// this.channelId = convo.get('channelId');
|
||||||
this.isPublic = !!convo.isPublic();
|
// this.isPublic = !!convo.isPublic();
|
||||||
this.convo = convo;
|
// this.convo = convo;
|
||||||
|
|
||||||
this.$el.focus();
|
// this.$el.focus();
|
||||||
this.render();
|
// this.render();
|
||||||
},
|
// },
|
||||||
render() {
|
// render() {
|
||||||
const view = new Whisper.ReactWrapperView({
|
// const view = new Whisper.ReactWrapperView({
|
||||||
className: 'invite-friends-dialog',
|
// className: 'invite-friends-dialog',
|
||||||
Component: window.Signal.Components.InviteContactsDialog,
|
// Component: window.Signal.Components.InviteContactsDialog,
|
||||||
props: {
|
// props: {
|
||||||
contactList: this.contacts,
|
// contactList: this.contacts,
|
||||||
onClose: this.close,
|
// onClose: this.close,
|
||||||
chatName: this.chatName,
|
// chatName: this.chatName,
|
||||||
theme: this.theme,
|
// theme: this.theme,
|
||||||
convo: this.convo,
|
// convo: this.convo,
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
|
|
||||||
this.$el.append(view.el);
|
// this.$el.append(view.el);
|
||||||
return this;
|
// return this;
|
||||||
},
|
// },
|
||||||
close() {
|
// close() {
|
||||||
this.remove();
|
// this.remove();
|
||||||
},
|
// },
|
||||||
});
|
// });
|
||||||
})();
|
// })();
|
||||||
|
Loading…
Reference in New Issue