Procházet zdrojové kódy

deps/mautrix: ^0.10.5 -> ^0.11.2

Sumner Evans před 3 roky
rodič
revize
1d6ff7a278

+ 8 - 4
mautrix_instagram/__main__.py

@@ -61,8 +61,8 @@ class InstagramBridge(Bridge):
         self.state_store = PgBridgeStateStore(self.db, self.get_puppet, self.get_double_puppet)
 
     def prepare_db(self) -> None:
-        self.db = Database(self.config["appservice.database"], upgrade_table=upgrade_table,
-                           loop=self.loop, db_args=self.config["appservice.database_opts"])
+        self.db = Database.create(self.config["appservice.database"], upgrade_table=upgrade_table,
+                                  db_args=self.config["appservice.database_opts"])
         init_db(self.db)
 
     def prepare_bridge(self) -> None:
@@ -74,9 +74,9 @@ class InstagramBridge(Bridge):
 
     async def start(self) -> None:
         await self.db.start()
-        await self.state_store.upgrade_table.upgrade(self.db.pool)
+        await self.state_store.upgrade_table.upgrade(self.db)
         if self.matrix.e2ee:
-            self.matrix.e2ee.crypto_db.override_pool(self.db.pool)
+            self.matrix.e2ee.crypto_db.override_pool(self.db)
         self.add_startup_actions(User.init_cls(self))
         self.add_startup_actions(Puppet.init_cls(self))
         Portal.init_cls(self)
@@ -92,6 +92,10 @@ class InstagramBridge(Bridge):
         for puppet in Puppet.by_custom_mxid.values():
             puppet.stop()
 
+    async def stop(self) -> None:
+        await super().stop()
+        await self.db.stop()
+
     async def resend_bridge_info(self) -> None:
         self.config["bridge.resend_bridge_info"] = False
         self.config.save()

+ 3 - 1
mautrix_instagram/example-config.yaml

@@ -11,9 +11,11 @@ homeserver:
     # Number of retries for all HTTP requests if the homeserver isn't reachable.
     http_retry_count: 4
     # The URL to push real-time bridge status to.
-    # If set, the bridge will make POST requests to this URL whenever a user's Facebook MQTT connection state changes.
+    # If set, the bridge will make POST requests to this URL whenever a user's Instagram MQTT connection state changes.
     # The bridge will use the appservice as_token to authorize requests.
     status_endpoint: null
+    # Endpoint for reporting per-message status.
+    message_send_checkpoint_endpoint: null
 
 # Application service host/registration related details
 # Changing these values requires regeneration of the registration.

+ 1 - 1
requirements.txt

@@ -4,7 +4,7 @@ commonmark>=0.8,<0.10
 aiohttp>=3,<4
 yarl>=1,<2
 attrs>=20.1
-mautrix>=0.10.5,<0.11
+mautrix>=0.11.2,<0.12
 asyncpg>=0.20,<0.25
 pycryptodome>=3,<4
 paho-mqtt>=1.5,<2