How to use the @converse/headless/converse-core.ROOMSTATUS function in @converse/headless

To help you get started, we’ve selected a few @converse/headless examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github conversejs / converse.js / src / converse-muc-views.js View on Github external
renderAfterTransition () {
                const conn_status = this.model.session.get('connection_status')
                if (conn_status == converse.ROOMSTATUS.NICKNAME_REQUIRED) {
                    this.renderNicknameForm();
                } else if (conn_status == converse.ROOMSTATUS.PASSWORD_REQUIRED) {
                    this.renderPasswordForm();
                } else if (conn_status == converse.ROOMSTATUS.ENTERED) {
                    this.hideChatRoomContents();
                    u.showElement(this.el.querySelector('.chat-area'));
                    u.showElement(this.el.querySelector('.occupants'));
                    this.scrollDown();
                }
            },
github conversejs / converse.js / src / converse-muc-views.js View on Github external
onConnectionStatusChanged () {
                const conn_status = this.model.session.get('connection_status');
                if (conn_status === converse.ROOMSTATUS.NICKNAME_REQUIRED) {
                    this.renderNicknameForm();
                } else if (conn_status === converse.ROOMSTATUS.PASSWORD_REQUIRED) {
                    this.renderPasswordForm();
                } else if (conn_status === converse.ROOMSTATUS.CONNECTING) {
                    this.showSpinner();
                } else if (conn_status === converse.ROOMSTATUS.ENTERED) {
                    this.renderBottomPanel();
                    this.hideSpinner();
                    if (_converse.auto_focus) {
                        this.focus();
                    }
                } else if (conn_status === converse.ROOMSTATUS.DISCONNECTED) {
                    this.showDisconnectMessage();
                } else if (conn_status === converse.ROOMSTATUS.DESTROYED) {
                    this.showDestroyedMessage();
                }
            },
github conversejs / converse.js / src / converse-muc-views.js View on Github external
showJoinNotification (occupant) {
                if (!_converse.muc_show_join_leave ||
                        this.model.session.get('connection_status') !==  converse.ROOMSTATUS.ENTERED) {
                    return;
                }
                const nick = occupant.get('nick'),
                      stat = _converse.muc_show_join_leave_status ? occupant.get('status') : null,
                      prev_info_el = this.getPreviousJoinOrLeaveNotification(this.content.lastElementChild, nick),
                      data = _.get(prev_info_el, 'dataset', {});

                if (data.leave === nick) {
                    let message;
                    if (stat) {
                        message = __('%1$s has left and re-entered the groupchat. "%2$s"', nick, stat);
                    } else {
                        message = __('%1$s has left and re-entered the groupchat', nick);
                    }
                    const data = {
                        'data_name': 'leavejoin',
github conversejs / converse.js / src / converse-muc-views.js View on Github external
const conn_status = this.model.session.get('connection_status');
                if (conn_status === converse.ROOMSTATUS.NICKNAME_REQUIRED) {
                    this.renderNicknameForm();
                } else if (conn_status === converse.ROOMSTATUS.PASSWORD_REQUIRED) {
                    this.renderPasswordForm();
                } else if (conn_status === converse.ROOMSTATUS.CONNECTING) {
                    this.showSpinner();
                } else if (conn_status === converse.ROOMSTATUS.ENTERED) {
                    this.renderBottomPanel();
                    this.hideSpinner();
                    if (_converse.auto_focus) {
                        this.focus();
                    }
                } else if (conn_status === converse.ROOMSTATUS.DISCONNECTED) {
                    this.showDisconnectMessage();
                } else if (conn_status === converse.ROOMSTATUS.DESTROYED) {
                    this.showDestroyedMessage();
                }
            },
github conversejs / converse.js / src / converse-muc-views.js View on Github external
const html = tpl_chatroom_nickname_form(Object.assign({
                    heading,
                    'label_nickname': __('Nickname'),
                    'label_join': __('Enter groupchat'),
                }, this.model.toJSON()));

                if (_converse.muc_show_logs_before_join) {
                    const container = this.el.querySelector('.muc-bottom-panel');
                    container.innerHTML = html;
                    u.addClass('muc-bottom-panel--nickname', container);
                } else {
                    this.hideChatRoomContents();
                    const container = this.el.querySelector('.chatroom-body');
                    container.insertAdjacentHTML('beforeend', html);
                }
                u.safeSave(this.model.session, {'connection_status': converse.ROOMSTATUS.NICKNAME_REQUIRED});
            },
github conversejs / converse.js / src / converse-muc-views.js View on Github external
onConnectionStatusChanged () {
                const conn_status = this.model.session.get('connection_status');
                if (conn_status === converse.ROOMSTATUS.NICKNAME_REQUIRED) {
                    this.renderNicknameForm();
                } else if (conn_status === converse.ROOMSTATUS.PASSWORD_REQUIRED) {
                    this.renderPasswordForm();
                } else if (conn_status === converse.ROOMSTATUS.CONNECTING) {
                    this.showSpinner();
                } else if (conn_status === converse.ROOMSTATUS.ENTERED) {
                    this.renderBottomPanel();
                    this.hideSpinner();
                    if (_converse.auto_focus) {
                        this.focus();
                    }
                } else if (conn_status === converse.ROOMSTATUS.DISCONNECTED) {
                    this.showDisconnectMessage();
                } else if (conn_status === converse.ROOMSTATUS.DESTROYED) {
                    this.showDestroyedMessage();
                }
            },