summary refs log tree commit diff
path: root/docs/spec-additions.rst
blob: 8e3ffa56b65d28d8937bd4d7a321b8ac902c407a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
In C-S API > Registration/Login:

Captcha-based
~~~~~~~~~~~~~
:Type: 
  ``m.login.recaptcha``
:Description: 
  Login is supported by responding to a captcha, in this case Google's 
  Recaptcha.

To respond to this type, reply with::

  {
    "type": "m.login.recaptcha",
    "challenge": "<challenge token>",
    "response": "<user-entered text>"
  }

The Recaptcha parameters can be obtained in Javascript by calling::

  Recaptcha.get_challenge();
  Recaptcha.get_response();

The home server MUST respond with either new credentials, the next stage of the
login process, or a standard error response.




In Events:

Common event fields
-------------------
All events MUST have the following fields:

``event_id``
  Type:
    String.
  Description:
    Represents the globally unique ID for this event.

``type``
  Type:
    String.
  Description:
    Contains the event type, e.g. ``m.room.message``

``content``
  Type:
    JSON Object.
  Description:
    Contains the content of the event. When interacting with the REST API, this is the HTTP body.

``room_id``
  Type:
    String.
  Description:
    Contains the ID of the room associated with this event.

``user_id``
  Type:
    String.
  Description:
    Contains the fully-qualified ID of the user who *sent* this event.

State events have the additional fields:

``state_key``
  Type:
    String.
  Description:
    Contains the state key for this state event. If there is no state key for this state event, this
    will be an empty string. The presence of ``state_key`` makes this event a state event.

``required_power_level``
  Type:
    Integer.
  Description:
    Contains the minimum power level a user must have before they can update this event.

``prev_content``
  Type:
    JSON Object.
  Description:
    Optional. Contains the previous ``content`` for this event. If there is no previous content, this
    key will be missing.
    
.. TODO-spec
  How do "age" and "ts" fit in to all this? Which do we expose?