"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.chatAutoEnterer = void 0;
var _roomsSlice = require("../roomStore/roomsSlice");
var _normalizeRoomJid = require("./normalizeRoomJid");
/** @format */

const chatAutoEnterer = ({
  roomJID,
  wasAutoSelected,
  config,
  dispatch
}) => {
  console.log('🟡 chatAutoEnterer: Called', {
    roomJID,
    wasAutoSelected
  });
  if (roomJID) {
    const conferenceDomain = config.xmppSettings?.conference ?? '';
    const finalRoomJID = (0, _normalizeRoomJid.normalizeRoomJid)(roomJID, conferenceDomain);
    console.log('🟡 chatAutoEnterer: Setting current room', finalRoomJID);
    dispatch((0, _roomsSlice.setCurrentRoom)({
      roomJID: finalRoomJID
    }));
    return;
  }
  console.log('🟡 chatAutoEnterer: No roomJID provided');
  // In React Native, we don't have window.location.search
  // The roomJID should be passed directly via props/config
};
exports.chatAutoEnterer = chatAutoEnterer;
//# sourceMappingURL=chatAutoEnterer.js.map