Plugin Directory

Changeset 3276116


Ignore:
Timestamp:
04/17/2025 05:22:22 PM (8 months ago)
Author:
psrpinto
Message:

Update to version 0.9.2 from GitHub

Location:
chatrix
Files:
2 added
2 deleted
20 edited
1 copied

Legend:

Unmodified
Added
Removed
  • chatrix/tags/0.9.2/README.md

    r3107910 r3276116  
    44- Tags: matrix, chat
    55- Requires at least: 6.0
    6 - Tested up to: 6.5
     6- Tested up to: 6.8
    77- Requires PHP: 7.4
    88- License: [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html)
    9 - Stable tag: 0.9.1
     9- Stable tag: 0.9.2
    1010- GitHub Plugin URI: https://github.com/Automattic/chatrix
    1111
     
    6868
    6969## Changelog
     70
     71### 0.9.2
     72- Fix Chatrix iframe not loading in Gutenberg editor [#256](https://github.com/Automattic/chatrix/pull/256)
    7073
    7174### 0.9.1
  • chatrix/tags/0.9.2/build/block/block.json

    r3107910 r3276116  
    33  "apiVersion": 2,
    44  "name": "automattic/chatrix",
    5   "version": "0.9.1",
     5  "version": "0.9.2",
    66  "title": "Chatrix",
    77  "category": "embed",
  • chatrix/tags/0.9.2/build/iframe/iframe.html

    r3107910 r3276116  
    1111   
    1212   
    13   <script type="module" crossorigin src="assets/iframe.0e4fde11.js"></script>
     13  <script type="module" crossorigin src="assets/iframe.1839a1af.js"></script>
    1414  <link rel="manifest" href="assets/manifest.ffcfe959.json">
    1515</head>
  • chatrix/tags/0.9.2/build/iframe/sw.js

    r3107910 r3276116  
    1 var T="assets/icon.2a39c64c.png";const A=["assets/theme-chatrix.json","iframe.html"],R=["assets/icon.2a39c64c.png","assets/olm.92f1ccd0.js","assets/olm.b3e0f9b4.wasm","assets/download-sandbox.48a866e9.html","assets/chevron-down-3300400168.d1a083a1.svg","assets/room-members-3297708388.1a158fe2.svg","assets/mic-muted-2617055184.e8d1962f.svg","assets/cam-muted-2247331037.b0b2cf01.svg","assets/hangup-1798659826.d0cb8438.svg","assets/mic-muted-4213153786.513608a5.svg","assets/mic-unmuted-3178778883.b8f57412.svg","assets/cam-muted-1894081672.22150c2b.svg","assets/cam-unmuted-2215154474.a82b7bf1.svg","assets/clear-2745749323.bcd2574b.svg","assets/clear-2203718389.37dd36a5.svg","assets/element-logo-2135064725.cdac8806.svg","assets/enable-grid-2071838379.ab4f40c5.svg","assets/settings-2175246113.00804666.svg","assets/plus-4190356069.084c5e3d.svg","assets/disable-grid-3304422220.8a79cfcb.svg","assets/search-3263540198.1511780c.svg","assets/clear-426756705.361f7a30.svg","assets/chevron-left-3506338632.4e437777.svg","assets/dismiss-2743697487.2f1a17f1.svg","assets/chevron-right-847198822.23380c56.svg","assets/vertical-ellipsis-3416547705.f619a721.svg","assets/send-1171052351.caa5c494.svg","assets/paperclip-2441131778.1f5e29f3.svg","assets/chevron-small-781914114.936b4943.svg","assets/room-members-3847743605.9fcf4567.svg","assets/encryption-status-475927392.2fedc0bd.svg","assets/e2ee-normal-1434691185.95415e20.svg","assets/e2ee-disabled-3482032905.cc7da5eb.svg","assets/chevron-thin-left-3831175135.13f60c05.svg","assets/video-call-3307702325.5e74dd9a.svg","assets/room-members-1680968332.b4f57622.svg","assets/chevron-down-1956489915.3389f17f.svg","assets/room-members-871477030.90b799fe.svg","assets/mic-muted-2638557456.4d8c99b4.svg","assets/cam-muted-3489740486.a882d986.svg","assets/mic-muted-3642419863.228ee86f.svg","assets/hangup-581771896.279a6adf.svg","assets/mic-unmuted-211198830.1fde69c5.svg","assets/cam-muted-711199923.069dcf2b.svg","assets/cam-unmuted-2274150835.69bcdbc4.svg","assets/element-logo-1551909733.1d59f06a.svg","assets/enable-grid-2288309723.f83895c8.svg","assets/settings-878939771.57cf3680.svg","assets/plus-3937109722.5c243914.svg","assets/disable-grid-4240599831.c8dc25a1.svg","assets/search-261439583.1bffaca1.svg","assets/clear-4137897294.7b90e8df.svg","assets/chevron-left-2611498805.b5555a61.svg","assets/dismiss-2476348673.d0f98560.svg","assets/chevron-right-2390431650.ec9bf561.svg","assets/vertical-ellipsis-487061581.e7709afd.svg","assets/send-3413346515.b0fb8626.svg","assets/paperclip-3961996319.da562307.svg","assets/chevron-small-4098047679.489e66cc.svg","assets/room-members-3084360280.6f64aaef.svg","assets/encryption-status-3449529405.c200a9bb.svg","assets/e2ee-normal-1448349558.af8f5484.svg","assets/e2ee-disabled-1470792300.6863c16d.svg","assets/chevron-thin-left-3078630092.d0d143e3.svg","assets/video-call-2591082837.8f09bafc.svg","assets/room-members-2999414798.6534e8ec.svg","assets/iframe.0e4fde11.js","assets/theme-chatrix-light.ad6a6d74.css","assets/theme-chatrix-dark.1162b2b5.css","assets/theme-chatrix-runtime.3164f5eb.css","assets/chevron-down.9a7440b9.svg","assets/room-members.35ed0bf9.svg","assets/mic-muted.56aa03b9.svg","assets/cam-muted.9f690631.svg","assets/hangup.8b163c30.svg","assets/mic-unmuted.c180f63a.svg","assets/cam-unmuted.67e18332.svg","assets/clear.0d180c33.svg","assets/element-logo.86bc8565.svg","assets/enable-grid.eef43c65.svg","assets/settings.45b8e09f.svg","assets/plus.49560f96.svg","assets/disable-grid.371ceaaa.svg","assets/search.21e0fd39.svg","assets/chevron-left.b8b2c5fc.svg","assets/chevron-right.885731d1.svg","assets/vertical-ellipsis.70ab5d25.svg","assets/send.7a090949.svg","assets/paperclip.ec29fd9d.svg","assets/chevron-small.dfd7e618.svg","assets/encryption-status.8054183e.svg","assets/e2ee-normal.bef76bd4.svg","assets/e2ee-disabled.8507165d.svg","assets/chevron-thin-left.d111869b.svg","assets/video-call.d3cb081e.svg","assets/icon-maskable.f15251f1.png"],_=["assets/main.5b3f6f97.js","assets/olm_legacy.9dc48f49.js","assets/Inter-Thin.5d8e2ac4.woff2","assets/Inter-ThinItalic.6b3ded18.woff2","assets/Inter-ExtraLight.da47c335.woff2","assets/Inter-ExtraLightItalic.b3f94cfe.woff2","assets/Inter-Light.0f7dfe72.woff2","assets/Inter-LightItalic.125c7e6a.woff2","assets/Inter-Regular.89d406b0.woff2","assets/Inter-Italic.bab4e808.woff2","assets/Inter-Medium.5d308f3d.woff2","assets/Inter-MediumItalic.76551c20.woff2","assets/Inter-SemiBold.c7c3befe.woff2","assets/Inter-SemiBoldItalic.d376ade4.woff2","assets/Inter-Bold.6f5e9a23.woff2","assets/Inter-BoldItalic.e09dcbe1.woff2","assets/Inter-ExtraBold.0ef4267e.woff2","assets/Inter-ExtraBoldItalic.d1e1f6a0.woff2","assets/Inter-Black.7f1f5616.woff2","assets/Inter-BlackItalic.72d5983b.woff2","assets/Inter-Thin.5565b01e.woff","assets/Inter-ThinItalic.c413497b.woff","assets/Inter-ExtraLight.d7be68a4.woff","assets/Inter-Light.38326098.woff","assets/Inter-ExtraLightItalic.762fa4d2.woff","assets/Inter-LightItalic.ec6c76a8.woff","assets/Inter-Medium.0fc5d904.woff","assets/Inter-Italic.7b187d57.woff","assets/Inter-Regular.5b3a854b.woff","assets/Inter-SemiBold.04cd699f.woff","assets/Inter-MediumItalic.1458af9d.woff","assets/Inter-Bold.20d46cff.woff","assets/Inter-SemiBoldItalic.420db54a.woff","assets/Inter-ExtraBold.45bae435.woff","assets/Inter-BoldItalic.31a185fa.woff","assets/Inter-BlackItalic.c628a2cf.woff","assets/Inter-ExtraBoldItalic.30a1af87.woff","assets/Inter-Black.067c82f7.woff","assets/sync-worker.88015204.js","assets/manifest.ffcfe959.json"],m=`hydrogen-assets-${"3565504203"}`,l="hydrogen-assets",y="hydrogen-media-thumbnails-v2";self.addEventListener("install",function(e){e.waitUntil((async()=>{await(await caches.open(m)).addAll(A);const a=await caches.open(l);await Promise.all(R.map(async t=>{await a.match(t)||await a.add(t)}))})())});self.addEventListener("activate",e=>{self.clients.claim(),e.waitUntil(k())});async function k(){const e=await caches.keys();for(const n of e)n!==m&&n!==l&&n!==y&&await caches.delete(n);const s=await caches.open(l),a=await s.keys(),t=R.concat(_).map(n=>new URL(n,self.registration.scope).href);for(const n of a)t.some(o=>o===n.url)||s.delete(n)}self.addEventListener("fetch",e=>{e.request.method==="GET"&&e.respondWith(I(e.request))});function E(e){if(e.pathname.startsWith("/_matrix/media/r0/thumbnail/")){const s=parseInt(e.searchParams.get("width"),10),a=parseInt(e.searchParams.get("height"),10);if(s<=50&&a<=50)return!0}return!1}const f=new URL(self.registration.scope);let d=new AbortController;async function I(e){try{if(e.url.includes("config.json")||/theme-.+\.json/.test(e.url))return D(e);const s=new URL(e.url);s.origin===f.origin&&s.pathname===f.pathname&&(e=new Request(new URL("index.html",f.href)));let a=await N(e);return a||(E(s)?a=await fetch(e,{signal:d.signal,mode:"cors",credentials:"omit"}):a=await fetch(e,{signal:d.signal}),await H(e,a)),a}catch(s){throw s.name!=="TypeError"&&s.name!=="AbortError"&&console.error("error in service worker",s),s}}async function D(e){let s=await N(e);const a=O(e);return s||await a}async function O(e){const s=await fetch(e,{signal:d.signal,headers:{"Cache-Control":"no-cache"}});return H(e,s.clone()),s}async function H(e,s){if(s.status>=400)return;const a=new URL(e.url),t=self.registration.scope;if(E(a))(await caches.open(y)).put(e,s.clone());else if(e.url.startsWith(t)){let n=e.url.substr(t.length),o;_.includes(n)?o=l:A.includes(n)&&(o=m),o&&await(await caches.open(o)).put(e,s.clone())}}async function N(e){let a=await(await caches.open(m)).match(e);if(a||(a=await(await caches.open(l)).match(e),a))return a;const n=new URL(e.url);if(E(n)){const o=await caches.open(y);a=await o.match(e),a?.status>=400&&(await o.delete(e),a=null)}return a}self.addEventListener("message",e=>{const s=t=>e.source.postMessage({replyTo:e.data.id,payload:t}),{replyTo:a}=e.data;if(a){const t=g.get(a);t&&(g.delete(a),t(e.data.payload))}else switch(e.data?.type){case"version":s({version:"0.9.1",buildHash:"3565504203"});break;case"skipWaiting":self.skipWaiting();break;case"haltRequests":e.waitUntil(M().finally(()=>s()));break;case"closeSession":e.waitUntil(W(e.data.payload.sessionId,e.source.id).finally(()=>s()));break}});const p="new_message";async function F(e){if(e.notification.tag!==p){console.log("clicked notif with tag",e.notification.tag);return}const{sessionId:s,roomId:a}=e.notification.data,n=`${`#/session/${s}`}/room/${a}`,o=await b(async c=>await w(c,"hasSessionOpen",{sessionId:s}));if(o){if(console.log("notificationclick: client has session open, showing room there"),o.postMessage({type:"openRoom",payload:{roomId:a}}),"focus"in o)try{await o.focus()}catch(c){console.error(c)}}else if(self.clients.openWindow){console.log("notificationclick: no client found with session open, opening new window");const c=new URL(`./${n}`,f).href;await self.clients.openWindow(c)}}self.addEventListener("notificationclick",e=>{e.notification.close(),e.waitUntil(F(e))});async function P(e){console.log("got a push message",e);const s=e.session_id;let a=e.sender_display_name||e.sender;if(a&&e.event_id){const t=e.room_id;if(!!await b(async i=>{if(i.visibilityState==="visible"&&i.focused)return await w(i,"hasRoomOpen",{sessionId:s,roomId:t})})){console.log("client is focused, room is open, don't show notif");return}const o=Array.from(await self.registration.getNotifications({tag:p})),L=o.filter(i=>i.data.roomId===t).some(i=>i.data.multi),U=o.some(i=>!i.data.multi),r=e.room_name||e.room_alias;let C=!1,h,u;if(L){console.log("already have a multi message, don't do anything");return}else U?(console.log("showing multi message notification"),C=!0,h=r||a,u="New messages"):(console.log("showing new message notification"),r&&r!==a?h=`${a} in ${r}`:h=a,u=e.content?.body||"New message");await self.registration.showNotification(h,{body:u,data:{sessionId:s,roomId:t,multi:C},tag:p,badge:T})}}self.addEventListener("push",e=>{e.waitUntil(P(e.data.json()))});async function W(e,s){const a=await self.clients.matchAll();await Promise.all(a.map(async t=>{t.id!==s&&await w(t,"closeSession",{sessionId:e})}))}async function M(){const e=await self.clients.matchAll({type:"window"});await Promise.all(e.map(s=>w(s,"haltRequests"))),d.abort()}const g=new Map;let S=0;function w(e,s,a){S+=1;const t=S,n=new Promise(o=>{g.set(t,o)});return e.postMessage({type:s,id:t,payload:a}),n}async function b(e){const s=await self.clients.matchAll({type:"window"});for(const a of s)if(await e(a))return a}
     1var T="assets/icon.2a39c64c.png";const A=["assets/theme-chatrix.json","iframe.html"],R=["assets/icon.2a39c64c.png","assets/olm.92f1ccd0.js","assets/olm.b3e0f9b4.wasm","assets/download-sandbox.48a866e9.html","assets/chevron-down-3300400168.d1a083a1.svg","assets/room-members-3297708388.1a158fe2.svg","assets/mic-muted-2617055184.e8d1962f.svg","assets/cam-muted-2247331037.b0b2cf01.svg","assets/hangup-1798659826.d0cb8438.svg","assets/mic-muted-4213153786.513608a5.svg","assets/mic-unmuted-3178778883.b8f57412.svg","assets/cam-muted-1894081672.22150c2b.svg","assets/cam-unmuted-2215154474.a82b7bf1.svg","assets/clear-2745749323.bcd2574b.svg","assets/clear-2203718389.37dd36a5.svg","assets/element-logo-2135064725.cdac8806.svg","assets/enable-grid-2071838379.ab4f40c5.svg","assets/settings-2175246113.00804666.svg","assets/plus-4190356069.084c5e3d.svg","assets/disable-grid-3304422220.8a79cfcb.svg","assets/search-3263540198.1511780c.svg","assets/clear-426756705.361f7a30.svg","assets/chevron-left-3506338632.4e437777.svg","assets/dismiss-2743697487.2f1a17f1.svg","assets/chevron-right-847198822.23380c56.svg","assets/vertical-ellipsis-3416547705.f619a721.svg","assets/send-1171052351.caa5c494.svg","assets/paperclip-2441131778.1f5e29f3.svg","assets/chevron-small-781914114.936b4943.svg","assets/room-members-3847743605.9fcf4567.svg","assets/encryption-status-475927392.2fedc0bd.svg","assets/e2ee-normal-1434691185.95415e20.svg","assets/e2ee-disabled-3482032905.cc7da5eb.svg","assets/chevron-thin-left-3831175135.13f60c05.svg","assets/video-call-3307702325.5e74dd9a.svg","assets/room-members-1680968332.b4f57622.svg","assets/chevron-down-1956489915.3389f17f.svg","assets/room-members-871477030.90b799fe.svg","assets/mic-muted-2638557456.4d8c99b4.svg","assets/cam-muted-3489740486.a882d986.svg","assets/hangup-581771896.279a6adf.svg","assets/mic-muted-3642419863.228ee86f.svg","assets/mic-unmuted-211198830.1fde69c5.svg","assets/cam-muted-711199923.069dcf2b.svg","assets/cam-unmuted-2274150835.69bcdbc4.svg","assets/element-logo-1551909733.1d59f06a.svg","assets/enable-grid-2288309723.f83895c8.svg","assets/settings-878939771.57cf3680.svg","assets/plus-3937109722.5c243914.svg","assets/disable-grid-4240599831.c8dc25a1.svg","assets/search-261439583.1bffaca1.svg","assets/clear-4137897294.7b90e8df.svg","assets/chevron-left-2611498805.b5555a61.svg","assets/chevron-right-2390431650.ec9bf561.svg","assets/dismiss-2476348673.d0f98560.svg","assets/vertical-ellipsis-487061581.e7709afd.svg","assets/send-3413346515.b0fb8626.svg","assets/paperclip-3961996319.da562307.svg","assets/chevron-small-4098047679.489e66cc.svg","assets/room-members-3084360280.6f64aaef.svg","assets/encryption-status-3449529405.c200a9bb.svg","assets/e2ee-normal-1448349558.af8f5484.svg","assets/e2ee-disabled-1470792300.6863c16d.svg","assets/chevron-thin-left-3078630092.d0d143e3.svg","assets/room-members-2999414798.6534e8ec.svg","assets/video-call-2591082837.8f09bafc.svg","assets/iframe.1839a1af.js","assets/theme-chatrix-dark.1162b2b5.css","assets/theme-chatrix-light.ad6a6d74.css","assets/theme-chatrix-runtime.3164f5eb.css","assets/chevron-down.9a7440b9.svg","assets/room-members.35ed0bf9.svg","assets/mic-muted.56aa03b9.svg","assets/cam-muted.9f690631.svg","assets/hangup.8b163c30.svg","assets/mic-unmuted.c180f63a.svg","assets/cam-unmuted.67e18332.svg","assets/clear.0d180c33.svg","assets/element-logo.86bc8565.svg","assets/enable-grid.eef43c65.svg","assets/settings.45b8e09f.svg","assets/plus.49560f96.svg","assets/disable-grid.371ceaaa.svg","assets/search.21e0fd39.svg","assets/chevron-left.b8b2c5fc.svg","assets/chevron-right.885731d1.svg","assets/vertical-ellipsis.70ab5d25.svg","assets/send.7a090949.svg","assets/paperclip.ec29fd9d.svg","assets/chevron-small.dfd7e618.svg","assets/encryption-status.8054183e.svg","assets/e2ee-normal.bef76bd4.svg","assets/e2ee-disabled.8507165d.svg","assets/chevron-thin-left.d111869b.svg","assets/video-call.d3cb081e.svg","assets/icon-maskable.f15251f1.png"],_=["assets/main.5b3f6f97.js","assets/olm_legacy.9dc48f49.js","assets/Inter-Thin.5d8e2ac4.woff2","assets/Inter-ThinItalic.6b3ded18.woff2","assets/Inter-ExtraLight.da47c335.woff2","assets/Inter-ExtraLightItalic.b3f94cfe.woff2","assets/Inter-Light.0f7dfe72.woff2","assets/Inter-LightItalic.125c7e6a.woff2","assets/Inter-Regular.89d406b0.woff2","assets/Inter-Medium.5d308f3d.woff2","assets/Inter-Italic.bab4e808.woff2","assets/Inter-SemiBold.c7c3befe.woff2","assets/Inter-SemiBoldItalic.d376ade4.woff2","assets/Inter-Bold.6f5e9a23.woff2","assets/Inter-ExtraBoldItalic.d1e1f6a0.woff2","assets/Inter-Black.7f1f5616.woff2","assets/Inter-BlackItalic.72d5983b.woff2","assets/Inter-ExtraBold.0ef4267e.woff2","assets/Inter-BoldItalic.e09dcbe1.woff2","assets/Inter-MediumItalic.76551c20.woff2","assets/Inter-ThinItalic.c413497b.woff","assets/Inter-Light.38326098.woff","assets/Inter-LightItalic.ec6c76a8.woff","assets/Inter-Regular.5b3a854b.woff","assets/Inter-ExtraLightItalic.762fa4d2.woff","assets/Inter-ExtraLight.d7be68a4.woff","assets/Inter-Thin.5565b01e.woff","assets/Inter-Medium.0fc5d904.woff","assets/Inter-Italic.7b187d57.woff","assets/Inter-SemiBoldItalic.420db54a.woff","assets/Inter-SemiBold.04cd699f.woff","assets/Inter-Bold.20d46cff.woff","assets/Inter-ExtraBoldItalic.30a1af87.woff","assets/Inter-Black.067c82f7.woff","assets/Inter-BlackItalic.c628a2cf.woff","assets/Inter-BoldItalic.31a185fa.woff","assets/Inter-MediumItalic.1458af9d.woff","assets/Inter-ExtraBold.45bae435.woff","assets/sync-worker.88015204.js","assets/manifest.ffcfe959.json"],m=`hydrogen-assets-${"3635326940"}`,l="hydrogen-assets",y="hydrogen-media-thumbnails-v2";self.addEventListener("install",function(e){e.waitUntil((async()=>{await(await caches.open(m)).addAll(A);const a=await caches.open(l);await Promise.all(R.map(async t=>{await a.match(t)||await a.add(t)}))})())});self.addEventListener("activate",e=>{self.clients.claim(),e.waitUntil(k())});async function k(){const e=await caches.keys();for(const n of e)n!==m&&n!==l&&n!==y&&await caches.delete(n);const s=await caches.open(l),a=await s.keys(),t=R.concat(_).map(n=>new URL(n,self.registration.scope).href);for(const n of a)t.some(o=>o===n.url)||s.delete(n)}self.addEventListener("fetch",e=>{e.request.method==="GET"&&e.respondWith(I(e.request))});function E(e){if(e.pathname.startsWith("/_matrix/media/r0/thumbnail/")){const s=parseInt(e.searchParams.get("width"),10),a=parseInt(e.searchParams.get("height"),10);if(s<=50&&a<=50)return!0}return!1}const f=new URL(self.registration.scope);let d=new AbortController;async function I(e){try{if(e.url.includes("config.json")||/theme-.+\.json/.test(e.url))return D(e);const s=new URL(e.url);s.origin===f.origin&&s.pathname===f.pathname&&(e=new Request(new URL("index.html",f.href)));let a=await N(e);return a||(E(s)?a=await fetch(e,{signal:d.signal,mode:"cors",credentials:"omit"}):a=await fetch(e,{signal:d.signal}),await H(e,a)),a}catch(s){throw s.name!=="TypeError"&&s.name!=="AbortError"&&console.error("error in service worker",s),s}}async function D(e){let s=await N(e);const a=O(e);return s||await a}async function O(e){const s=await fetch(e,{signal:d.signal,headers:{"Cache-Control":"no-cache"}});return H(e,s.clone()),s}async function H(e,s){if(s.status>=400)return;const a=new URL(e.url),t=self.registration.scope;if(E(a))(await caches.open(y)).put(e,s.clone());else if(e.url.startsWith(t)){let n=e.url.substr(t.length),o;_.includes(n)?o=l:A.includes(n)&&(o=m),o&&await(await caches.open(o)).put(e,s.clone())}}async function N(e){let a=await(await caches.open(m)).match(e);if(a||(a=await(await caches.open(l)).match(e),a))return a;const n=new URL(e.url);if(E(n)){const o=await caches.open(y);a=await o.match(e),a?.status>=400&&(await o.delete(e),a=null)}return a}self.addEventListener("message",e=>{const s=t=>e.source.postMessage({replyTo:e.data.id,payload:t}),{replyTo:a}=e.data;if(a){const t=g.get(a);t&&(g.delete(a),t(e.data.payload))}else switch(e.data?.type){case"version":s({version:"0.9.2",buildHash:"3635326940"});break;case"skipWaiting":self.skipWaiting();break;case"haltRequests":e.waitUntil(M().finally(()=>s()));break;case"closeSession":e.waitUntil(W(e.data.payload.sessionId,e.source.id).finally(()=>s()));break}});const p="new_message";async function F(e){if(e.notification.tag!==p){console.log("clicked notif with tag",e.notification.tag);return}const{sessionId:s,roomId:a}=e.notification.data,n=`${`#/session/${s}`}/room/${a}`,o=await b(async c=>await w(c,"hasSessionOpen",{sessionId:s}));if(o){if(console.log("notificationclick: client has session open, showing room there"),o.postMessage({type:"openRoom",payload:{roomId:a}}),"focus"in o)try{await o.focus()}catch(c){console.error(c)}}else if(self.clients.openWindow){console.log("notificationclick: no client found with session open, opening new window");const c=new URL(`./${n}`,f).href;await self.clients.openWindow(c)}}self.addEventListener("notificationclick",e=>{e.notification.close(),e.waitUntil(F(e))});async function P(e){console.log("got a push message",e);const s=e.session_id;let a=e.sender_display_name||e.sender;if(a&&e.event_id){const t=e.room_id;if(!!await b(async i=>{if(i.visibilityState==="visible"&&i.focused)return await w(i,"hasRoomOpen",{sessionId:s,roomId:t})})){console.log("client is focused, room is open, don't show notif");return}const o=Array.from(await self.registration.getNotifications({tag:p})),L=o.filter(i=>i.data.roomId===t).some(i=>i.data.multi),U=o.some(i=>!i.data.multi),r=e.room_name||e.room_alias;let C=!1,h,u;if(L){console.log("already have a multi message, don't do anything");return}else U?(console.log("showing multi message notification"),C=!0,h=r||a,u="New messages"):(console.log("showing new message notification"),r&&r!==a?h=`${a} in ${r}`:h=a,u=e.content?.body||"New message");await self.registration.showNotification(h,{body:u,data:{sessionId:s,roomId:t,multi:C},tag:p,badge:T})}}self.addEventListener("push",e=>{e.waitUntil(P(e.data.json()))});async function W(e,s){const a=await self.clients.matchAll();await Promise.all(a.map(async t=>{t.id!==s&&await w(t,"closeSession",{sessionId:e})}))}async function M(){const e=await self.clients.matchAll({type:"window"});await Promise.all(e.map(s=>w(s,"haltRequests"))),d.abort()}const g=new Map;let S=0;function w(e,s,a){S+=1;const t=S,n=new Promise(o=>{g.set(t,o)});return e.postMessage({type:s,id:t,payload:a}),n}async function b(e){const s=await self.clients.matchAll({type:"window"});for(const a of s)if(await e(a))return a}
  • chatrix/tags/0.9.2/chatrix.php

    r3107910 r3276116  
    66 * Author URI: https://wordpress.org/
    77 * Plugin URI: https://github.com/Automattic/chatrix
    8  * Version: 0.9.1
     8 * Version: 0.9.2
    99 */
    1010
     
    2323
    2424    // Do not edit this line, it's automatically set by bin/prepare-release.sh.
    25     $version = '0.9.1';
     25    $version = '0.9.2';
    2626
    2727    return $version;
  • chatrix/tags/0.9.2/src/Block/block.php

    r2900124 r3276116  
    77    $block_json_path = "$block_path/block.json";
    88
    9     register_site_status_test( $block_json_path );
    10 
    11     if ( ! file_exists( $block_json_path ) ) {
    12         return;
    13     }
    14 
    159    add_action(
    1610        'init',
    1711        function () use ( $block_json_path ) {
     12            register_site_status_test( $block_json_path );
     13
     14            if ( ! file_exists( $block_json_path ) ) {
     15                return;
     16            }
     17
    1818            $metadata = parse_block_json( $block_json_path );
    1919            register_block_type(
  • chatrix/tags/0.9.2/src/plugin.php

    r3107910 r3276116  
    2121
    2222function register_scripts() {
     23    // Common configuration data for both admin and frontend.
     24    $json_data = wp_json_encode(
     25        array(
     26            'rootUrl' => root_url() . '/iframe/',
     27        )
     28    );
     29
     30    // Helper function to register and enqueue the configuration script.
     31    $register_config_script = function() use ( $json_data ) {
     32        // Enqueue script for global configuration.
     33        wp_register_script( SCRIPT_HANDLE_CONFIG, '', array(), automattic_chatrix_version(), true );
     34        wp_enqueue_script( SCRIPT_HANDLE_CONFIG );
     35        wp_add_inline_script( SCRIPT_HANDLE_CONFIG, 'window.' . CONFIG_VARIABLE . " = $json_data;" );
     36    };
     37
     38    // Admin scripts - needed for Gutenberg editor.
     39    add_action(
     40        'admin_enqueue_scripts',
     41        function () use ( $register_config_script ) {
     42            // Register and enqueue configuration script in admin area.
     43            $register_config_script();
     44        }
     45    );
     46
     47    // Frontend scripts.
    2348    add_action(
    2449        'wp_enqueue_scripts',
    25         function () {
    26             $json_data = wp_json_encode(
    27                 array(
    28                     'rootUrl' => root_url() . '/iframe/',
    29                 )
    30             );
    31 
    32             // Enqueue script for global configuration.
    33             wp_register_script( SCRIPT_HANDLE_CONFIG, '', array(), automattic_chatrix_version(), true );
    34             wp_enqueue_script( SCRIPT_HANDLE_CONFIG );
    35             wp_add_inline_script( SCRIPT_HANDLE_CONFIG, 'window.' . CONFIG_VARIABLE . " = $json_data;" );
     50        function () use ( $register_config_script ) {
     51            // Register and enqueue configuration script.
     52            $register_config_script();
    3653
    3754            // Note we don't enqueue the SCRIPT_HANDLE_APP script yet. It will be enqueued whenever SCRIPT_HANDLE_APP
  • chatrix/tags/0.9.2/vendor/autoload.php

    r3003895 r3276116  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • chatrix/tags/0.9.2/vendor/composer/InstalledVersions.php

    r2900124 r3276116  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • chatrix/tags/0.9.2/vendor/composer/installed.php

    r3107910 r3276116  
    22    'root' => array(
    33        'name' => 'automattic/chatrix',
    4         'pretty_version' => '0.9.1',
    5         'version' => '0.9.1.0',
     4        'pretty_version' => '0.9.2',
     5        'version' => '0.9.2.0',
    66        'reference' => null,
    77        'type' => 'wordpress-plugin',
     
    1212    'versions' => array(
    1313        'automattic/chatrix' => array(
    14             'pretty_version' => '0.9.1',
    15             'version' => '0.9.1.0',
     14            'pretty_version' => '0.9.2',
     15            'version' => '0.9.2.0',
    1616            'reference' => null,
    1717            'type' => 'wordpress-plugin',
  • chatrix/trunk/README.md

    r3107910 r3276116  
    44- Tags: matrix, chat
    55- Requires at least: 6.0
    6 - Tested up to: 6.5
     6- Tested up to: 6.8
    77- Requires PHP: 7.4
    88- License: [GPLv2](http://www.gnu.org/licenses/gpl-2.0.html)
    9 - Stable tag: 0.9.1
     9- Stable tag: 0.9.2
    1010- GitHub Plugin URI: https://github.com/Automattic/chatrix
    1111
     
    6868
    6969## Changelog
     70
     71### 0.9.2
     72- Fix Chatrix iframe not loading in Gutenberg editor [#256](https://github.com/Automattic/chatrix/pull/256)
    7073
    7174### 0.9.1
  • chatrix/trunk/build/block/block.json

    r3107910 r3276116  
    33  "apiVersion": 2,
    44  "name": "automattic/chatrix",
    5   "version": "0.9.1",
     5  "version": "0.9.2",
    66  "title": "Chatrix",
    77  "category": "embed",
  • chatrix/trunk/build/iframe/iframe.html

    r3107910 r3276116  
    1111   
    1212   
    13   <script type="module" crossorigin src="assets/iframe.0e4fde11.js"></script>
     13  <script type="module" crossorigin src="assets/iframe.1839a1af.js"></script>
    1414  <link rel="manifest" href="assets/manifest.ffcfe959.json">
    1515</head>
  • chatrix/trunk/build/iframe/sw.js

    r3107910 r3276116  
    1 var T="assets/icon.2a39c64c.png";const A=["assets/theme-chatrix.json","iframe.html"],R=["assets/icon.2a39c64c.png","assets/olm.92f1ccd0.js","assets/olm.b3e0f9b4.wasm","assets/download-sandbox.48a866e9.html","assets/chevron-down-3300400168.d1a083a1.svg","assets/room-members-3297708388.1a158fe2.svg","assets/mic-muted-2617055184.e8d1962f.svg","assets/cam-muted-2247331037.b0b2cf01.svg","assets/hangup-1798659826.d0cb8438.svg","assets/mic-muted-4213153786.513608a5.svg","assets/mic-unmuted-3178778883.b8f57412.svg","assets/cam-muted-1894081672.22150c2b.svg","assets/cam-unmuted-2215154474.a82b7bf1.svg","assets/clear-2745749323.bcd2574b.svg","assets/clear-2203718389.37dd36a5.svg","assets/element-logo-2135064725.cdac8806.svg","assets/enable-grid-2071838379.ab4f40c5.svg","assets/settings-2175246113.00804666.svg","assets/plus-4190356069.084c5e3d.svg","assets/disable-grid-3304422220.8a79cfcb.svg","assets/search-3263540198.1511780c.svg","assets/clear-426756705.361f7a30.svg","assets/chevron-left-3506338632.4e437777.svg","assets/dismiss-2743697487.2f1a17f1.svg","assets/chevron-right-847198822.23380c56.svg","assets/vertical-ellipsis-3416547705.f619a721.svg","assets/send-1171052351.caa5c494.svg","assets/paperclip-2441131778.1f5e29f3.svg","assets/chevron-small-781914114.936b4943.svg","assets/room-members-3847743605.9fcf4567.svg","assets/encryption-status-475927392.2fedc0bd.svg","assets/e2ee-normal-1434691185.95415e20.svg","assets/e2ee-disabled-3482032905.cc7da5eb.svg","assets/chevron-thin-left-3831175135.13f60c05.svg","assets/video-call-3307702325.5e74dd9a.svg","assets/room-members-1680968332.b4f57622.svg","assets/chevron-down-1956489915.3389f17f.svg","assets/room-members-871477030.90b799fe.svg","assets/mic-muted-2638557456.4d8c99b4.svg","assets/cam-muted-3489740486.a882d986.svg","assets/mic-muted-3642419863.228ee86f.svg","assets/hangup-581771896.279a6adf.svg","assets/mic-unmuted-211198830.1fde69c5.svg","assets/cam-muted-711199923.069dcf2b.svg","assets/cam-unmuted-2274150835.69bcdbc4.svg","assets/element-logo-1551909733.1d59f06a.svg","assets/enable-grid-2288309723.f83895c8.svg","assets/settings-878939771.57cf3680.svg","assets/plus-3937109722.5c243914.svg","assets/disable-grid-4240599831.c8dc25a1.svg","assets/search-261439583.1bffaca1.svg","assets/clear-4137897294.7b90e8df.svg","assets/chevron-left-2611498805.b5555a61.svg","assets/dismiss-2476348673.d0f98560.svg","assets/chevron-right-2390431650.ec9bf561.svg","assets/vertical-ellipsis-487061581.e7709afd.svg","assets/send-3413346515.b0fb8626.svg","assets/paperclip-3961996319.da562307.svg","assets/chevron-small-4098047679.489e66cc.svg","assets/room-members-3084360280.6f64aaef.svg","assets/encryption-status-3449529405.c200a9bb.svg","assets/e2ee-normal-1448349558.af8f5484.svg","assets/e2ee-disabled-1470792300.6863c16d.svg","assets/chevron-thin-left-3078630092.d0d143e3.svg","assets/video-call-2591082837.8f09bafc.svg","assets/room-members-2999414798.6534e8ec.svg","assets/iframe.0e4fde11.js","assets/theme-chatrix-light.ad6a6d74.css","assets/theme-chatrix-dark.1162b2b5.css","assets/theme-chatrix-runtime.3164f5eb.css","assets/chevron-down.9a7440b9.svg","assets/room-members.35ed0bf9.svg","assets/mic-muted.56aa03b9.svg","assets/cam-muted.9f690631.svg","assets/hangup.8b163c30.svg","assets/mic-unmuted.c180f63a.svg","assets/cam-unmuted.67e18332.svg","assets/clear.0d180c33.svg","assets/element-logo.86bc8565.svg","assets/enable-grid.eef43c65.svg","assets/settings.45b8e09f.svg","assets/plus.49560f96.svg","assets/disable-grid.371ceaaa.svg","assets/search.21e0fd39.svg","assets/chevron-left.b8b2c5fc.svg","assets/chevron-right.885731d1.svg","assets/vertical-ellipsis.70ab5d25.svg","assets/send.7a090949.svg","assets/paperclip.ec29fd9d.svg","assets/chevron-small.dfd7e618.svg","assets/encryption-status.8054183e.svg","assets/e2ee-normal.bef76bd4.svg","assets/e2ee-disabled.8507165d.svg","assets/chevron-thin-left.d111869b.svg","assets/video-call.d3cb081e.svg","assets/icon-maskable.f15251f1.png"],_=["assets/main.5b3f6f97.js","assets/olm_legacy.9dc48f49.js","assets/Inter-Thin.5d8e2ac4.woff2","assets/Inter-ThinItalic.6b3ded18.woff2","assets/Inter-ExtraLight.da47c335.woff2","assets/Inter-ExtraLightItalic.b3f94cfe.woff2","assets/Inter-Light.0f7dfe72.woff2","assets/Inter-LightItalic.125c7e6a.woff2","assets/Inter-Regular.89d406b0.woff2","assets/Inter-Italic.bab4e808.woff2","assets/Inter-Medium.5d308f3d.woff2","assets/Inter-MediumItalic.76551c20.woff2","assets/Inter-SemiBold.c7c3befe.woff2","assets/Inter-SemiBoldItalic.d376ade4.woff2","assets/Inter-Bold.6f5e9a23.woff2","assets/Inter-BoldItalic.e09dcbe1.woff2","assets/Inter-ExtraBold.0ef4267e.woff2","assets/Inter-ExtraBoldItalic.d1e1f6a0.woff2","assets/Inter-Black.7f1f5616.woff2","assets/Inter-BlackItalic.72d5983b.woff2","assets/Inter-Thin.5565b01e.woff","assets/Inter-ThinItalic.c413497b.woff","assets/Inter-ExtraLight.d7be68a4.woff","assets/Inter-Light.38326098.woff","assets/Inter-ExtraLightItalic.762fa4d2.woff","assets/Inter-LightItalic.ec6c76a8.woff","assets/Inter-Medium.0fc5d904.woff","assets/Inter-Italic.7b187d57.woff","assets/Inter-Regular.5b3a854b.woff","assets/Inter-SemiBold.04cd699f.woff","assets/Inter-MediumItalic.1458af9d.woff","assets/Inter-Bold.20d46cff.woff","assets/Inter-SemiBoldItalic.420db54a.woff","assets/Inter-ExtraBold.45bae435.woff","assets/Inter-BoldItalic.31a185fa.woff","assets/Inter-BlackItalic.c628a2cf.woff","assets/Inter-ExtraBoldItalic.30a1af87.woff","assets/Inter-Black.067c82f7.woff","assets/sync-worker.88015204.js","assets/manifest.ffcfe959.json"],m=`hydrogen-assets-${"3565504203"}`,l="hydrogen-assets",y="hydrogen-media-thumbnails-v2";self.addEventListener("install",function(e){e.waitUntil((async()=>{await(await caches.open(m)).addAll(A);const a=await caches.open(l);await Promise.all(R.map(async t=>{await a.match(t)||await a.add(t)}))})())});self.addEventListener("activate",e=>{self.clients.claim(),e.waitUntil(k())});async function k(){const e=await caches.keys();for(const n of e)n!==m&&n!==l&&n!==y&&await caches.delete(n);const s=await caches.open(l),a=await s.keys(),t=R.concat(_).map(n=>new URL(n,self.registration.scope).href);for(const n of a)t.some(o=>o===n.url)||s.delete(n)}self.addEventListener("fetch",e=>{e.request.method==="GET"&&e.respondWith(I(e.request))});function E(e){if(e.pathname.startsWith("/_matrix/media/r0/thumbnail/")){const s=parseInt(e.searchParams.get("width"),10),a=parseInt(e.searchParams.get("height"),10);if(s<=50&&a<=50)return!0}return!1}const f=new URL(self.registration.scope);let d=new AbortController;async function I(e){try{if(e.url.includes("config.json")||/theme-.+\.json/.test(e.url))return D(e);const s=new URL(e.url);s.origin===f.origin&&s.pathname===f.pathname&&(e=new Request(new URL("index.html",f.href)));let a=await N(e);return a||(E(s)?a=await fetch(e,{signal:d.signal,mode:"cors",credentials:"omit"}):a=await fetch(e,{signal:d.signal}),await H(e,a)),a}catch(s){throw s.name!=="TypeError"&&s.name!=="AbortError"&&console.error("error in service worker",s),s}}async function D(e){let s=await N(e);const a=O(e);return s||await a}async function O(e){const s=await fetch(e,{signal:d.signal,headers:{"Cache-Control":"no-cache"}});return H(e,s.clone()),s}async function H(e,s){if(s.status>=400)return;const a=new URL(e.url),t=self.registration.scope;if(E(a))(await caches.open(y)).put(e,s.clone());else if(e.url.startsWith(t)){let n=e.url.substr(t.length),o;_.includes(n)?o=l:A.includes(n)&&(o=m),o&&await(await caches.open(o)).put(e,s.clone())}}async function N(e){let a=await(await caches.open(m)).match(e);if(a||(a=await(await caches.open(l)).match(e),a))return a;const n=new URL(e.url);if(E(n)){const o=await caches.open(y);a=await o.match(e),a?.status>=400&&(await o.delete(e),a=null)}return a}self.addEventListener("message",e=>{const s=t=>e.source.postMessage({replyTo:e.data.id,payload:t}),{replyTo:a}=e.data;if(a){const t=g.get(a);t&&(g.delete(a),t(e.data.payload))}else switch(e.data?.type){case"version":s({version:"0.9.1",buildHash:"3565504203"});break;case"skipWaiting":self.skipWaiting();break;case"haltRequests":e.waitUntil(M().finally(()=>s()));break;case"closeSession":e.waitUntil(W(e.data.payload.sessionId,e.source.id).finally(()=>s()));break}});const p="new_message";async function F(e){if(e.notification.tag!==p){console.log("clicked notif with tag",e.notification.tag);return}const{sessionId:s,roomId:a}=e.notification.data,n=`${`#/session/${s}`}/room/${a}`,o=await b(async c=>await w(c,"hasSessionOpen",{sessionId:s}));if(o){if(console.log("notificationclick: client has session open, showing room there"),o.postMessage({type:"openRoom",payload:{roomId:a}}),"focus"in o)try{await o.focus()}catch(c){console.error(c)}}else if(self.clients.openWindow){console.log("notificationclick: no client found with session open, opening new window");const c=new URL(`./${n}`,f).href;await self.clients.openWindow(c)}}self.addEventListener("notificationclick",e=>{e.notification.close(),e.waitUntil(F(e))});async function P(e){console.log("got a push message",e);const s=e.session_id;let a=e.sender_display_name||e.sender;if(a&&e.event_id){const t=e.room_id;if(!!await b(async i=>{if(i.visibilityState==="visible"&&i.focused)return await w(i,"hasRoomOpen",{sessionId:s,roomId:t})})){console.log("client is focused, room is open, don't show notif");return}const o=Array.from(await self.registration.getNotifications({tag:p})),L=o.filter(i=>i.data.roomId===t).some(i=>i.data.multi),U=o.some(i=>!i.data.multi),r=e.room_name||e.room_alias;let C=!1,h,u;if(L){console.log("already have a multi message, don't do anything");return}else U?(console.log("showing multi message notification"),C=!0,h=r||a,u="New messages"):(console.log("showing new message notification"),r&&r!==a?h=`${a} in ${r}`:h=a,u=e.content?.body||"New message");await self.registration.showNotification(h,{body:u,data:{sessionId:s,roomId:t,multi:C},tag:p,badge:T})}}self.addEventListener("push",e=>{e.waitUntil(P(e.data.json()))});async function W(e,s){const a=await self.clients.matchAll();await Promise.all(a.map(async t=>{t.id!==s&&await w(t,"closeSession",{sessionId:e})}))}async function M(){const e=await self.clients.matchAll({type:"window"});await Promise.all(e.map(s=>w(s,"haltRequests"))),d.abort()}const g=new Map;let S=0;function w(e,s,a){S+=1;const t=S,n=new Promise(o=>{g.set(t,o)});return e.postMessage({type:s,id:t,payload:a}),n}async function b(e){const s=await self.clients.matchAll({type:"window"});for(const a of s)if(await e(a))return a}
     1var T="assets/icon.2a39c64c.png";const A=["assets/theme-chatrix.json","iframe.html"],R=["assets/icon.2a39c64c.png","assets/olm.92f1ccd0.js","assets/olm.b3e0f9b4.wasm","assets/download-sandbox.48a866e9.html","assets/chevron-down-3300400168.d1a083a1.svg","assets/room-members-3297708388.1a158fe2.svg","assets/mic-muted-2617055184.e8d1962f.svg","assets/cam-muted-2247331037.b0b2cf01.svg","assets/hangup-1798659826.d0cb8438.svg","assets/mic-muted-4213153786.513608a5.svg","assets/mic-unmuted-3178778883.b8f57412.svg","assets/cam-muted-1894081672.22150c2b.svg","assets/cam-unmuted-2215154474.a82b7bf1.svg","assets/clear-2745749323.bcd2574b.svg","assets/clear-2203718389.37dd36a5.svg","assets/element-logo-2135064725.cdac8806.svg","assets/enable-grid-2071838379.ab4f40c5.svg","assets/settings-2175246113.00804666.svg","assets/plus-4190356069.084c5e3d.svg","assets/disable-grid-3304422220.8a79cfcb.svg","assets/search-3263540198.1511780c.svg","assets/clear-426756705.361f7a30.svg","assets/chevron-left-3506338632.4e437777.svg","assets/dismiss-2743697487.2f1a17f1.svg","assets/chevron-right-847198822.23380c56.svg","assets/vertical-ellipsis-3416547705.f619a721.svg","assets/send-1171052351.caa5c494.svg","assets/paperclip-2441131778.1f5e29f3.svg","assets/chevron-small-781914114.936b4943.svg","assets/room-members-3847743605.9fcf4567.svg","assets/encryption-status-475927392.2fedc0bd.svg","assets/e2ee-normal-1434691185.95415e20.svg","assets/e2ee-disabled-3482032905.cc7da5eb.svg","assets/chevron-thin-left-3831175135.13f60c05.svg","assets/video-call-3307702325.5e74dd9a.svg","assets/room-members-1680968332.b4f57622.svg","assets/chevron-down-1956489915.3389f17f.svg","assets/room-members-871477030.90b799fe.svg","assets/mic-muted-2638557456.4d8c99b4.svg","assets/cam-muted-3489740486.a882d986.svg","assets/hangup-581771896.279a6adf.svg","assets/mic-muted-3642419863.228ee86f.svg","assets/mic-unmuted-211198830.1fde69c5.svg","assets/cam-muted-711199923.069dcf2b.svg","assets/cam-unmuted-2274150835.69bcdbc4.svg","assets/element-logo-1551909733.1d59f06a.svg","assets/enable-grid-2288309723.f83895c8.svg","assets/settings-878939771.57cf3680.svg","assets/plus-3937109722.5c243914.svg","assets/disable-grid-4240599831.c8dc25a1.svg","assets/search-261439583.1bffaca1.svg","assets/clear-4137897294.7b90e8df.svg","assets/chevron-left-2611498805.b5555a61.svg","assets/chevron-right-2390431650.ec9bf561.svg","assets/dismiss-2476348673.d0f98560.svg","assets/vertical-ellipsis-487061581.e7709afd.svg","assets/send-3413346515.b0fb8626.svg","assets/paperclip-3961996319.da562307.svg","assets/chevron-small-4098047679.489e66cc.svg","assets/room-members-3084360280.6f64aaef.svg","assets/encryption-status-3449529405.c200a9bb.svg","assets/e2ee-normal-1448349558.af8f5484.svg","assets/e2ee-disabled-1470792300.6863c16d.svg","assets/chevron-thin-left-3078630092.d0d143e3.svg","assets/room-members-2999414798.6534e8ec.svg","assets/video-call-2591082837.8f09bafc.svg","assets/iframe.1839a1af.js","assets/theme-chatrix-dark.1162b2b5.css","assets/theme-chatrix-light.ad6a6d74.css","assets/theme-chatrix-runtime.3164f5eb.css","assets/chevron-down.9a7440b9.svg","assets/room-members.35ed0bf9.svg","assets/mic-muted.56aa03b9.svg","assets/cam-muted.9f690631.svg","assets/hangup.8b163c30.svg","assets/mic-unmuted.c180f63a.svg","assets/cam-unmuted.67e18332.svg","assets/clear.0d180c33.svg","assets/element-logo.86bc8565.svg","assets/enable-grid.eef43c65.svg","assets/settings.45b8e09f.svg","assets/plus.49560f96.svg","assets/disable-grid.371ceaaa.svg","assets/search.21e0fd39.svg","assets/chevron-left.b8b2c5fc.svg","assets/chevron-right.885731d1.svg","assets/vertical-ellipsis.70ab5d25.svg","assets/send.7a090949.svg","assets/paperclip.ec29fd9d.svg","assets/chevron-small.dfd7e618.svg","assets/encryption-status.8054183e.svg","assets/e2ee-normal.bef76bd4.svg","assets/e2ee-disabled.8507165d.svg","assets/chevron-thin-left.d111869b.svg","assets/video-call.d3cb081e.svg","assets/icon-maskable.f15251f1.png"],_=["assets/main.5b3f6f97.js","assets/olm_legacy.9dc48f49.js","assets/Inter-Thin.5d8e2ac4.woff2","assets/Inter-ThinItalic.6b3ded18.woff2","assets/Inter-ExtraLight.da47c335.woff2","assets/Inter-ExtraLightItalic.b3f94cfe.woff2","assets/Inter-Light.0f7dfe72.woff2","assets/Inter-LightItalic.125c7e6a.woff2","assets/Inter-Regular.89d406b0.woff2","assets/Inter-Medium.5d308f3d.woff2","assets/Inter-Italic.bab4e808.woff2","assets/Inter-SemiBold.c7c3befe.woff2","assets/Inter-SemiBoldItalic.d376ade4.woff2","assets/Inter-Bold.6f5e9a23.woff2","assets/Inter-ExtraBoldItalic.d1e1f6a0.woff2","assets/Inter-Black.7f1f5616.woff2","assets/Inter-BlackItalic.72d5983b.woff2","assets/Inter-ExtraBold.0ef4267e.woff2","assets/Inter-BoldItalic.e09dcbe1.woff2","assets/Inter-MediumItalic.76551c20.woff2","assets/Inter-ThinItalic.c413497b.woff","assets/Inter-Light.38326098.woff","assets/Inter-LightItalic.ec6c76a8.woff","assets/Inter-Regular.5b3a854b.woff","assets/Inter-ExtraLightItalic.762fa4d2.woff","assets/Inter-ExtraLight.d7be68a4.woff","assets/Inter-Thin.5565b01e.woff","assets/Inter-Medium.0fc5d904.woff","assets/Inter-Italic.7b187d57.woff","assets/Inter-SemiBoldItalic.420db54a.woff","assets/Inter-SemiBold.04cd699f.woff","assets/Inter-Bold.20d46cff.woff","assets/Inter-ExtraBoldItalic.30a1af87.woff","assets/Inter-Black.067c82f7.woff","assets/Inter-BlackItalic.c628a2cf.woff","assets/Inter-BoldItalic.31a185fa.woff","assets/Inter-MediumItalic.1458af9d.woff","assets/Inter-ExtraBold.45bae435.woff","assets/sync-worker.88015204.js","assets/manifest.ffcfe959.json"],m=`hydrogen-assets-${"3635326940"}`,l="hydrogen-assets",y="hydrogen-media-thumbnails-v2";self.addEventListener("install",function(e){e.waitUntil((async()=>{await(await caches.open(m)).addAll(A);const a=await caches.open(l);await Promise.all(R.map(async t=>{await a.match(t)||await a.add(t)}))})())});self.addEventListener("activate",e=>{self.clients.claim(),e.waitUntil(k())});async function k(){const e=await caches.keys();for(const n of e)n!==m&&n!==l&&n!==y&&await caches.delete(n);const s=await caches.open(l),a=await s.keys(),t=R.concat(_).map(n=>new URL(n,self.registration.scope).href);for(const n of a)t.some(o=>o===n.url)||s.delete(n)}self.addEventListener("fetch",e=>{e.request.method==="GET"&&e.respondWith(I(e.request))});function E(e){if(e.pathname.startsWith("/_matrix/media/r0/thumbnail/")){const s=parseInt(e.searchParams.get("width"),10),a=parseInt(e.searchParams.get("height"),10);if(s<=50&&a<=50)return!0}return!1}const f=new URL(self.registration.scope);let d=new AbortController;async function I(e){try{if(e.url.includes("config.json")||/theme-.+\.json/.test(e.url))return D(e);const s=new URL(e.url);s.origin===f.origin&&s.pathname===f.pathname&&(e=new Request(new URL("index.html",f.href)));let a=await N(e);return a||(E(s)?a=await fetch(e,{signal:d.signal,mode:"cors",credentials:"omit"}):a=await fetch(e,{signal:d.signal}),await H(e,a)),a}catch(s){throw s.name!=="TypeError"&&s.name!=="AbortError"&&console.error("error in service worker",s),s}}async function D(e){let s=await N(e);const a=O(e);return s||await a}async function O(e){const s=await fetch(e,{signal:d.signal,headers:{"Cache-Control":"no-cache"}});return H(e,s.clone()),s}async function H(e,s){if(s.status>=400)return;const a=new URL(e.url),t=self.registration.scope;if(E(a))(await caches.open(y)).put(e,s.clone());else if(e.url.startsWith(t)){let n=e.url.substr(t.length),o;_.includes(n)?o=l:A.includes(n)&&(o=m),o&&await(await caches.open(o)).put(e,s.clone())}}async function N(e){let a=await(await caches.open(m)).match(e);if(a||(a=await(await caches.open(l)).match(e),a))return a;const n=new URL(e.url);if(E(n)){const o=await caches.open(y);a=await o.match(e),a?.status>=400&&(await o.delete(e),a=null)}return a}self.addEventListener("message",e=>{const s=t=>e.source.postMessage({replyTo:e.data.id,payload:t}),{replyTo:a}=e.data;if(a){const t=g.get(a);t&&(g.delete(a),t(e.data.payload))}else switch(e.data?.type){case"version":s({version:"0.9.2",buildHash:"3635326940"});break;case"skipWaiting":self.skipWaiting();break;case"haltRequests":e.waitUntil(M().finally(()=>s()));break;case"closeSession":e.waitUntil(W(e.data.payload.sessionId,e.source.id).finally(()=>s()));break}});const p="new_message";async function F(e){if(e.notification.tag!==p){console.log("clicked notif with tag",e.notification.tag);return}const{sessionId:s,roomId:a}=e.notification.data,n=`${`#/session/${s}`}/room/${a}`,o=await b(async c=>await w(c,"hasSessionOpen",{sessionId:s}));if(o){if(console.log("notificationclick: client has session open, showing room there"),o.postMessage({type:"openRoom",payload:{roomId:a}}),"focus"in o)try{await o.focus()}catch(c){console.error(c)}}else if(self.clients.openWindow){console.log("notificationclick: no client found with session open, opening new window");const c=new URL(`./${n}`,f).href;await self.clients.openWindow(c)}}self.addEventListener("notificationclick",e=>{e.notification.close(),e.waitUntil(F(e))});async function P(e){console.log("got a push message",e);const s=e.session_id;let a=e.sender_display_name||e.sender;if(a&&e.event_id){const t=e.room_id;if(!!await b(async i=>{if(i.visibilityState==="visible"&&i.focused)return await w(i,"hasRoomOpen",{sessionId:s,roomId:t})})){console.log("client is focused, room is open, don't show notif");return}const o=Array.from(await self.registration.getNotifications({tag:p})),L=o.filter(i=>i.data.roomId===t).some(i=>i.data.multi),U=o.some(i=>!i.data.multi),r=e.room_name||e.room_alias;let C=!1,h,u;if(L){console.log("already have a multi message, don't do anything");return}else U?(console.log("showing multi message notification"),C=!0,h=r||a,u="New messages"):(console.log("showing new message notification"),r&&r!==a?h=`${a} in ${r}`:h=a,u=e.content?.body||"New message");await self.registration.showNotification(h,{body:u,data:{sessionId:s,roomId:t,multi:C},tag:p,badge:T})}}self.addEventListener("push",e=>{e.waitUntil(P(e.data.json()))});async function W(e,s){const a=await self.clients.matchAll();await Promise.all(a.map(async t=>{t.id!==s&&await w(t,"closeSession",{sessionId:e})}))}async function M(){const e=await self.clients.matchAll({type:"window"});await Promise.all(e.map(s=>w(s,"haltRequests"))),d.abort()}const g=new Map;let S=0;function w(e,s,a){S+=1;const t=S,n=new Promise(o=>{g.set(t,o)});return e.postMessage({type:s,id:t,payload:a}),n}async function b(e){const s=await self.clients.matchAll({type:"window"});for(const a of s)if(await e(a))return a}
  • chatrix/trunk/chatrix.php

    r3107910 r3276116  
    66 * Author URI: https://wordpress.org/
    77 * Plugin URI: https://github.com/Automattic/chatrix
    8  * Version: 0.9.1
     8 * Version: 0.9.2
    99 */
    1010
     
    2323
    2424    // Do not edit this line, it's automatically set by bin/prepare-release.sh.
    25     $version = '0.9.1';
     25    $version = '0.9.2';
    2626
    2727    return $version;
  • chatrix/trunk/src/Block/block.php

    r2900124 r3276116  
    77    $block_json_path = "$block_path/block.json";
    88
    9     register_site_status_test( $block_json_path );
    10 
    11     if ( ! file_exists( $block_json_path ) ) {
    12         return;
    13     }
    14 
    159    add_action(
    1610        'init',
    1711        function () use ( $block_json_path ) {
     12            register_site_status_test( $block_json_path );
     13
     14            if ( ! file_exists( $block_json_path ) ) {
     15                return;
     16            }
     17
    1818            $metadata = parse_block_json( $block_json_path );
    1919            register_block_type(
  • chatrix/trunk/src/plugin.php

    r3107910 r3276116  
    2121
    2222function register_scripts() {
     23    // Common configuration data for both admin and frontend.
     24    $json_data = wp_json_encode(
     25        array(
     26            'rootUrl' => root_url() . '/iframe/',
     27        )
     28    );
     29
     30    // Helper function to register and enqueue the configuration script.
     31    $register_config_script = function() use ( $json_data ) {
     32        // Enqueue script for global configuration.
     33        wp_register_script( SCRIPT_HANDLE_CONFIG, '', array(), automattic_chatrix_version(), true );
     34        wp_enqueue_script( SCRIPT_HANDLE_CONFIG );
     35        wp_add_inline_script( SCRIPT_HANDLE_CONFIG, 'window.' . CONFIG_VARIABLE . " = $json_data;" );
     36    };
     37
     38    // Admin scripts - needed for Gutenberg editor.
     39    add_action(
     40        'admin_enqueue_scripts',
     41        function () use ( $register_config_script ) {
     42            // Register and enqueue configuration script in admin area.
     43            $register_config_script();
     44        }
     45    );
     46
     47    // Frontend scripts.
    2348    add_action(
    2449        'wp_enqueue_scripts',
    25         function () {
    26             $json_data = wp_json_encode(
    27                 array(
    28                     'rootUrl' => root_url() . '/iframe/',
    29                 )
    30             );
    31 
    32             // Enqueue script for global configuration.
    33             wp_register_script( SCRIPT_HANDLE_CONFIG, '', array(), automattic_chatrix_version(), true );
    34             wp_enqueue_script( SCRIPT_HANDLE_CONFIG );
    35             wp_add_inline_script( SCRIPT_HANDLE_CONFIG, 'window.' . CONFIG_VARIABLE . " = $json_data;" );
     50        function () use ( $register_config_script ) {
     51            // Register and enqueue configuration script.
     52            $register_config_script();
    3653
    3754            // Note we don't enqueue the SCRIPT_HANDLE_APP script yet. It will be enqueued whenever SCRIPT_HANDLE_APP
  • chatrix/trunk/vendor/autoload.php

    r3003895 r3276116  
    1515        }
    1616    }
    17     trigger_error(
    18         $err,
    19         E_USER_ERROR
    20     );
     17    throw new RuntimeException($err);
    2118}
    2219
  • chatrix/trunk/vendor/composer/InstalledVersions.php

    r2900124 r3276116  
    2828{
    2929    /**
     30     * @var string|null if set (by reflection by Composer), this should be set to the path where this class is being copied to
     31     * @internal
     32     */
     33    private static $selfDir = null;
     34
     35    /**
    3036     * @var mixed[]|null
    3137     * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>}|array{}|null
    3238     */
    3339    private static $installed;
     40
     41    /**
     42     * @var bool
     43     */
     44    private static $installedIsLocalDir;
    3445
    3546    /**
     
    310321        self::$installed = $data;
    311322        self::$installedByVendor = array();
     323
     324        // when using reload, we disable the duplicate protection to ensure that self::$installed data is
     325        // always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
     326        // so we have to assume it does not, and that may result in duplicate data being returned when listing
     327        // all installed packages for example
     328        self::$installedIsLocalDir = false;
     329    }
     330
     331    /**
     332     * @return string
     333     */
     334    private static function getSelfDir()
     335    {
     336        if (self::$selfDir === null) {
     337            self::$selfDir = strtr(__DIR__, '\\', '/');
     338        }
     339
     340        return self::$selfDir;
    312341    }
    313342
     
    323352
    324353        $installed = array();
     354        $copiedLocalDir = false;
    325355
    326356        if (self::$canGetVendors) {
     357            $selfDir = self::getSelfDir();
    327358            foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
     359                $vendorDir = strtr($vendorDir, '\\', '/');
    328360                if (isset(self::$installedByVendor[$vendorDir])) {
    329361                    $installed[] = self::$installedByVendor[$vendorDir];
     
    331363                    /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
    332364                    $required = require $vendorDir.'/composer/installed.php';
    333                     $installed[] = self::$installedByVendor[$vendorDir] = $required;
    334                     if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
    335                         self::$installed = $installed[count($installed) - 1];
     365                    self::$installedByVendor[$vendorDir] = $required;
     366                    $installed[] = $required;
     367                    if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
     368                        self::$installed = $required;
     369                        self::$installedIsLocalDir = true;
    336370                    }
     371                }
     372                if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
     373                    $copiedLocalDir = true;
    337374                }
    338375            }
     
    351388        }
    352389
    353         if (self::$installed !== array()) {
     390        if (self::$installed !== array() && !$copiedLocalDir) {
    354391            $installed[] = self::$installed;
    355392        }
  • chatrix/trunk/vendor/composer/installed.php

    r3107910 r3276116  
    22    'root' => array(
    33        'name' => 'automattic/chatrix',
    4         'pretty_version' => '0.9.1',
    5         'version' => '0.9.1.0',
     4        'pretty_version' => '0.9.2',
     5        'version' => '0.9.2.0',
    66        'reference' => null,
    77        'type' => 'wordpress-plugin',
     
    1212    'versions' => array(
    1313        'automattic/chatrix' => array(
    14             'pretty_version' => '0.9.1',
    15             'version' => '0.9.1.0',
     14            'pretty_version' => '0.9.2',
     15            'version' => '0.9.2.0',
    1616            'reference' => null,
    1717            'type' => 'wordpress-plugin',
Note: See TracChangeset for help on using the changeset viewer.