synadm: fetch event API, media info API
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
from flask import Blueprint, jsonify, request, Response
|
||||
from vona.federation import send_join
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
import base64
|
||||
@@ -447,3 +448,38 @@ async def forward_extremities(room):
|
||||
"received_ts": config.the_funny_number
|
||||
}]
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/media/<origin>/<media_id>")
|
||||
async def media_info(origin, media_id):
|
||||
return jsonify({
|
||||
"media_info": {
|
||||
"media_origin": origin,
|
||||
"user_id": None,
|
||||
"media_id": media_id,
|
||||
"media_type": "img/jpeg",
|
||||
"media_length": 67,
|
||||
"upload_name": "cat.jpg",
|
||||
"created_ts": config.the_funny_number,
|
||||
"filesystem_id": os.urandom(3).hex(),
|
||||
"url_cache": None,
|
||||
"last_access_ts": config.the_funny_number,
|
||||
"quarantined_by": None,
|
||||
"authenticated": False,
|
||||
"safe_from_quarantine": None,
|
||||
"sha256": os.urandom(32).hex()
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/fetch_event/<evt>")
|
||||
async def fetch_event(evt):
|
||||
class bs:
|
||||
def get_json():
|
||||
return {}
|
||||
|
||||
return jsonify({
|
||||
"event": send_join(
|
||||
bs,
|
||||
globals.make_event_id(seed=evt).replace("$", "!")
|
||||
)["state"][5]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user