Create default moderators API routes
GitLab: #93
Change-Id: Idc107915f4248842949efa844e4e17601650d375
diff --git a/server/src/jamid/jami-swig.ts b/server/src/jamid/jami-swig.ts
index 484aad1..9d2959f 100644
--- a/server/src/jamid/jami-swig.ts
+++ b/server/src/jamid/jami-swig.ts
@@ -63,7 +63,6 @@
getAccountDetails(accountId: string): StringMap;
getVolatileAccountDetails(accountId: string): StringMap;
setAccountDetails(accountId: string, details: StringMap): void;
- setAccountActive(accountId: string, active: Bool): void;
addAccount(details: StringMap): string;
removeAccount(accountId: string): void;
@@ -84,7 +83,7 @@
getContactDetails(accountId: string, contactId: string): StringMap;
getDefaultModerators(accountId: string): StringVect;
- setDefaultModerators(accountId: string, uri: string, state: boolean): void;
+ setDefaultModerator(accountId: string, uri: string, state: boolean): void;
getConversations(accountId: string): StringVect;
conversationInfos(accountId: string, conversationId: string): StringMap;
diff --git a/server/src/jamid/jamid.ts b/server/src/jamid/jamid.ts
index 957f370..78cd71a 100644
--- a/server/src/jamid/jamid.ts
+++ b/server/src/jamid/jamid.ts
@@ -260,10 +260,18 @@
return stringMapToRecord(this.jamiSwig.getContactDetails(accountId, contactId));
}
- getDefaultModerators(accountId: string): string[] {
+ getDefaultModeratorUris(accountId: string): string[] {
return stringVectToArray(this.jamiSwig.getDefaultModerators(accountId));
}
+ addDefaultModerator(accountId: string, contactId: string): void {
+ this.jamiSwig.setDefaultModerator(accountId, contactId, true);
+ }
+
+ removeDefaultModerator(accountId: string, contactId: string): void {
+ this.jamiSwig.setDefaultModerator(accountId, contactId, false);
+ }
+
getConversationIds(accountId: string): string[] {
return stringVectToArray(this.jamiSwig.getConversations(accountId));
}