forked from lda/telodendria
Finish up capabilities for now.
This commit is contained in:
parent
e1367d5bff
commit
96ca9a725d
2 changed files with 9 additions and 1 deletions
2
TODO.txt
2
TODO.txt
|
@ -55,7 +55,7 @@ Milestone: v0.3.0
|
||||||
[ ] Attach device id to user object
|
[ ] Attach device id to user object
|
||||||
[ ] Use UserAuthenticate()
|
[ ] Use UserAuthenticate()
|
||||||
[~] 9: User Data
|
[~] 9: User Data
|
||||||
[ ] 5: Capabilities negotiation
|
[x] 5: Capabilities negotiation
|
||||||
[ ] 10: Security (Rate Limiting)
|
[ ] 10: Security (Rate Limiting)
|
||||||
|
|
||||||
Milestone: v0.4.0
|
Milestone: v0.4.0
|
||||||
|
|
|
@ -34,18 +34,26 @@ ROUTE_IMPL(RouteCapabilities, path, argp)
|
||||||
{
|
{
|
||||||
HashMap *response;
|
HashMap *response;
|
||||||
HashMap *capabilities;
|
HashMap *capabilities;
|
||||||
|
HashMap *roomVersions;
|
||||||
|
|
||||||
(void) path;
|
(void) path;
|
||||||
(void) argp;
|
(void) argp;
|
||||||
|
|
||||||
response = HashMapCreate();
|
response = HashMapCreate();
|
||||||
capabilities = HashMapCreate();
|
capabilities = HashMapCreate();
|
||||||
|
roomVersions = HashMapCreate();
|
||||||
|
|
||||||
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.change_password", "enabled");
|
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.change_password", "enabled");
|
||||||
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.set_displayname", "enabled");
|
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.set_displayname", "enabled");
|
||||||
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.set_avatar_url", "enabled");
|
JsonSet(capabilities, JsonValueBoolean(1), 2, "m.set_avatar_url", "enabled");
|
||||||
JsonSet(capabilities, JsonValueBoolean(0), 2, "m.3pid_changes", "enabled");
|
JsonSet(capabilities, JsonValueBoolean(0), 2, "m.3pid_changes", "enabled");
|
||||||
|
|
||||||
|
/* TODO: When more room versions are implemented, add them to roomVersions */
|
||||||
|
HashMapSet(roomVersions, "1", JsonValueString("unstable"));
|
||||||
|
|
||||||
|
JsonSet(capabilities, JsonValueString("1"), 2, "m.room_versions", "default");
|
||||||
|
JsonSet(capabilities, JsonValueObject(roomVersions), 2, "m.room_versions", "available");
|
||||||
|
|
||||||
HashMapSet(response, "capabilities", JsonValueObject(capabilities));
|
HashMapSet(response, "capabilities", JsonValueObject(capabilities));
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue