diff --git a/.gitignore b/.gitignore index ecaf4a3..29426fa 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ src/Schema src/include/Schema man/mandoc.db *swp +.ccls-cache diff --git a/docs/user/admin/privileges.md b/docs/user/admin/privileges.md index b62e8d9..faaf69a 100644 --- a/docs/user/admin/privileges.md +++ b/docs/user/admin/privileges.md @@ -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 diff --git a/src/Room.c b/src/Room.c index 5506d1e..bc5418f 100644 --- a/src/Room.c +++ b/src/Room.c @@ -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( diff --git a/src/Room/Populate.c b/src/Room/Populate.c index f2e8e68..4d646fb 100644 --- a/src/Room/Populate.c +++ b/src/Room/Populate.c @@ -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, \ diff --git a/src/User.c b/src/User.c index df012a6..f011dbb 100644 --- a/src/User.c +++ b/src/User.c @@ -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; diff --git a/src/include/User.h b/src/include/User.h index b07edb6..56699bf 100644 --- a/src/include/User.h +++ b/src/include/User.h @@ -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; /**