[ADD/WIP] Start thinking AS, fix population

Visibility was all over the place....
This commit is contained in:
LDA 2024-09-27 23:45:54 +02:00
parent 01d170ce39
commit 78dbe5ca81
6 changed files with 11 additions and 3 deletions

1
.gitignore vendored
View file

@ -17,3 +17,4 @@ src/Schema
src/include/Schema
man/mandoc.db
*swp
.ccls-cache

View file

@ -14,6 +14,8 @@ administrator API; the regular Matrix API is unaffected.
registration tokens.
- **CONFIG:** Allows a user to modify the Telodendria server daemon's
configuration.
- **APPSERVICE:** Allows a user to register and manage application
services.
- **GRANT_PRIVILEGES:** Allows a user to modify his or her own
privileges or the privileges of other local users.
- **ALIAS:** Allows a user to modify and see room aliases created by

View file

@ -303,7 +303,7 @@ RoomEventFetch(Room *room, char *id)
JsonValueFree(HashMapSet(
unsign,
"pdu_status",
JsonValueDuplicate(HashMapGet(DbJson(event_ref), "pdu_status"))
JsonValueDuplicate(HashMapGet(DbJson(event_ref), "status"))
));
ts = JsonValueAsInteger(HashMapGet(ret, "origin_server_ts"));
JsonValueFree(HashMapSet(

View file

@ -170,7 +170,7 @@ RoomPopulate(Room *room, User *user, RoomCreateRequest *req, ServerPart s)
content = HashMapCreate(); \
JsonSet( \
content, \
JsonValueString(join_rules_preset) \
JsonValueString(p##_preset) \
, 1, a); \
event = RoomEventCreate( \
sender_str, \

View file

@ -879,6 +879,10 @@ UserDecodePrivilege(const char *p)
{
return USER_CONFIG;
}
else if (StrEquals(p, "APPSERVICE"))
{
return USER_APPSERVICE;
}
else if (StrEquals(p, "GRANT_PRIVILEGES"))
{
return USER_GRANT_PRIVILEGES;

View file

@ -66,7 +66,8 @@ typedef enum UserPrivileges
USER_GRANT_PRIVILEGES = (1 << 3),
USER_PROC_CONTROL = (1 << 4),
USER_ALIAS = (1 << 5),
USER_ALL = ((1 << 6) - 1)
USER_APPSERVICE = (1 << 6),
USER_ALL = ((1 << 7) - 1)
} UserPrivileges;
/**