cache.mx raw

   1  package main
   2  
   3  import "smesh.lol/web/common/jsbridge/idb"
   4  
   5  // Cache: IDB event storage. No subscriptions, relays, or encryption.
   6  
   7  func cacheQuery(filterRaw string, cb func(string)) {
   8  	idb.QueryEvents(filterRaw, cb)
   9  }
  10  
  11  func cacheStore(evJSON string, cb func(bool)) {
  12  	idb.SaveEvent(evJSON, cb)
  13  }
  14  
  15  func cacheSaveDM(dmJSON string, cb func(string)) {
  16  	idb.SaveDM(dmJSON, cb)
  17  }
  18  
  19  func cacheGetConversationList(cb func(string)) {
  20  	idb.GetConversationList(cb)
  21  }
  22  
  23  func cacheQueryDMs(peer string, limit int, until int64, cb func(string)) {
  24  	idb.QueryDMs(peer, limit, until, cb)
  25  }
  26