text: import { pagePath, BrowserWindow, remote } from 'build/platform';
  import path from 'path';
  
  export function previewImages(message) {
      remote.getGlobal('previewWindowInfo').currentImage = message.messageId;
      const { w, h } = JSON.parse(message.content.content);
      let win = new BrowserWindow({
          width: Math.max(w > 1600? 1600: w, 380),
          height: Math.max(h > 990? 990: h, 410),
          titleBarStyle: 'hidden',
          autoHideMenuBar: true,
          backgroundColor: 'none',
          icon: 'src/assets/images/icon.png',
          webPreferences: {
              nodeIntegration: true,
          }
      });
      win.loadURL(
          path.join(
              'file://',
              pagePath,
              'src/index.html?type=previewImage'
          )
      );
  }
  
  export function getChatImages(messages) {
      remote.getGlobal('previewWindowInfo').imagesInfo = messages.map(item => {
          const path = item.content;
          if (item.content.type === 1007) {
              return {
                  src: path.localMediaPath? path.localMediaPath: path.remoteMediaUrl,
                  messageId: item.messageId
              };
          }
      });
  }
  