Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ <h1>
REST API Plugin Changelog
</h1>

<p><b>Next Release</b> at some date</p>
<p><b>1.9.0</b> (tbd)</p>
<ul>
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/130'>#130</a>] - Add endpoint to create a new MUC service</li>
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/127'>#127</a>] - Add endpoint that allows for more than one MUC room to be created with one request</li>
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/33'>#33</a>] - Add 'allowPM' to representation of MUC room.</li>
<li>[<a href='https://github.com/igniterealtime/openfire-restAPI-plugin/issues/15'>#15</a>] - Fix group-based affiliations with MUC rooms.</li>
</ul>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>
<groupId>org.igniterealtime.openfire.plugins</groupId>
<artifactId>restAPI</artifactId>
<version>1.8.4-SNAPSHOT</version>
<version>1.9.0-SNAPSHOT</version>
<name>REST API Plugin</name>
<description>Allows administration over a RESTful API.</description>
<licenses>
Expand Down
15 changes: 10 additions & 5 deletions readme.html

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ Endpoint to create a new chat room.
<loginRestrictedToNickname>false</loginRestrictedToNickname>
<membersOnly>false</membersOnly>
<moderated>false</moderated>
<allowPM>anyone</allowPM>
<broadcastPresenceRoles>
<broadcastPresenceRole>moderator</broadcastPresenceRole>
<broadcastPresenceRole>participant</broadcastPresenceRole>
Expand Down Expand Up @@ -907,6 +908,7 @@ Endpoint to create a new chat room.
"loginRestrictedToNickname": "true",
"membersOnly": "false",
"moderated": "false",
"allowPM": "anyone",
"broadcastPresenceRoles": {
"broadcastPresenceRole": [
"moderator",
Expand Down Expand Up @@ -959,6 +961,7 @@ Endpoint to create a new chat room.
"loginRestrictedToNickname": "true",
"membersOnly": "false",
"moderated": "false",
"allowPM": "anyone",
"broadcastPresenceRoles": [
"moderator",
"participant",
Expand Down Expand Up @@ -1157,6 +1160,7 @@ Endpoint to update a chat room.
<loginRestrictedToNickname>false</loginRestrictedToNickname>
<membersOnly>false</membersOnly>
<moderated>false</moderated>
<allowPM>anyone</allowPM>
<broadcastPresenceRoles/>
<owners>
<owner>owner@localhost</owner>
Expand Down Expand Up @@ -1924,6 +1928,7 @@ If you want to create a resource with JSON data format, please add "**Content-Ty
| loginRestrictedToNickname | Yes | Can be "true" or "false". True if registered users can only join the room using their registered nickname. By default, registered users can join the room using any nickname. |
| membersOnly | Yes | Can be "true" or "false". True if the room requires an invitation to enter. That is if the room is members-only. |
| moderated | Yes | Can be "true" or "false". True if the room in which only those with "voice" may send messages to all occupants. |
| allowPM | Yes | One of "anyone", "participants", "moderators" or "none". Controls who is allowed to send private messages to other occupants in the room. |
| broadcastPresenceRoles | Yes | The list of roles of which presence will be broadcasted to the rest of the occupants. |
| owners | Yes | A collection with the current list of owners. The collection contains the bareJID of the users with owner affiliation. |
| admins | Yes | A collection with the current list of admins. The collection contains the bareJID of the users with admin affiliation. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ private void createRoom(MUCRoomEntity mucRoomEntity, String serviceName) throws
room.setMaxUsers(mucRoomEntity.getMaxUsers());
room.setMembersOnly(mucRoomEntity.isMembersOnly());
room.setModerated(mucRoomEntity.isModerated());
room.setCanSendPrivateMessage(mucRoomEntity.getAllowPM());

// Set broadcast presence roles
if (mucRoomEntity.getBroadcastPresenceRoles() != null) {
Expand Down Expand Up @@ -558,6 +559,7 @@ public MUCRoomEntity convertToMUCRoomEntity(MUCRoom room, boolean expand) {
mucRoomEntity.setMaxUsers(room.getMaxUsers());
mucRoomEntity.setMembersOnly(room.isMembersOnly());
mucRoomEntity.setModerated(room.isModerated());
mucRoomEntity.setAllowPM(room.canSendPrivateMessage());

ConcurrentGroupList<JID> owners = new ConcurrentGroupList<>(room.getOwners());
ConcurrentGroupList<JID> admins = new ConcurrentGroupList<>(room.getAdmins());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package org.jivesoftware.openfire.plugin.rest.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;
import java.util.List;
Expand All @@ -31,7 +32,7 @@
"modificationDate", "maxUsers", "persistent", "publicRoom", "registrationEnabled", "canAnyoneDiscoverJID",
"canOccupantsChangeSubject", "canOccupantsInvite", "canChangeNickname", "logEnabled",
"loginRestrictedToNickname", "membersOnly", "moderated", "broadcastPresenceRoles", "owners", "admins",
"members", "outcasts", "ownerGroups", "adminGroups", "memberGroups", "outcastGroups" })
"members", "outcasts", "ownerGroups", "adminGroups", "memberGroups", "outcastGroups", "allowPM" })
public class MUCRoomEntity {

private String roomName;
Expand All @@ -56,6 +57,7 @@ public class MUCRoomEntity {
private boolean loginRestrictedToNickname;
private boolean membersOnly;
private boolean moderated;
private String allowPM;

private List<String> broadcastPresenceRoles;

Expand Down Expand Up @@ -255,6 +257,16 @@ public void setModerated(boolean moderated) {
this.moderated = moderated;
}

@XmlElement
@Schema(description = "Defines who is allowed to send private messages to other occupants. Must be one of \"anyone\", \"participants\", \"moderators\" or \"none\".", example = "anyone")
public String getAllowPM() {
return allowPM == null ? "anyone" : allowPM;
}

public void setAllowPM(String allowPM) {
this.allowPM = allowPM == null ? "anyone" : allowPM;
}

@XmlElement(name = "broadcastPresenceRole")
@XmlElementWrapper(name = "broadcastPresenceRoles")
@JsonProperty(value = "broadcastPresenceRoles")
Expand Down
Loading