"use strict";

import { store } from '../roomStore';
import { fixUnnamedArrayFromApi, getUnnamedUsers } from './getUnnamedUsers';
import { getUserByXmppUsername } from '../networking/api-requests/roomMembers.api';
export const checkUniqueUsers = messages => {
  const unnamedUsers = getUnnamedUsers(messages);
  if (unnamedUsers.length > 0) {
    const getApiUsers = async () => {
      const fixedUsers = await fixUnnamedArrayFromApi(unnamedUsers);
      return fixedUsers;
    };
    const newUsers = getApiUsers();
    return newUsers;
  }
};
export const checkSingleUser = async (usersSet, xmppUsername) => {
  if (usersSet[xmppUsername]) {
    return;
  }
  const fixedUser = await getUserByXmppUsername(xmppUsername, store.getState().chatSettingStore.user.token);
  return fixedUser;
};
//# sourceMappingURL=checkUniqueUsers.js.map