message: fix(muc): create rooms
diff: @@ -250,24 +250,33 @@ class MultiUserJoinDialog {
  private continueHandler = ev => {
  ev.preventDefault();
  + this.testAndLoadRoomInfo();
  +
  + return false;
  + };
  +
  + private async testAndLoadRoomInfo() {
  this.dom.find('input, select').prop('disabled', true);
  - this.testInputValues()
  - .then(this.requestRoomInfo)
  - .then(this.requestMemberList)
  - .then(() => {
  +
  + try {
  + const jid = await this.testInputValues();
  + const hasRoomInfo = await this.requestRoomInfo(jid);
  +
  + if (hasRoomInfo) {
  + await this.requestMemberList(jid);
  + }
  +
  this.showJoinElements();
  - })
  - .catch(msg => {
  + } catch (msg) {
  this.dom.find('input, select').prop('disabled', false);
  - this.setStatusMessage(msg, 'warning');
  - Log.warn(msg);
  - });
  + this.setStatusMessage(typeof msg === 'string' ? msg : Translation.t('Can_not_probe_room'), 'warning');
  - return false;
  - };
  + Log.warn('Error while probing room', msg);
  + }
  + }
  - private testInputValues(): Promise<JID | void> {
  + private testInputValues(): Promise<JID> {
  let room = <string>this.roomInputElement.val();
  let server = this.serverInputElement.val()
  ? this.serverInputElement.val()
  @@ -302,28 +311,27 @@ class MultiUserJoinDialog {
  return Promise.resolve(roomJid);
  }
  - private requestRoomInfo = (room: JID) => {
  + private requestRoomInfo = async (room: JID) => {
  this.setWaitingMessage('Loading_room_information');
  - return this.connection
  - .getDiscoService()
  - .getDiscoInfo(room)
  - .then(this.parseRoomInfo)
  - .then(roomInfoElement => {
  + const discoService = this.connection.getDiscoService();
  +
  + try {
  + const stanza = await discoService.getDiscoInfo(room);
  + const roomInfoElement = this.parseRoomInfo(stanza);
  +
  this.setStatusElement(roomInfoElement);
  - })
  - .catch(stanza => {
  - if ($(stanza).find('item-not-found').length > 0) {
  + } catch (errorStanza) {
  + if ($(errorStanza).find('item-not-found').length > 0) {
  this.setStatusMessage(Translation.t('Room_not_found_'));
  - return Promise.resolve();
  + return false;
  }
  - return Promise.reject('I was not able to get any room information.');
  - })
  - .then(() => {
  - return room;
  - });
  + await Promise.reject('I was not able to get any room information.');
  + }
  +
  + return true;
  };
  private parseRoomInfo = stanza => {
  