update and cleanup repo
This commit is contained in:
+13
-17
@@ -327,10 +327,10 @@ class Matrix(TablePluginMixin, Provider):
|
||||
self._init_reason: Optional[str] = None
|
||||
|
||||
matrix_conf = (
|
||||
self.config.get("provider",
|
||||
{}).get("matrix",
|
||||
{}) if isinstance(self.config,
|
||||
dict) else {}
|
||||
self.config.get("plugin",
|
||||
{}).get("matrix",
|
||||
{}) if isinstance(self.config,
|
||||
dict) else {}
|
||||
)
|
||||
homeserver = matrix_conf.get("homeserver")
|
||||
access_token = matrix_conf.get("access_token")
|
||||
@@ -362,16 +362,16 @@ class Matrix(TablePluginMixin, Provider):
|
||||
return False
|
||||
if self._init_ok is False:
|
||||
return False
|
||||
matrix_conf = self.config.get("provider",
|
||||
{}).get("matrix",
|
||||
{})
|
||||
matrix_conf = self.config.get("plugin",
|
||||
{}).get("matrix",
|
||||
{})
|
||||
return bool(
|
||||
matrix_conf.get("homeserver")
|
||||
and matrix_conf.get("access_token")
|
||||
)
|
||||
|
||||
def status_summary(self) -> Dict[str, Any]:
|
||||
matrix_conf = self.config.get("provider", {}).get("matrix", {}) if isinstance(self.config, dict) else {}
|
||||
matrix_conf = self.config.get("plugin", {}).get("matrix", {}) if isinstance(self.config, dict) else {}
|
||||
homeserver = str(matrix_conf.get("homeserver") or "").strip()
|
||||
room_id = str(matrix_conf.get("room_id") or "").strip()
|
||||
detail = homeserver
|
||||
@@ -439,7 +439,7 @@ class Matrix(TablePluginMixin, Provider):
|
||||
full_metadata={
|
||||
"room_id": room_id,
|
||||
"room_name": room_name,
|
||||
"provider": "matrix",
|
||||
"plugin": "matrix",
|
||||
# Selection metadata for table system and @N expansion
|
||||
"_selection_args": ["-room-id", room_id],
|
||||
},
|
||||
@@ -450,9 +450,9 @@ class Matrix(TablePluginMixin, Provider):
|
||||
|
||||
|
||||
def _get_homeserver_and_token(self) -> Tuple[str, str]:
|
||||
matrix_conf = self.config.get("provider",
|
||||
{}).get("matrix",
|
||||
{})
|
||||
matrix_conf = self.config.get("plugin",
|
||||
{}).get("matrix",
|
||||
{})
|
||||
homeserver = matrix_conf.get("homeserver")
|
||||
access_token = matrix_conf.get("access_token")
|
||||
if not homeserver:
|
||||
@@ -681,7 +681,7 @@ class Matrix(TablePluginMixin, Provider):
|
||||
)
|
||||
|
||||
def upload(self, file_path: str, **kwargs: Any) -> str:
|
||||
matrix_conf = self.config.get("provider",
|
||||
matrix_conf = self.config.get("plugin",
|
||||
{}).get("matrix",
|
||||
{})
|
||||
room_id = matrix_conf.get("room_id")
|
||||
@@ -877,7 +877,3 @@ try:
|
||||
except Exception:
|
||||
# best-effort registration
|
||||
pass
|
||||
|
||||
|
||||
# Backward-compatible alias: tests and callers may import `plugins.matrix.cmdnat`.
|
||||
from . import commands as cmdnat # noqa: E402
|
||||
|
||||
Reference in New Issue
Block a user