mirror of
https://github.com/matrix-org/matrix-spec
synced 2026-03-28 22:14:10 +01:00
Merge remote-tracking branch 'matrix-org/master' into travis/m.ignored_user_list
This commit is contained in:
commit
af74790681
|
|
@ -13,7 +13,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
swagger: '2.0'
|
swagger: '2.0'
|
||||||
info:
|
info:
|
||||||
title: "Matrix Client-Server Room Creation API"
|
title: "Matrix Client-Server Room Directory API"
|
||||||
version: "1.0.0"
|
version: "1.0.0"
|
||||||
host: localhost:8008
|
host: localhost:8008
|
||||||
schemes:
|
schemes:
|
||||||
|
|
@ -25,6 +25,88 @@ consumes:
|
||||||
produces:
|
produces:
|
||||||
- application/json
|
- application/json
|
||||||
paths:
|
paths:
|
||||||
|
"/directory/list/room/{roomId}":
|
||||||
|
get:
|
||||||
|
summary: Gets the visibility of a room in the directory
|
||||||
|
description: |-
|
||||||
|
Gets the visibility of a given room on the server's public room directory.
|
||||||
|
operationId: getRoomVisibilityOnDirectory
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room ID.
|
||||||
|
required: true
|
||||||
|
x-example: "!curbf:matrix.org"
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: The visibility of the room in the directory
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
visibility:
|
||||||
|
type: string
|
||||||
|
enum: ['private', 'public']
|
||||||
|
description: The visibility of the room in the directory.
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"visibility": "public"
|
||||||
|
}
|
||||||
|
404:
|
||||||
|
description: The room is not known to the server
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_NOT_FOUND",
|
||||||
|
"error": "Room not found"
|
||||||
|
}
|
||||||
|
put:
|
||||||
|
summary: Sets the visibility of a room in the room directory
|
||||||
|
description: |-
|
||||||
|
Sets the visibility of a given room in the server's public room
|
||||||
|
directory.
|
||||||
|
|
||||||
|
Servers may choose to implement additional access control checks
|
||||||
|
here, for instance that room visibility can only be changed by
|
||||||
|
the room creator or a server administrator.
|
||||||
|
operationId: setRoomVisibilityOnDirectory
|
||||||
|
security:
|
||||||
|
- accessToken: []
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
type: string
|
||||||
|
name: roomId
|
||||||
|
description: The room ID.
|
||||||
|
required: true
|
||||||
|
x-example: "!curbf:matrix.org"
|
||||||
|
- in: body
|
||||||
|
name: body
|
||||||
|
required: true
|
||||||
|
description: |-
|
||||||
|
The new visibility for the room on the room directory.
|
||||||
|
schema:
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
visibility:
|
||||||
|
type: string
|
||||||
|
enum: ["private", "public"]
|
||||||
|
description: |-
|
||||||
|
The new visibility setting for the room.
|
||||||
|
Defaults to 'public'.
|
||||||
|
example: {
|
||||||
|
"visibility": "public"
|
||||||
|
}
|
||||||
|
responses:
|
||||||
|
200:
|
||||||
|
description: The visibility was updated, or no change was needed.
|
||||||
|
examples:
|
||||||
|
application/json: {}
|
||||||
|
404:
|
||||||
|
description: The room is not known to the server
|
||||||
|
examples:
|
||||||
|
application/json: {
|
||||||
|
"errcode": "M_NOT_FOUND",
|
||||||
|
"error": "Room not found"
|
||||||
|
}
|
||||||
"/publicRooms":
|
"/publicRooms":
|
||||||
get:
|
get:
|
||||||
summary: Lists the public rooms on the server.
|
summary: Lists the public rooms on the server.
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@ Unreleased changes
|
||||||
|
|
||||||
- Add 'token' parameter to /keys/query endpoint
|
- Add 'token' parameter to /keys/query endpoint
|
||||||
(`#1104 <https://github.com/matrix-org/matrix-doc/pull/1104>`_).
|
(`#1104 <https://github.com/matrix-org/matrix-doc/pull/1104>`_).
|
||||||
|
- Add the room visibility options for the room directory
|
||||||
|
(`#1141 <https://github.com/matrix-org/matrix-doc/pull/1141>`_).
|
||||||
- Add spec for ignoring users
|
- Add spec for ignoring users
|
||||||
(`#1142 <https://github.com/matrix-org/matrix-doc/pull/1142>`_).
|
(`#1142 <https://github.com/matrix-org/matrix-doc/pull/1142>`_).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
"avatar_url": "mxc://localhost:wefuiwegh8742w",
|
"avatar_url": "mxc://localhost:wefuiwegh8742w",
|
||||||
"last_active_ago": 2478593,
|
"last_active_ago": 2478593,
|
||||||
"presence": "online",
|
"presence": "online",
|
||||||
"currently_active": false,
|
"currently_active": false
|
||||||
},
|
},
|
||||||
"sender": "@example:localhost",
|
"sender": "@example:localhost",
|
||||||
"type": "m.presence"
|
"type": "m.presence"
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@
|
||||||
#
|
#
|
||||||
# generate a tarball of assets suitable for the matrix.org site
|
# generate a tarball of assets suitable for the matrix.org site
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
cd `dirname $0`/..
|
cd `dirname $0`/..
|
||||||
|
|
||||||
mkdir -p assets
|
mkdir -p assets
|
||||||
|
|
|
||||||
|
|
@ -694,15 +694,25 @@ class MatrixUnits(Units):
|
||||||
for filename in os.listdir(path):
|
for filename in os.listdir(path):
|
||||||
if not filename.startswith("m."):
|
if not filename.startswith("m."):
|
||||||
continue
|
continue
|
||||||
with open(os.path.join(path, filename), "r") as f:
|
|
||||||
event_name = filename.split("#")[0]
|
|
||||||
example = json.loads(f.read())
|
|
||||||
|
|
||||||
examples[filename] = examples.get(filename, [])
|
event_name = filename.split("#")[0]
|
||||||
examples[filename].append(example)
|
filepath = os.path.join(path, filename)
|
||||||
if filename != event_name:
|
logger.info("Reading event example: %s" % filepath)
|
||||||
examples[event_name] = examples.get(event_name, [])
|
try:
|
||||||
examples[event_name].append(example)
|
with open(filepath, "r") as f:
|
||||||
|
example = json.load(f)
|
||||||
|
examples[filename] = examples.get(filename, [])
|
||||||
|
examples[filename].append(example)
|
||||||
|
if filename != event_name:
|
||||||
|
examples[event_name] = examples.get(event_name, [])
|
||||||
|
examples[event_name].append(example)
|
||||||
|
except Exception, e:
|
||||||
|
e2 = Exception("Error reading event example "+filepath+": "+
|
||||||
|
str(e))
|
||||||
|
# throw the new exception with the old stack trace, so that
|
||||||
|
# we don't lose information about where the error occurred.
|
||||||
|
raise e2, None, sys.exc_info()[2]
|
||||||
|
|
||||||
return examples
|
return examples
|
||||||
|
|
||||||
def load_event_schemas(self):
|
def load_event_schemas(self):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue