Split custom endpoints into multiple files
This commit is contained in:
@@ -1,9 +1,4 @@
|
||||
from flask import Blueprint, jsonify, request, Response
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
import base64
|
||||
import re
|
||||
import os
|
||||
from flask import Blueprint
|
||||
|
||||
custom = Blueprint("custom", __name__)
|
||||
|
||||
@@ -12,453 +7,11 @@ custom = Blueprint("custom", __name__)
|
||||
# implementations. They do not start
|
||||
# with /_matrix/
|
||||
|
||||
# This should be split into more
|
||||
# files eventually.
|
||||
|
||||
from .conduwuit import conduwuit
|
||||
from .dendrite import dendrite
|
||||
from .synapse import synapse
|
||||
|
||||
@custom.route("/_synapse/admin/v1/suspend/<user_id>", methods=["PUT"])
|
||||
@custom.route("/_synapse/admin/v1/deactivate/<user_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/reset_password/<user_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/admin", methods=["PUT"])
|
||||
@custom.route("/_synapse/admin/v2/users/<user_id>/delete_devices", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/shadow_ban", methods=["DELETE", "POST"])
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/override_ratelimit", methods=["GET", "POST", "DELETE"])
|
||||
@custom.route("/_synapse/admin/v1/media/protect/<media_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/media/unprotect/<media_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/media/quarantine/<s>/<media_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/media/unquarantine/<s>/<media_id>", methods=["POST"])
|
||||
@custom.route("/_dendrite/admin/purgeRoom/<roomId>", methods=["POST"])
|
||||
@custom.route("/_dendrite/admin/refreshDevices/<userId>", methods=["POST"])
|
||||
@custom.route("/_dendrite/admin/fulltext/reindex")
|
||||
@custom.route("/_synapse/admin/v1/federation/destinations/<destination>/reset_connection", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room>")
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>/timestamp_to_event")
|
||||
@custom.route("/_synapse/admin/v2/rooms/delete_status/<delete_id>")
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin", methods=["POST"])
|
||||
async def empty_response(**kwargs):
|
||||
return jsonify({})
|
||||
|
||||
|
||||
# Synapse
|
||||
@custom.route("/_synapse/admin/v1/server_version")
|
||||
async def synapse_version():
|
||||
return jsonify({"server_version": globals.version})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/users")
|
||||
async def synapse_user_list():
|
||||
return jsonify({
|
||||
"users": [
|
||||
{
|
||||
"name": f"@vona:{config.server_name}",
|
||||
"is_guest": 0,
|
||||
"admin": 0,
|
||||
"user_type": "vona",
|
||||
"deactivated": 0,
|
||||
"erased": False,
|
||||
"shadow_banned": 0,
|
||||
"displayname": "Vona",
|
||||
"avatar_url": f"mxc://{config.server_name}/cat",
|
||||
"creation_ts": config.the_funny_number,
|
||||
"locked": False
|
||||
}
|
||||
],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/users/<user_id>", methods=["GET", "PUT"])
|
||||
async def synapse_user_info(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"name": f"@vona:{config.server_name}",
|
||||
"displayname": "Vona",
|
||||
"threepids": [],
|
||||
"avatar_url": f"mxc://{config.server_name}/cat",
|
||||
"is_guest": 0,
|
||||
"admin": 0,
|
||||
"deactivated": 0,
|
||||
"erased": False,
|
||||
"shadow_banned": 0,
|
||||
"creation_ts": config.the_funny_number,
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"appservice_id": config.the_funny_number,
|
||||
"consent_server_notice_sent":config.the_funny_number,
|
||||
"consent_version": config.the_funny_number,
|
||||
"consent_ts": config.the_funny_number,
|
||||
"external_ids": [],
|
||||
"user_type": "vona",
|
||||
"locked": False,
|
||||
"suspended": False
|
||||
})
|
||||
|
||||
return jsonify({}), 201
|
||||
|
||||
@custom.route("/_synapse/admin/v1/whois/<user_id>")
|
||||
async def synapse_whois(user_id):
|
||||
return jsonify({
|
||||
"user_id": f"@vona:{config.server_name}",
|
||||
"devices": {
|
||||
"": {
|
||||
"sessions": [{
|
||||
"connections": [{
|
||||
"ip":f"127.0.0.1",
|
||||
"last_seen":config.the_funny_number,
|
||||
"user_agent":f"Vona/{globals.version}"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/joined_rooms")
|
||||
async def synapse_user_joined_rooms(user_id):
|
||||
return jsonify({
|
||||
"joined_rooms": [globals.make_event_id().replace("$", "!")],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/sent_invite_count")
|
||||
async def synapse_invite_count(user_id):
|
||||
return jsonify({"invite_count": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/accountdata")
|
||||
async def synapse_account_data(user_id):
|
||||
return jsonify({"account_data":{"global":{}}})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/media", methods=["GET", "DELETE"])
|
||||
async def synapse_account_media(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({"media": [{"created_ts":config.the_funny_number,"last_access_ts":config.the_funny_number,"media_id":"cat","media_length":config.the_funny_number,"media_type":"image/jpeg","quarantined_by":"null","safe_from_quarantine":False,"upload_name":"cat.jpg"}], "total": config.the_funny_number})
|
||||
|
||||
return jsonify({"deleted_media": ["cat"], "total": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/login", methods=["POST"])
|
||||
async def synapse_account_login(user_id):
|
||||
return jsonify({"access_token": "vona"})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/_allow_cross_signing_replacement_without_uia", methods=["POST"])
|
||||
async def synapse_stupid_mas_bullshit(user_id):
|
||||
return jsonify({"updatable_without_uia_before_ms": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/users/<user_id>/devices", methods=["GET", "POST"])
|
||||
async def synapse_device_list(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"devices": [{
|
||||
"device_id": "VVOONNAA",
|
||||
"display_name": "Vona",
|
||||
"last_seen_ip": "127.0.0.1",
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"last_seen_user_agent": f"Vona/{globals.version}"
|
||||
}],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/users/<user_id>/devices/<device_id>", methods=["GET", "PUT", "DELETE"])
|
||||
async def synapse_device_info(user_id, device_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"device_id": "VVOONNAA",
|
||||
"display_name": "Vona",
|
||||
"last_seen_ip": "127.0.0.1",
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"last_seen_user_agent": f"Vona/{globals.version}"
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/users/<user_id>/pushers")
|
||||
async def synapse_pushers(user_id):
|
||||
return jsonify({"pushers": [], "total": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/username_available")
|
||||
async def synapse_username_available():
|
||||
return jsonify({"available": True})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/threepid/<medium>/users/<addr>")
|
||||
@custom.route("/_synapse/admin/v1/auth_providers/<provider>/users/<ext>")
|
||||
async def synapse_threepid(p, a):
|
||||
return jsonify({"user_id": f"@vona:{config.server_name}"})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/<user_id>/redact")
|
||||
def synapse_redact(user_id):
|
||||
return jsonify({"redact_id": os.urandom(16).hex()})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/user/redact_status/<redact_id>")
|
||||
async def synapse_redact_status(redact_id):
|
||||
return jsonify({"status":"active","failed_redactions":[]})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/experimental_features/<user_id>", methods=["GET", "PUT"])
|
||||
async def synapse_experimental_features(user_id):
|
||||
return jsonify({"features": {}})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/register", methods=["GET", "POST"])
|
||||
async def synapse_register():
|
||||
if request.method == "GET":
|
||||
return jsonify({"nonce": os.urandom(16).hex()})
|
||||
|
||||
return jsonify({"access_token": "vona"})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/join/<roomId>", methods=["POST"])
|
||||
async def synapse_membership_manipulation(roomId):
|
||||
return jsonify({"room_id": globals.make_event_id().replace("$", "!")})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/account_validity/validity", methods=["POST"])
|
||||
async def synapse_account_validity():
|
||||
return jsonify({"expiration_ts": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/send_server_notice", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/send_server_notice/<txnId>", methods=["PUT"])
|
||||
async def synapse_server_notice(**kwargs):
|
||||
return jsonify({"event_id": globals.make_event_id()})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/purge_history/<room_id>/<event_id>", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/purge_history/<room_id>", methods=["POST"])
|
||||
async def synapse_purge_event(**kwargs):
|
||||
return jsonify({"purge_id": os.urandom(16).hex()})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/purge_history_status/<purge_id>")
|
||||
async def synapse_purge_status(purge_id):
|
||||
return jsonify({"status":"active"})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/room/<room_id>/media")
|
||||
async def synapse_room_media(room_id):
|
||||
return jsonify({"local": [f"mxc://{config.server_name}/cat"], "remote": []})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/room/<room_id>/media/quarantine", methods=["POST"])
|
||||
async def synapse_quarantine_room_media(room_id):
|
||||
return jsonify({"num_quarantined": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/media/<s>/delete", methods=["POST"])
|
||||
@custom.route("/_synapse/admin/v1/media/<s>/<media_id>", methods=["DELETE"])
|
||||
@custom.route("/_synapse/admin/v1/media/delete", methods=["POST"])
|
||||
async def synapse_delete_media_from_server(**kwargs):
|
||||
return jsonify({"deleted_media": ["cat"], "total": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/purge_media_cache", methods=["POST"])
|
||||
async def synapse_delete_remote_media():
|
||||
return jsonify({"deleted": config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/statistics/users/media")
|
||||
async def synapse_media_stats():
|
||||
return jsonify({"users":[{"displayname":"Vona","media_count":config.the_funny_number,"media_length":config.the_funny_number,"user_id":f"@vona:{config.server_name}"}],"total":config.the_funny_number})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/statistics/database/rooms")
|
||||
async def synapse_room_stats():
|
||||
return jsonify({
|
||||
"rooms": [{
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"estimated_size": config.the_funny_number * 420
|
||||
}]
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/background_updates/enabled", methods=["POST", "GET"])
|
||||
@custom.route("/_synapse/admin/v1/background_updates/status")
|
||||
async def synapse_change_bg_update():
|
||||
return jsonify({"enabled":False})
|
||||
|
||||
# No documentation on what Synapse actually returns for this API, so a blank dict for now
|
||||
@custom.route("/_synapse/admin/v1/background_updates/start_job", methods=["POST"])
|
||||
async def synapse_bg_update_start_job():
|
||||
return jsonify({})
|
||||
|
||||
|
||||
@custom.route("/_synapse/admin/v1/event_reports")
|
||||
async def synapse_event_reports():
|
||||
return jsonify({
|
||||
"event_reports": [{
|
||||
"event_id": globals.make_event_id(),
|
||||
"id": config.the_funny_number,
|
||||
"reason": "",
|
||||
"score": config.the_funny_number,
|
||||
"received_ts": config.the_funny_number,
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"name": "Vona",
|
||||
"sender": f"@vona:{config.server_name}",
|
||||
"user_id": f"@vona:{config.server_name}"
|
||||
}],
|
||||
"total": config.the_funny_number
|
||||
})
|
||||
|
||||
|
||||
@custom.route("/_synapse/admin/v1/event_reports/<report_id>", methods=["GET", "DELETE"])
|
||||
async def synapse_interact_with_reported_event(report_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"event_id": globals.make_event_id(),
|
||||
"event_json": globals.hash_and_sign_event({
|
||||
"auth_events": [],
|
||||
"content": {
|
||||
"msgtype": "m.text",
|
||||
"body": "Number 15: Burger King Foot Lettuce.\nThe last thing you'd want in your Burger King burger is someones foot fungus, but as it turns out, that might be what you get. A 4channer uploaded a photo, anonymously to the site showcasing his feet in a plastic bin of lettuce with the statement \"This is the lettuce you eat at Burger King.\". Admittedly, he had shoes on, but thats even worse. The post went live at 11:38 PM on July 16 and a mere 20 minutes later the Burger King in question was alerted to the rogue employee. At least, I hope hes rogue. How did it happen? Well, the BK employee hadn't removed the EXIF data from the uploaded photo, which suggested that the culprit was somewhere in Mayfield Heights, Ohio. This was at 11:47. 3 minutes later, at 11:50, the Burger King branch was posted with wishes of happy unemployment. 5 minutes later, the news station was contacted by another 4channer, and 3 minutes later at 11:58 a link was posted: BK's tell us about us online forum. The foot photo, otherwise known as Exhibit A, was attached. Cleveland Seen Magazine contacted the BK in question and the next day when questioned, the breakfast shift manager said \"Oh, I know who that is, hes getting fired\". Mystery solved, by 4chan. Now we can go back to eating our fast food in peace.",
|
||||
"format": "org.matrix.custom.html",
|
||||
"formatted_body": "Number 15: Burger King Foot Lettuce.<br />The last thing you'd want in your Burger King burger is someones foot fungus, but as it turns out, that might be what you get. A 4channer uploaded a photo, anonymously to the site showcasing his feet in a plastic bin of lettuce with the statement "This is the lettuce you eat at Burger King.". Admittedly, he had shoes on, but thats even worse. The post went live at 11:38 PM on July 16 and a mere 20 minutes later the Burger King in question was alerted to the rogue employee. At least, I hope hes rogue. How did it happen? Well, the BK employee hadn't removed the EXIF data from the uploaded photo, which suggested that the culprit was somewhere in Mayfield Heights, Ohio. This was at 11:47. 3 minutes later, at 11:50, the Burger King branch was posted with wishes of happy unemployment. 5 minutes later, the news station was contacted by another 4channer, and 3 minutes later at 11:58 a link was posted: BK's tell us about us online forum. The foot photo, otherwise known as Exhibit A, was attached. Cleveland Seen Magazine contacted the BK in question and the next day when questioned, the breakfast shift manager said "Oh, I know who that is, hes getting fired". Mystery solved, by 4chan. Now we can go back to eating our fast food in peace."
|
||||
},
|
||||
"depth": config.the_funny_number,
|
||||
"origin": config.server_name,
|
||||
"origin_server_ts": config.the_funny_number,
|
||||
"prev_events": [globals.make_event_id()],
|
||||
"prev_state": [],
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"sender": f"@vona:{config.server_name}",
|
||||
"type": "m.room.message"
|
||||
})
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/federation/destinations")
|
||||
async def synapse_federation_destinations():
|
||||
return jsonify({
|
||||
"destinations": [{}],
|
||||
"total": 0
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/federation/destinations/<destination>")
|
||||
async def synapse_destination(destination):
|
||||
return jsonify({
|
||||
"destination": destination,
|
||||
"retry_last_ts": config.the_funny_number,
|
||||
"retry_interval": config.the_funny_number,
|
||||
"failure_ts": config.the_funny_number,
|
||||
"last_successful_stream_ordering": None
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/federation/destinations/<destination>/rooms")
|
||||
async def synapse_destination_rooms(destination):
|
||||
return jsonify({
|
||||
"rooms": [],
|
||||
"total": 0
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/registration_tokens")
|
||||
async def synapse_reg_tokens():
|
||||
return jsonify({
|
||||
"registration_tokens": [{
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
}]
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/registration_tokens/<token>", methods=["GET", "PUT", "DELETE"])
|
||||
async def synapse_reg_token(token):
|
||||
if request.method == "DELETE":
|
||||
return jsonify({})
|
||||
|
||||
return jsonify({
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/registration_tokens/new", methods=["POST"])
|
||||
async def synapse_new_reg_token():
|
||||
return jsonify({
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms")
|
||||
async def synapse_rooms():
|
||||
return jsonify({
|
||||
"rooms": [],
|
||||
"offset": 0,
|
||||
"total_rooms": 0
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>/members")
|
||||
async def synapse_room_members(room):
|
||||
return jsonify({
|
||||
"members": [
|
||||
f"@vona:{config.server_name}"
|
||||
],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>/state")
|
||||
async def synapse_room_state(room):
|
||||
return jsonify({"state": []})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>/state")
|
||||
async def synapse_room_messages(room):
|
||||
return jsonify({
|
||||
"chunk": [],
|
||||
"end": "vona",
|
||||
"start": "vona"
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>/block", methods=["GET", "PUT"])
|
||||
async def synapse_block_room(room):
|
||||
return jsonify({"block": False})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id>", methods=["DELETE"])
|
||||
async def synapse_room_delete(room):
|
||||
return jsonify({
|
||||
"kicked_users": [
|
||||
f"@vona:{config.server_name}"
|
||||
],
|
||||
"failed_to_kick_users": [],
|
||||
"local_aliases": [],
|
||||
"new_room_id": f"!vona:{config.server_name}"
|
||||
})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/rooms/<room_id>", methods=["DELETE"])
|
||||
async def synapse_room_delete_v2(room):
|
||||
return jsonify({"delete_id": "vona"})
|
||||
|
||||
@custom.route("/_synapse/admin/v2/rooms/<room_id>/delete_status")
|
||||
async def synapse_room_delete_status(room):
|
||||
return jsonify({"results": []})
|
||||
|
||||
@custom.route("/_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities", methods=["GET"])
|
||||
async def synapse_forward_extremities(room):
|
||||
if request.method == "DELETE":
|
||||
return jsonify({"deleted": 0})
|
||||
|
||||
return jsonify({
|
||||
"count": 1,
|
||||
"results": [{
|
||||
"event_id": globals.make_event_id(),
|
||||
"state_group": config.the_funny_number,
|
||||
"depth": config.the_funny_number,
|
||||
"received_ts": config.the_funny_number
|
||||
}]
|
||||
})
|
||||
|
||||
# Dendrite - https://element-hq.github.io/dendrite/administration/adminapi
|
||||
@custom.route("/_dendrite/admin/evacuateUser/<userId>", methods=["POST"])
|
||||
async def dendrite_evacuate_user(userId):
|
||||
return jsonify({"affected": [globals.make_event_id().replace("$", "!")]})
|
||||
|
||||
@custom.route("/_dendrite/admin/evacuateRoom/<roomId>", methods=["POST"])
|
||||
async def dendrite_evacuate_room(roomId):
|
||||
return jsonify({"affected": [f"@vona:{config.server_name}"]})
|
||||
|
||||
@custom.route("/_dendrite/admin/resetPassword/<userId>", methods=["POST"])
|
||||
async def dendrite_reset_pswd(userId):
|
||||
return jsonify({"password_updated": True})
|
||||
|
||||
# Conduwuit/Tuwunel/Continuwuity
|
||||
@custom.route("/_continuwuity/local_user_count")
|
||||
@custom.route("/_conduwuit/local_user_count")
|
||||
@custom.route("/_tuwunel/local_user_count")
|
||||
async def conduwuit_user_count():
|
||||
return jsonify({"count": 1})
|
||||
|
||||
@custom.route("/_continuwuity/server_version")
|
||||
@custom.route("/_conduwuit/server_version")
|
||||
@custom.route("/_tuwunel/server_version")
|
||||
async def conduwuit_server_version():
|
||||
return jsonify({
|
||||
"name": "Vona",
|
||||
"version":globals.version
|
||||
})
|
||||
custom.register_blueprint(conduwuit)
|
||||
custom.register_blueprint(dendrite)
|
||||
custom.register_blueprint(synapse)
|
||||
|
||||
25
vona/custom/conduwuit.py
Normal file
25
vona/custom/conduwuit.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from flask import Blueprint, jsonify
|
||||
import vona.globals as globals
|
||||
|
||||
conduwuit = Blueprint("conduwuit", __name__)
|
||||
|
||||
# Endpoints used by Conduwuit and forks.
|
||||
|
||||
|
||||
@conduwuit.route("/_continuwuity/local_user_count")
|
||||
@conduwuit.route("/_conduwuit/local_user_count")
|
||||
@conduwuit.route("/_tuwunel/local_user_count")
|
||||
async def user_count():
|
||||
return jsonify({
|
||||
"count": 1
|
||||
})
|
||||
|
||||
|
||||
@conduwuit.route("/_continuwuity/server_version")
|
||||
@conduwuit.route("/_conduwuit/server_version")
|
||||
@conduwuit.route("/_tuwunel/server_version")
|
||||
async def server_version():
|
||||
return jsonify({
|
||||
"name": "Vona",
|
||||
"version": globals.version
|
||||
})
|
||||
37
vona/custom/dendrite.py
Normal file
37
vona/custom/dendrite.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from flask import Blueprint, jsonify
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
|
||||
dendrite = Blueprint("dendrite", __name__)
|
||||
|
||||
# https://element-hq.github.io/dendrite/administration/adminapi
|
||||
|
||||
|
||||
@dendrite.route("/_dendrite/admin/purgeRoom/<room>", methods=["POST"])
|
||||
@dendrite.route("/_dendrite/admin/refreshDevices/<user>", methods=["POST"])
|
||||
@dendrite.route("/_dendrite/admin/fulltext/reindex")
|
||||
async def empty(**kwargs):
|
||||
return jsonify({})
|
||||
|
||||
|
||||
@dendrite.route("/_dendrite/admin/evacuateUser/<user>", methods=["POST"])
|
||||
async def evacuate_user(user):
|
||||
return jsonify({
|
||||
"affected": [
|
||||
globals.make_event_id().replace("$", "!")
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
@dendrite.route("/_dendrite/admin/evacuateRoom/<room>", methods=["POST"])
|
||||
async def evacuate_room(room):
|
||||
return jsonify({
|
||||
"affected": [
|
||||
f"@vona:{config.server_name}"
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
@dendrite.route("/_dendrite/admin/resetPassword/<user>", methods=["POST"])
|
||||
async def reset_password(user):
|
||||
return jsonify({"password_updated": True})
|
||||
426
vona/custom/synapse.py
Normal file
426
vona/custom/synapse.py
Normal file
@@ -0,0 +1,426 @@
|
||||
from flask import Blueprint, jsonify, request, Response
|
||||
import vona.globals as globals
|
||||
import vona.config as config
|
||||
import base64
|
||||
import re
|
||||
import os
|
||||
|
||||
synapse = Blueprint("synapse", __name__)
|
||||
|
||||
# The absolute giant known as the Synapse admin API.
|
||||
# Very messy, needs cleaning
|
||||
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/suspend/<user_id>", methods=["PUT"])
|
||||
@synapse.route("/_synapse/admin/v1/deactivate/<user_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/reset_password/<user_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/admin", methods=["PUT"])
|
||||
@synapse.route("/_synapse/admin/v2/users/<user_id>/delete_devices", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/shadow_ban", methods=["DELETE", "POST"])
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/override_ratelimit", methods=["GET", "POST", "DELETE"])
|
||||
@synapse.route("/_synapse/admin/v1/media/protect/<media_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/media/unprotect/<media_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/media/quarantine/<s>/<media_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/media/unquarantine/<s>/<media_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/federation/destinations/<destination>/reset_connection", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room>")
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>/timestamp_to_event")
|
||||
@synapse.route("/_synapse/admin/v2/rooms/delete_status/<delete_id>")
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id_or_alias>/make_room_admin", methods=["POST"])
|
||||
async def response(**kwargs):
|
||||
return jsonify({})
|
||||
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/server_version")
|
||||
async def version():
|
||||
return jsonify({"server_version": globals.version})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/users")
|
||||
async def user_list():
|
||||
return jsonify({
|
||||
"users": [
|
||||
{
|
||||
"name": f"@vona:{config.server_name}",
|
||||
"is_guest": 0,
|
||||
"admin": 0,
|
||||
"user_type": "vona",
|
||||
"deactivated": 0,
|
||||
"erased": False,
|
||||
"shadow_banned": 0,
|
||||
"displayname": "Vona",
|
||||
"avatar_url": f"mxc://{config.server_name}/cat",
|
||||
"creation_ts": config.the_funny_number,
|
||||
"locked": False
|
||||
}
|
||||
],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/users/<user_id>", methods=["GET", "PUT"])
|
||||
async def user_info(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"name": f"@vona:{config.server_name}",
|
||||
"displayname": "Vona",
|
||||
"threepids": [],
|
||||
"avatar_url": f"mxc://{config.server_name}/cat",
|
||||
"is_guest": 0,
|
||||
"admin": 0,
|
||||
"deactivated": 0,
|
||||
"erased": False,
|
||||
"shadow_banned": 0,
|
||||
"creation_ts": config.the_funny_number,
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"appservice_id": config.the_funny_number,
|
||||
"consent_server_notice_sent":config.the_funny_number,
|
||||
"consent_version": config.the_funny_number,
|
||||
"consent_ts": config.the_funny_number,
|
||||
"external_ids": [],
|
||||
"user_type": "vona",
|
||||
"locked": False,
|
||||
"suspended": False
|
||||
})
|
||||
|
||||
return jsonify({}), 201
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/whois/<user_id>")
|
||||
async def whois(user_id):
|
||||
return jsonify({
|
||||
"user_id": f"@vona:{config.server_name}",
|
||||
"devices": {
|
||||
"": {
|
||||
"sessions": [{
|
||||
"connections": [{
|
||||
"ip":f"127.0.0.1",
|
||||
"last_seen":config.the_funny_number,
|
||||
"user_agent":f"Vona/{globals.version}"
|
||||
}]
|
||||
}]
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/joined_rooms")
|
||||
async def user_joined_rooms(user_id):
|
||||
return jsonify({
|
||||
"joined_rooms": [globals.make_event_id().replace("$", "!")],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/sent_invite_count")
|
||||
async def invite_count(user_id):
|
||||
return jsonify({"invite_count": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/accountdata")
|
||||
async def account_data(user_id):
|
||||
return jsonify({"account_data":{"global":{}}})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/media", methods=["GET", "DELETE"])
|
||||
async def account_media(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({"media": [{"created_ts":config.the_funny_number,"last_access_ts":config.the_funny_number,"media_id":"cat","media_length":config.the_funny_number,"media_type":"image/jpeg","quarantined_by":"null","safe_from_quarantine":False,"upload_name":"cat.jpg"}], "total": config.the_funny_number})
|
||||
|
||||
return jsonify({"deleted_media": ["cat"], "total": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/login", methods=["POST"])
|
||||
async def account_login(user_id):
|
||||
return jsonify({"access_token": "vona"})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/_allow_cross_signing_replacement_without_uia", methods=["POST"])
|
||||
async def stupid_mas_bullshit(user_id):
|
||||
return jsonify({"updatable_without_uia_before_ms": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/users/<user_id>/devices", methods=["GET", "POST"])
|
||||
async def device_list(user_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"devices": [{
|
||||
"device_id": "VVOONNAA",
|
||||
"display_name": "Vona",
|
||||
"last_seen_ip": "127.0.0.1",
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"last_seen_user_agent": f"Vona/{globals.version}"
|
||||
}],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/users/<user_id>/devices/<device_id>", methods=["GET", "PUT", "DELETE"])
|
||||
async def device_info(user_id, device_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"device_id": "VVOONNAA",
|
||||
"display_name": "Vona",
|
||||
"last_seen_ip": "127.0.0.1",
|
||||
"last_seen_ts": config.the_funny_number,
|
||||
"last_seen_user_agent": f"Vona/{globals.version}"
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/users/<user_id>/pushers")
|
||||
async def pushers(user_id):
|
||||
return jsonify({"pushers": [], "total": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/username_available")
|
||||
async def username_available():
|
||||
return jsonify({"available": True})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/threepid/<medium>/users/<addr>")
|
||||
@synapse.route("/_synapse/admin/v1/auth_providers/<provider>/users/<ext>")
|
||||
async def threepid(p, a):
|
||||
return jsonify({"user_id": f"@vona:{config.server_name}"})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/<user_id>/redact")
|
||||
def redact(user_id):
|
||||
return jsonify({"redact_id": os.urandom(16).hex()})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/user/redact_status/<redact_id>")
|
||||
async def redact_status(redact_id):
|
||||
return jsonify({"status":"active","failed_redactions":[]})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/experimental_features/<user_id>", methods=["GET", "PUT"])
|
||||
async def experimental_features(user_id):
|
||||
return jsonify({"features": {}})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/register", methods=["GET", "POST"])
|
||||
async def register():
|
||||
if request.method == "GET":
|
||||
return jsonify({"nonce": os.urandom(16).hex()})
|
||||
|
||||
return jsonify({"access_token": "vona"})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/join/<roomId>", methods=["POST"])
|
||||
async def membership_manipulation(roomId):
|
||||
return jsonify({"room_id": globals.make_event_id().replace("$", "!")})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/account_validity/validity", methods=["POST"])
|
||||
async def account_validity():
|
||||
return jsonify({"expiration_ts": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/send_server_notice", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/send_server_notice/<txnId>", methods=["PUT"])
|
||||
async def server_notice(**kwargs):
|
||||
return jsonify({"event_id": globals.make_event_id()})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/purge_history/<room_id>/<event_id>", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/purge_history/<room_id>", methods=["POST"])
|
||||
async def purge_event(**kwargs):
|
||||
return jsonify({"purge_id": os.urandom(16).hex()})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/purge_history_status/<purge_id>")
|
||||
async def purge_status(purge_id):
|
||||
return jsonify({"status":"active"})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/room/<room_id>/media")
|
||||
async def room_media(room_id):
|
||||
return jsonify({"local": [f"mxc://{config.server_name}/cat"], "remote": []})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/room/<room_id>/media/quarantine", methods=["POST"])
|
||||
async def quarantine_room_media(room_id):
|
||||
return jsonify({"num_quarantined": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/media/<s>/delete", methods=["POST"])
|
||||
@synapse.route("/_synapse/admin/v1/media/<s>/<media_id>", methods=["DELETE"])
|
||||
@synapse.route("/_synapse/admin/v1/media/delete", methods=["POST"])
|
||||
async def delete_media_from_server(**kwargs):
|
||||
return jsonify({"deleted_media": ["cat"], "total": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/purge_media_cache", methods=["POST"])
|
||||
async def delete_remote_media():
|
||||
return jsonify({"deleted": config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/statistics/users/media")
|
||||
async def media_stats():
|
||||
return jsonify({"users":[{"displayname":"Vona","media_count":config.the_funny_number,"media_length":config.the_funny_number,"user_id":f"@vona:{config.server_name}"}],"total":config.the_funny_number})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/statistics/database/rooms")
|
||||
async def room_stats():
|
||||
return jsonify({
|
||||
"rooms": [{
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"estimated_size": config.the_funny_number * 420
|
||||
}]
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/background_updates/enabled", methods=["POST", "GET"])
|
||||
@synapse.route("/_synapse/admin/v1/background_updates/status")
|
||||
async def change_bg_update():
|
||||
return jsonify({"enabled":False})
|
||||
|
||||
# No documentation on what Synapse actually returns for this API, so a blank dict for now
|
||||
@synapse.route("/_synapse/admin/v1/background_updates/start_job", methods=["POST"])
|
||||
async def bg_update_start_job():
|
||||
return jsonify({})
|
||||
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/event_reports")
|
||||
async def event_reports():
|
||||
return jsonify({
|
||||
"event_reports": [{
|
||||
"event_id": globals.make_event_id(),
|
||||
"id": config.the_funny_number,
|
||||
"reason": "",
|
||||
"score": config.the_funny_number,
|
||||
"received_ts": config.the_funny_number,
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"name": "Vona",
|
||||
"sender": f"@vona:{config.server_name}",
|
||||
"user_id": f"@vona:{config.server_name}"
|
||||
}],
|
||||
"total": config.the_funny_number
|
||||
})
|
||||
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/event_reports/<report_id>", methods=["GET", "DELETE"])
|
||||
async def interact_with_reported_event(report_id):
|
||||
if request.method == "GET":
|
||||
return jsonify({
|
||||
"event_id": globals.make_event_id(),
|
||||
"event_json": globals.hash_and_sign_event({
|
||||
"auth_events": [],
|
||||
"content": {
|
||||
"msgtype": "m.text",
|
||||
"body": "Number 15: Burger King Foot Lettuce.\nThe last thing you'd want in your Burger King burger is someones foot fungus, but as it turns out, that might be what you get. A 4channer uploaded a photo, anonymously to the site showcasing his feet in a plastic bin of lettuce with the statement \"This is the lettuce you eat at Burger King.\". Admittedly, he had shoes on, but thats even worse. The post went live at 11:38 PM on July 16 and a mere 20 minutes later the Burger King in question was alerted to the rogue employee. At least, I hope hes rogue. How did it happen? Well, the BK employee hadn't removed the EXIF data from the uploaded photo, which suggested that the culprit was somewhere in Mayfield Heights, Ohio. This was at 11:47. 3 minutes later, at 11:50, the Burger King branch was posted with wishes of happy unemployment. 5 minutes later, the news station was contacted by another 4channer, and 3 minutes later at 11:58 a link was posted: BK's tell us about us online forum. The foot photo, otherwise known as Exhibit A, was attached. Cleveland Seen Magazine contacted the BK in question and the next day when questioned, the breakfast shift manager said \"Oh, I know who that is, hes getting fired\". Mystery solved, by 4chan. Now we can go back to eating our fast food in peace.",
|
||||
"format": "org.matrix.custom.html",
|
||||
"formatted_body": "Number 15: Burger King Foot Lettuce.<br />The last thing you'd want in your Burger King burger is someones foot fungus, but as it turns out, that might be what you get. A 4channer uploaded a photo, anonymously to the site showcasing his feet in a plastic bin of lettuce with the statement "This is the lettuce you eat at Burger King.". Admittedly, he had shoes on, but thats even worse. The post went live at 11:38 PM on July 16 and a mere 20 minutes later the Burger King in question was alerted to the rogue employee. At least, I hope hes rogue. How did it happen? Well, the BK employee hadn't removed the EXIF data from the uploaded photo, which suggested that the culprit was somewhere in Mayfield Heights, Ohio. This was at 11:47. 3 minutes later, at 11:50, the Burger King branch was posted with wishes of happy unemployment. 5 minutes later, the news station was contacted by another 4channer, and 3 minutes later at 11:58 a link was posted: BK's tell us about us online forum. The foot photo, otherwise known as Exhibit A, was attached. Cleveland Seen Magazine contacted the BK in question and the next day when questioned, the breakfast shift manager said "Oh, I know who that is, hes getting fired". Mystery solved, by 4chan. Now we can go back to eating our fast food in peace."
|
||||
},
|
||||
"depth": config.the_funny_number,
|
||||
"origin": config.server_name,
|
||||
"origin_server_ts": config.the_funny_number,
|
||||
"prev_events": [globals.make_event_id()],
|
||||
"prev_state": [],
|
||||
"room_id": globals.make_event_id().replace("$", "!"),
|
||||
"sender": f"@vona:{config.server_name}",
|
||||
"type": "m.room.message"
|
||||
})
|
||||
})
|
||||
|
||||
return jsonify({})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/federation/destinations")
|
||||
async def federation_destinations():
|
||||
return jsonify({
|
||||
"destinations": [{}],
|
||||
"total": 0
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/federation/destinations/<destination>")
|
||||
async def destination(destination):
|
||||
return jsonify({
|
||||
"destination": destination,
|
||||
"retry_last_ts": config.the_funny_number,
|
||||
"retry_interval": config.the_funny_number,
|
||||
"failure_ts": config.the_funny_number,
|
||||
"last_successful_stream_ordering": None
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/federation/destinations/<destination>/rooms")
|
||||
async def destination_rooms(destination):
|
||||
return jsonify({
|
||||
"rooms": [],
|
||||
"total": 0
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/registration_tokens")
|
||||
async def reg_tokens():
|
||||
return jsonify({
|
||||
"registration_tokens": [{
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
}]
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/registration_tokens/<token>", methods=["GET", "PUT", "DELETE"])
|
||||
async def reg_token(token):
|
||||
if request.method == "DELETE":
|
||||
return jsonify({})
|
||||
|
||||
return jsonify({
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/registration_tokens/new", methods=["POST"])
|
||||
async def new_reg_token():
|
||||
return jsonify({
|
||||
"token": "Vona",
|
||||
"uses_allowed": config.the_funny_number,
|
||||
"pending": 0,
|
||||
"completed": 1,
|
||||
"expiry_time": None
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms")
|
||||
async def rooms():
|
||||
return jsonify({
|
||||
"rooms": [],
|
||||
"offset": 0,
|
||||
"total_rooms": 0
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>/members")
|
||||
async def room_members(room):
|
||||
return jsonify({
|
||||
"members": [
|
||||
f"@vona:{config.server_name}"
|
||||
],
|
||||
"total": 1
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>/state")
|
||||
async def room_state(room):
|
||||
return jsonify({"state": []})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>/state")
|
||||
async def room_messages(room):
|
||||
return jsonify({
|
||||
"chunk": [],
|
||||
"end": "vona",
|
||||
"start": "vona"
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>/block", methods=["GET", "PUT"])
|
||||
async def block_room(room):
|
||||
return jsonify({"block": False})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id>", methods=["DELETE"])
|
||||
async def room_delete(room):
|
||||
return jsonify({
|
||||
"kicked_users": [
|
||||
f"@vona:{config.server_name}"
|
||||
],
|
||||
"failed_to_kick_users": [],
|
||||
"local_aliases": [],
|
||||
"new_room_id": f"!vona:{config.server_name}"
|
||||
})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/rooms/<room_id>", methods=["DELETE"])
|
||||
async def room_delete_v2(room):
|
||||
return jsonify({"delete_id": "vona"})
|
||||
|
||||
@synapse.route("/_synapse/admin/v2/rooms/<room_id>/delete_status")
|
||||
async def room_delete_status(room):
|
||||
return jsonify({"results": []})
|
||||
|
||||
@synapse.route("/_synapse/admin/v1/rooms/<room_id_or_alias>/forward_extremities", methods=["GET"])
|
||||
async def forward_extremities(room):
|
||||
if request.method == "DELETE":
|
||||
return jsonify({"deleted": 0})
|
||||
|
||||
return jsonify({
|
||||
"count": 1,
|
||||
"results": [{
|
||||
"event_id": globals.make_event_id(),
|
||||
"state_group": config.the_funny_number,
|
||||
"depth": config.the_funny_number,
|
||||
"received_ts": config.the_funny_number
|
||||
}]
|
||||
})
|
||||
Reference in New Issue
Block a user