mirror of
https://gitlab.com/comunic/comunicapiv2
synced 2025-06-20 08:35:17 +00:00
Can change conversation name
This commit is contained in:
@ -90,7 +90,21 @@ export class ConversationsController {
|
||||
);
|
||||
}
|
||||
|
||||
// TODO : update moderation settings
|
||||
// Change moderator settings
|
||||
if(handler.hasPostParameter("members") || handler.hasPostParameter("name")) {
|
||||
|
||||
// Check if user is the moderator of the conversation
|
||||
if(!await ConversationsHelper.IsUserModerator(handler.getUserId(), convID))
|
||||
handler.error(401, "You are not allowed to perform changes on this conversation !");
|
||||
|
||||
|
||||
// Update conversation name (if required)
|
||||
if(handler.hasPostParameter("name")) {
|
||||
const name = handler.postString("name");
|
||||
await ConversationsHelper.SetName(convID, name == "false" ? "" : removeHTMLNodes(name));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
handler.success("Conversation information successfully updated!");
|
||||
}
|
||||
|
Reference in New Issue
Block a user