OverviewFilesCommitsIssuesDocsReleasesPeers

keet-cli / deobfuscated / lib / sync / updater.js

424 lines · javascript ref:
const ReadyResource=require('ready-resource'),safetyCatch=require('safety-catch'),b4a=require('b4a'),RoomLoader=require('./loader'),{
  KeetContract}
=require('../contract'),{
  contract:{
    hyperschema:{
      getEnum:getContractEnum}
  }
}
=require('../../spec'),{
  verifyIdentityProofs,generateRoomCapabilities,generateIdentityPairingName}
=require('../invitations');
const {
  RoomStatus}
=require('../contract/identity/private'),RoomType=getContractEnum("@keet/room-type");
const INSERT_TYPE="insert",INCREMENTAL_SYNC_LIMIT=0x10;
module.exports=class RoomUpdater extends ReadyResource{
  constructor(_0x11be62,_0x4fcc88,_0x41818e,_0x334e64){
    _0x11f29c={
      _0x122b0c:0x150,_0x74dc93:0x84},_0xbf747a={
      _0x454d84:0xaf,_0x3d10fd:0x376,_0xf355a:0x1b1}
    ;
    super();
    this.keet=_0x11be62;
    this.swarm=_0x11be62.swarm,this.local=_0x11be62.local,this.view=_0x4fcc88,this.base=_0x41818e,this.changes=_0x334e64,this.isCurrentPrivateProfile=![],this.currentPrivateProfileInfo=null,this.currentIdentityInfo=null,this.currentWriterInfo=null,this.currentRoomInfo=null,this.roomInfo=null,this.updated=![],this.updates={
      'cache':null,'tasks':null,'contacts':null,'dispatches':null,'profileDispatches':null,'unreadKeys':![],'sharedRooms':null,'sharedPreferences':null,'pendingInvitations':null,'startIdentitySwap':null,'attemptIdentitySwap':null,'finishIdentitySwap':null,'logout':![]},this.events=[],this._loader=null,this._running=null;
  }
._open(){
  _0x423386={
    _0x1d7b2d:0x8,_0x31963f:0x138},_0x4b0443={
    _0x4dc315:0x39,_0x312856:0x160}
  ;
  return this._loader=new RoomLoader(this.local,this.view,this.base),this._loader.ready();
}
async._close(){
  _0xc9b336={
    _0x5d8879:0x118,_0x11d737:0x1d3,_0x3a8284:0x10c},_0x2b3817={
    _0x4838ac:0x2da,_0x4a2c3d:0xa5,_0x13f921:0x152}
  ;
  if(this._loader)await this._loader.close();
}
async._syncDigest(_0x2a1d83){
  _0x27e119={
    _0x17d2f4:0x1d8,_0x2605dd:0x1c5},_0x15a0e2={
    _0x4c1eab:0x3d5,_0x5020ff:0xc8}
  ;
  if(!_0x2a1d83)_0x2a1d83=await this._loader.loadDigest();
  if(!_0x2a1d83)return;
  this.events.push({'type':"v2:room-digest-changed",'value':_0x2a1d83}),this.roomInfo.digest=_0x2a1d83;
}
async._syncConfig(){
  _0x3455f4={
    _0x56d15a:0x15b,_0x5302a1:0x777},_0x5a73c9={
    _0x21d743:0x71b}
  ;
  const _0x1e5457=await this._loader.loadConfig();
  if(!_0x1e5457)return;
  this.events.push({'type':"v2:room-config-changed",'value':_0x1e5457});
  this.roomInfo.config=_0x1e5457;
}
async._syncRoomCapabilities(_0x4f7d35){
  _0x11e721={
    _0x33f498:0x4f,_0x4be693:0x56e},_0x1d7212={
    _0x54fc71:0x94,_0x2ba782:0x168,_0x27b3e4:0x67}
  ;
  if(!_0x4f7d35)_0x4f7d35=await this._loader.loadCapabilities();
  if(!_0x4f7d35)return;
  if(this.roomInfo.seed&&b4a.equals(this.roomInfo.seed,_0x4f7d35.seed))return;
  this.events.push({'type':"v2:room-capabilities-changed",'value':_0x4f7d35}),this.roomInfo.seed=_0x4f7d35.seed;
  this.roomInfo.capabilities=generateRoomCapabilities(this.base.key,_0x4f7d35.seed);
}
async._syncSelf(){
  _0x1bd01f={
    _0xac6d22:0x6b,_0x5a69da:0x19c,_0x4f8b95:0x153},_0x40eb9c={
    _0xc795a1:0x680,_0x3580b3:0x52,_0x45370b:0x1b6}
  ;
  const [_0x44f97b,_0x476b20,_0x13936b]=await Promise.all([this._loader.loadDigest(),this._loader.loadSelfDevice(),this._loader.loadSelfMember()]);
  this.roomInfo.selfDevice=_0x476b20,this.roomInfo.selfMember=_0x13936b;
  if(!_0x44f97b||_0x44f97b.settings.roomType!==RoomType.DirectMessage)return;
  const [_0x1c1476,_0x1703f5]=await Promise.all([this._loader.loadConfig(),this._loader.loadDMMembers()]);
  this.roomInfo.config=_0x1c1476,this.roomInfo.dm=_0x1703f5;
}
async._syncSelfMember(_0x14de6e){
  _0x34fe66={
    _0x546e3c:0x3c8,_0x8e8433:0xe7,_0x533199:0x93},_0x357467={
    _0x3c1346:0x11b,_0x766022:0x527,_0x5bc0a7:0x1a8}
  ;
  this.events.push({'type':"v2:room-member-changed",'value':_0x14de6e});
  if(_0x14de6e&&!b4a.equals(_0x14de6e.key,this.currentIdentityInfo.publicKey))return;
  return this._syncSelf();
}
async._syncDevice(_0x5719d4){
  _0x4bc373={
    _0x4d7a3c:0x94,_0x33070e:0x28,_0x1c0a8a:0x19a},_0xc86bfb={
    _0x55da99:0x126,_0x1dbcf9:0x105}
  ;
  this.events.push({'type':"v2:room-device-changed",'value':_0x5719d4});
  if(_0x5719d4&&!b4a.equals(_0x5719d4.key,this.base.local.key))return;
  return this._syncSelf();
}
._setLastMessage(_0xd8e827){
  _0x56fafd={
    _0x45019b:0x348,_0x278751:0x10,_0x5341b2:0xd5},_0x410733={
    _0x1fe176:0x534,_0x3b8841:0x13}
  ;
  this.events.push({'type':"v2:room-last-message-changed",'value':_0xd8e827}),this.roomInfo.lastMessage=_0xd8e827.message,this.roomInfo.lastMember=_0xd8e827.member;
  this.roomInfo.lastMessageReactions=_0xd8e827.reactions,this.updates.cache={
    'member':_0xd8e827.member,'device':_0xd8e827.device}
  ;
  const _0x44d277=this.currentRoomInfo?..lastMessage;
  if(_0x44d277&&sameChatMessage(_0x44d277,_0xd8e827.message))return;
  this.updates.chat=_0xd8e827.message;
}
async._syncLastMessage(){
  _0x21543d={
    _0x230e8e:0x706,_0x287bf7:0x1a2},_0x13f825={
    _0x20f6e3:0x6ca,_0x175e75:0xe,_0x435d3b:0x112},_0x5f05cc=await this._loader.loadLastMessage();
  if(!_0x5f05cc)return;
  this._setLastMessage(_0x5f05cc);
}
async._syncMessage(_0x4c34b4){
  _0x2e7d43={
    _0x2c4f48:0x43c,_0x25cfbc:0x1b1},_0x49bdb2={
    _0x57e724:0x199,_0x5dab9d:0x93}
  ;
  if(!_0x4c34b4)return;
  const [_0x2f1e25,_0x2e7b76]=await Promise.all([this._loader.loadPrimaryThread(),this._loader.loadMessage(_0x4c34b4.id)]),_0x406a5a=_0x4c34b4.id.thread===-0xff4&&_0x4c34b4.id.index===_0x2f1e25.count-(--0xa17);
  if(_0x406a5a)this._setLastMessage(_0x2e7b76);
  this.events.push({'type':"v2:room-chat-changed",'value':_0x2e7b76});
}
async._syncReactions(_0xc539a3){
  _0x1d7101={
    _0x2562fd:0xe0,_0x44441e:0x31}
  ;
  const _0x36ae63=await this._loader.input.get("@keet/chat",{'id':_0xc539a3.id});
  this.events.push({'type':"v2:room-reactions-changed",'value':{'id':_0x36ae63.oplog,'reactions':_0xc539a3}});
}
._syncJoinRequests(_0x497c69){
  _0x48d4de={
    _0x3699e2:0x115,_0x16fe7f:0x27,_0x289932:0xb1},_0x47783a={
    _0x3b071d:0x28,_0x2798ae:0x1ca}
  ;
  this.events.push({'type':"v2:room-join-requests-changed",'value':_0x497c69});
}
async._syncReadLengths(){
  _0x55d451={
    _0x1ada16:0x3c0},_0x2ef390={
    _0x282c23:0x3e7,_0x5a51bf:0xc8}
  ;
  const _0x189f9b=await this._loader.loadReadLengths();
  if(!_0x189f9b?..length)return;
  this.events.push({'type':"v2:read-lengths-changed",'value':_0x189f9b}),this.roomInfo.readLengths=_0x189f9b;
}
async._syncStats(_0x237add){
  _0x4da21c={
    _0x54fbe3:0x184,_0x3758f7:0x1ba},_0x10bef7={
    _0x28551b:0x4c,_0x3776b4:0x13f}
  ;
  if(!_0x237add)_0x237add=await this._loader.loadPrimaryThread();
  if(!_0x237add)return;
  this.events.push({'type':"v2:room-stats-changed",'value':_0x237add}),this.roomInfo.stats=_0x237add.stats;
}
async._syncRoomIdentity(_0x434865){
  _0x3da213={
    _0x564c77:0x84,_0x1873fd:0x6bd,_0x5111b4:0x196},_0x3bead4={
    _0x4ede3e:0x11c,_0x5a58bf:0x84}
  ;
  if(!_0x434865)_0x434865=await this._loader.loadIdentity();
  if(!_0x434865)return;
  this.events.push({'type':"v2:room-identity-changed",'value':_0x434865}),this.roomInfo.identity=_0x434865;
}
async._syncUnreadAnchors(){
  _0x3ce1d1={
    _0xda9f86:0x6c,_0x3b12b9:0x410,_0x53ed21:0x19},_0x4872fd={
    _0x102323:0xd9,_0xcf4c66:0xa0,_0x5023e8:0x18}
  ;
  this.updates.unreadKeys=!![];
}
async._syncMember(_0x4a979a){
  _0xae460c={
    _0x306769:0x13f},_0x5c874c={
    _0x2d9e89:0x15d},_0xc56c3a=[this._syncSelfMember(_0x4a979a)];
  this.roomInfo.dm?..length&&_0xc56c3a.push(this._syncConfig().catch(safetyCatch));
  const {
    lastMember:_0x10e7eb}
  =this.roomInfo;
  _0x10e7eb&&b4a.equals(_0x10e7eb.key,_0x4a979a.key)&&_0xc56c3a.push(this._syncLastMessage().catch(safetyCatch)),await Promise.all(_0xc56c3a);
}
async._incrementalRoomInfoLoad(_0x764b51,_0xdb4f55){
  _0x5e7208={
    _0x221538:0xaf,_0x56fc32:0x1a6},_0x2e425a={
    _0x2b4072:0x599},_0x1d821f=[];
  for await(const {type:_0x3e0fcb,collection:_0x46f631,value:_0x1a9b54}of this._loader.input.changes({'gte':_0x764b51,'lt':_0xdb4f55})){
    if(_0x3e0fcb!==INSERT_TYPE)continue;
    let _0x5ae298=null;
    switch(_0x46f631){
      case "@keet/system-digest":_0x5ae298=this._syncDigest(_0x1a9b54);
      break;
      case "@keet/room-config":_0x5ae298=this._syncConfig();
      break;
      case "@keet/room-capabilities":_0x5ae298=this._syncRoomCapabilities(_0x1a9b54);
      break;
      case "@keet/members":_0x5ae298=this._syncMember(_0x1a9b54);
      break;
      case"@keet/devices":_0x5ae298=this._syncDevice(_0x1a9b54);
      break;
      case "@keet/chat":_0x5ae298=this._syncMessage(_0x1a9b54);
      break;
      case "@keet/reaction-digests":_0x5ae298=this._syncReactions(_0x1a9b54);
      break;
      case"@keet/threads":_0x5ae298=this._syncStats(_0x1a9b54);
      break;
      case "@keet-private-id/identity":_0x5ae298=this._syncRoomIdentity(_0x1a9b54);
      break;
      case "@keet/join-requests":_0x5ae298=this._syncJoinRequests(_0x1a9b54);
      break;
      case"@keet-private-id/unreads":_0x5ae298=this._syncUnreadAnchors();
      break;
      case "@keet/read-lengths":_0x5ae298=this._syncReadLengths();
      break;
      default:continue;
    }
  _0x5ae298&&(_0x5ae298.catch(safetyCatch),_0x1d821f.push(_0x5ae298));
}
await Promise.all(_0x1d821f);
return!!this.roomInfo.digest;
}
async._fullRoomInfoLoad(){
  _0x5790d0={
    _0x29e1bb:0xf,_0x2be662:0xda,_0xbbc5dc:0x146},_0xa1858e={
    _0x39c4e1:0x44b,_0x388a5d:0xd7,_0x5e7840:0x44}
  ;
  this.events.push({'type':"v2:room-fast-forward"}),this.roomInfo={
    'roomKey':this.base.key,'discoveryKey':this.base.discoveryKey,'encryptionKey':this.base.encryptionKey,'digest':null,'stats':null,'fork':0x0,'length':0x0,'timestamps':{
      'creation':0x0,'latestActivity':0x0,'latestChatMessage':0x0},'status':null,'mailbox':null,'selfDevice':null,'selfMember':null,'config':null,'capabilities':null,'identity':null,'lastMessage':null,'lastMember':null,'lastMessageReactions':null,'dm':null}
  ;
  return await Promise.all([this._syncDigest(null),this._syncRoomCapabilities(null),this._syncDevice(null),this._syncMember(null),this._syncStats(null),this._syncRoomIdentity(null),this._syncUnreadAnchors(),this._syncConfig(),this._syncReadLengths(),this._syncLastMessage()]),!!this.roomInfo.digest;
}
async._loadPrivateProfileChanges(){
  _0x5d692e={
    _0x94b389:0x10a,_0xc17876:0xb7},_0x432c62={
    _0x5c6030:0x6f,_0x154277:0xe6,_0x133622:0x13c}
  ;
  let _0x19597f=null;
  if(this.isCurrentPrivateProfile&&this.roomInfo.selfDevice){
    const _0x503ddf=this.changes.get(KeetContract.DB_VIEW_NAME);
    this._loader.shared=this.currentRoomInfo?..selfDevice?_0x503ddf.shared:-0x2095,_0x19597f=await Promise.all([this._loader.loadContactChanges(),this._loader.loadSharedRoomChanges(),this._loader.loadPendingInvitations()]);
  }
if(!_0x19597f)return;
this.updates.contacts=_0x19597f[0x0];
this.updates.sharedRooms=_0x19597f[0x1],this.updates.pendingInvitations=_0x19597f[-0x17ae];
}
async._loadLocalInfo(){
  _0x17b456={
    _0x29c859:0x35e,_0x555035:0x3b},_0x19066a={
    _0x11002b:0x71,_0x2e952b:0x3},[_0x295107,_0x4b7de6,_0x1019eb]=await Promise.all([this._loader.loadLocalRoomInfo(),this._loader.loadLocalIdentityInfo(),this._loader.loadLocalPrivateProfileInfo()]);
  this.currentRoomInfo=_0x295107,this.roomInfo={
    ...this.currentRoomInfo}
  ;
  this.currentIdentityInfo=_0x4b7de6,this.currentPrivateProfileInfo=_0x1019eb;
  this.isCurrentPrivateProfile=!!_0x4b7de6&&b4a.equals(_0x4b7de6.privateProfileKey,this.base.key);
  const _0x4f72c8=this.currentIdentityInfo?..swapV2;
  if(!_0x4f72c8||!b4a.equals(_0x4f72c8.privateProfileKey,this.base.key))return!![];
  return this.updates.attemptIdentitySwap=_0x4f72c8,!![];
}
async._load(){
  _0x407185={
    _0x4a9051:0x1cb,_0x10094e:0x1a7,_0x5dae6c:0x142},_0x215457={
    _0x585647:0x157}
  ;
  let [_0x4f55f5,_0x537dc4]=await Promise.all([this._loadLocalInfo(),this.base.system.get(this.base.local.key)]);
  if(this.closing||!_0x4f55f5)return![];
  if(this.updates.attemptIdentitySwap){
    const _0x4a8187=this.updates.attemptIdentitySwap,_0x54adee=_0x4a8187.writerKey,[_0x370792,_0x548067,_0x55299c]=await Promise.all([this._loader.input.get("@keet-private-id/device-identities",{'deviceKey':_0x54adee}),this._loader.input.get("@keet/devices",{'key':_0x54adee}),this.local.get("@local/rooms",{'roomKey':this.base.key})]);
    if(!_0x370792||!_0x548067||!verifyIdentityProofs(_0x4a8187,_0x370792))return![];
    const _0x20c43e=_0x370792.deviceProof,_0x2769a2=generateIdentityPairingName(_0x4a8187.publicKey),_0x5692d8=await this.keet.store.createKeyPair(_0x2769a2);
    if(!b4a.equals(_0x5692d8.publicKey,_0x4a8187.devicePublicKey))return![];
    this.isCurrentPrivateProfile=!![],this.currentPrivateProfileInfo=_0x55299c,this.currentIdentityInfo=this.currentIdentityInfo.swapV2,this.updates.finishIdentitySwap={
      'publicKey':this.updates.attemptIdentitySwap.publicKey,'privateProfileKey':this.base.key,'deviceKeyPair':_0x5692d8,'deviceProof':_0x20c43e,'status':{
        'isConfirmed':!![]}
    }
  ;
}
this.currentWriterInfo=_0x537dc4;
let _0x24dfef=null;
if(this.changes&&this.currentRoomInfo){
  const _0x572af1=this.changes.get('_system');
  if(_0x572af1.to-_0x572af1.shared<INCREMENTAL_SYNC_LIMIT){
    const _0xb51d32=this.changes.get("keet/v3/db");
    _0x24dfef={
      'from':_0xb51d32.shared,'to':_0xb51d32.to}
    ;
  }
}
_0x4f55f5=![];
_0x24dfef?_0x4f55f5=await this._incrementalRoomInfoLoad(_0x24dfef.from,_0x24dfef.to):_0x4f55f5=await this._fullRoomInfoLoad();
if(!_0x4f55f5)return![];
this.events.push({'type':"v2:room-changed"}),this.roomInfo.length=this._loader.core.length,this.roomInfo.fork=this._loader.core.fork;
if(this.isCurrentPrivateProfile)await this._loadPrivateProfileChanges();
const _0x53217b=!!this.roomInfo.selfMember?..status.isRemoved,_0x22ba2c=!!this.roomInfo.selfMember?..status.isActive,_0x1459b7=!!this.roomInfo.selfDevice?..status.isActive;
const _0x228c93=_0x53217b||!_0x1459b7&&!!this.currentWriterInfo,_0x12eede=this.base.writable&&_0x1459b7&&_0x22ba2c,_0x425b03=!!this.roomInfo.identity;
return this.roomInfo.status={
  'isWritable':_0x12eede,'isReadable':!![],'isPrivateProfile':_0x425b03,'isRemoved':_0x228c93},this.roomInfo.timestamps.latestSync=Date.now(),this.roomInfo.timestamps.creation=this.roomInfo.digest.creationTime,this.roomInfo.lastMessage&&(this.roomInfo.timestamps.latestChatMessage=this.roomInfo.lastMessage.timestamp),!![];
}
._generateUpgrade(){
  _0x543feb={
    _0x439ee5:0x70,_0x825f5d:0x2ae},_0x56b10e={
    _0x47865a:0xf4,_0x35c277:0x112,_0xe6a1ba:0xbb}
  ;
  if(!this.roomInfo.selfMember.status.isModerator)return null;
  if(this.roomInfo.digest.abi.version>=this.keet.abi.autoupgrade)return null;
  return{
    'type':"@keet/upgrade",'op':{
      'version':this.keet.abi.autoupgrade}
  }
;
}
._generateMemberUpdate(){
  _0x5b71fd={
    _0xe72003:0x66,_0x292821:0xb9,_0x20256d:0x1c9},_0x449fdc={
    _0x4d20c5:0x352,_0x187151:0x91},_0x436626=this.currentPrivateProfileInfo.selfMember,_0x3dc4c9=this.roomInfo.selfMember;
  const _0x5205a8=_0x3dc4c9.profile.timestamp>--0x4a54,_0x533e51=_0x436626.profile.timestamp<=_0x3dc4c9.profile.timestamp;
  if(!_0x436626?..profile||_0x5205a8&&_0x533e51)return null;
  const _0x33bbda={
    'identity':this.currentIdentityInfo,'privateProfile':this.currentPrivateProfileInfo},_0x535e2d=this.keet.internalGetMemberUpdate(_0x33bbda);
  return{
    'type':"@keet/update-member",'op':{
      'member':_0x535e2d}
  }
;
}
._generatePrivateProfileDispatches(){
  _0x1c3026={
    _0x39ecea:0xa6,_0x160313:0x3f3,_0x15477c:0x1ef},_0x19f75e={
    _0x533705:0x154,_0x2b6d57:0x48b}
  ;
  this.updates.profileDispatches=[];
  this.updates.profileDispatches.push({'type':"@keet-private-id/update-room-status",'op':{'roomKey':this.roomInfo.roomKey,'key':RoomStatus.IsActive,'status':{'isActive':![]}}});
}
._generateDispatches(){
  _0x5bf626={
    _0x4fce47:0x2df,_0x11e05a:0x96},_0x1f8243={
    _0x11b3e9:0x254,_0x191ed1:0x85,_0x372840:0xde}
  ;
  this.updates.dispatches=[];
  const _0x140e48=this._generateUpgrade();
  if(_0x140e48)this.updates.dispatches.push(_0x140e48);
  if(!this.currentPrivateProfileInfo?..selfMember)return;
  const _0x14da62=this._generateMemberUpdate();
  if(_0x14da62)this.updates.dispatches.push(_0x14da62);
}
._generateTasks(){
  _0x214283={
    _0x459757:0xf4,_0x226a6d:0x195,_0xfb7e89:0x21},_0xaa57b1={
    _0x3d3095:0x151,_0x43a3a0:0x447}
  ;
  if(!this.updates.sharedRooms)return;
  this.updates.tasks=[],this.updates.sharedPreferences=[];
  for(const _0x56a560 of this.updates.sharedRooms){
    const _0x29a4d=_0x56a560.mailbox;
    if(_0x56a560.identitySwapV2){
      this.updates.startIdentitySwap={
        ..._0x56a560.identitySwapV2,'privateProfileKey':_0x56a560.roomKey},this.updates.tasks=[this.keet.tasks.joinRoomKeys(_0x29a4d,{'keys':_0x56a560})];
      break;
    }
  _0x56a560.status.isActive?this.updates.tasks.push(this.keet.tasks.joinRoomKeys(_0x29a4d,{'keys':_0x56a560})):this.updates.tasks.push(this.keet.tasks.leaveRoom(_0x29a4d,{'roomKey':_0x56a560.roomKey})),this.updates.sharedPreferences.push({'roomKey':_0x56a560.roomKey,'status':_0x56a560.status});
}
if(this.updates.startIdentitySwap)return;
if(this.updates.pendingInvitations)for(const _0x4a5f2e of this.updates.pendingInvitations){
  this.updates.tasks.push(this.keet.tasks.joinRoomInvitation(_0x4a5f2e.mailbox,{'invitation':_0x4a5f2e}));
}
}
async._maybeUpdateOpenRooms(_0x1e0184){
  _0x451ac1={
    _0x12dabd:0x3c8,_0x9571da:0x12c,_0x50d8fe:0x34},_0x2f200a={
    _0xbe7611:0x1ca,_0x1f0cc2:0x4b,_0x3fbd41:0x7c}
  ;
  try{
    const _0x55d851=this.currentRoomInfo?..selfMember?..profile.timestamp||0x0;
    if(!this.roomInfo?..selfMember||_0x55d851>=this.roomInfo.selfMember.profile.timestamp)return;
    const _0x4e14c0={
      'profile':this.roomInfo.selfMember.profile,'attestation':{
        'memberKey':this.roomInfo.selfMember.key,'proof':this.roomInfo.selfMember.proofs.profileAttestation}
    },_0x36fc5f=[];
  for(const _0x1ea468 of this.keet.rooms.values()){
    if(b4a.equals(_0x1ea468.key,_0x1e0184))continue;
    _0x36fc5f.push(_0x1ea468.dispatch("@keet/update-member",{'member':_0x4e14c0}));
  }
await Promise.allSettled(_0x36fc5f);
}catch(_0x42e478){
this.keet.onerror(_0x42e478);
}
}
async._run(){
  _0x1ea06f={
    _0x57e7e6:0x64b,_0x3e8f46:0x143,_0x5d792b:0x8f},_0x27a21d={
    _0x7a305d:0xf4,_0x1376dc:0x279,_0x45a723:0xbe}
  ;
  if(!this.opened)await this.ready();
  const _0x1ff8ea=await this._load();
  if(!_0x1ff8ea||this.closing)return![];
  this.roomInfo.status.isWritable&&this._generateDispatches();
  this.isCurrentPrivateProfile&&(!this.roomInfo.selfDevice?..status.isActive?this.changes.logout=!![]:(this._generateTasks(),this._maybeUpdateOpenRooms(this.base.key)));
  const _0x1fe0c1=this.roomInfo.selfMember,_0x315dfd=this.currentRoomInfo?..selfMember,_0xfe73fd=_0x1fe0c1?..status.isRemoved&&!_0x315dfd?..status.isRemoved;
  if(_0xfe73fd)this._generatePrivateProfileDispatches();
  return!![];
}
.run(){
  _0x4f92e7={
    _0x1231e5:0xf3,_0x3be324:0x140,_0x51ebed:0xd5},_0x279191={
    _0x409bd7:0x7d}
  ;
  if(this._running)return this._running;
  return this._running=this._run(),this._running.catch(safetyCatch),this._running;
}
}
;
function sameChatMessage(_0x154209,_0x35879e){
  _0x517074={
    _0xf86f4b:0x14,_0x43e2da:0x753,_0x157638:0x10a},_0xc35c36={
    _0x315125:0x61d,_0x56ae23:0x18d}
  ;
  return b4a.equals(_0x154209.oplog.key,_0x35879e.oplog.key)&&_0x154209.oplog.seq===_0x35879e.oplog.seq;
}