huge refactor of the entire codebase, with the goal of improving maintainability, readability, and extensibility. This commit includes changes to almost every file in the project, including:
This commit is contained in:
+18
-3
@@ -294,7 +294,7 @@ class Matrix(TableProviderMixin, Provider):
|
||||
- MIME detection: Automatic content type classification for Matrix msgtype
|
||||
|
||||
SELECTION FLOW:
|
||||
1. User runs: search-file -provider matrix "room" (or .matrix -list-rooms)
|
||||
1. User runs: search-file -plugin matrix "room" (or .matrix -list-rooms)
|
||||
2. Results show available joined rooms
|
||||
3. User selects rooms: @1 @2 (or @1,2)
|
||||
4. Selection triggers upload of pending files to selected rooms
|
||||
@@ -368,6 +368,21 @@ class Matrix(TableProviderMixin, Provider):
|
||||
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 {}
|
||||
homeserver = str(matrix_conf.get("homeserver") or "").strip()
|
||||
room_id = str(matrix_conf.get("room_id") or "").strip()
|
||||
detail = homeserver
|
||||
if room_id:
|
||||
detail = (detail + (" " if detail else "")) + f"room:{room_id}"
|
||||
enabled = bool(self.validate())
|
||||
return {
|
||||
"status": "ENABLED" if enabled else "DISABLED",
|
||||
"name": self.label,
|
||||
"plugin": self.name,
|
||||
"detail": detail or ("Connected" if enabled else "Not configured"),
|
||||
}
|
||||
|
||||
def search(
|
||||
self,
|
||||
query: str,
|
||||
@@ -767,7 +782,7 @@ class Matrix(TableProviderMixin, Provider):
|
||||
|
||||
# Minimal provider registration for the new table system
|
||||
try:
|
||||
from SYS.result_table_adapters import register_provider
|
||||
from SYS.result_table_adapters import register_plugin
|
||||
from SYS.result_table_api import ResultModel, ColumnSpec, metadata_column, title_column
|
||||
|
||||
def _convert_search_result_to_model(sr: Any) -> ResultModel:
|
||||
@@ -850,7 +865,7 @@ try:
|
||||
|
||||
return ["-title", row.title or ""]
|
||||
|
||||
register_provider(
|
||||
register_plugin(
|
||||
"matrix",
|
||||
_adapter,
|
||||
columns=_columns_factory,
|
||||
|
||||
Reference in New Issue
Block a user