Commit 9a05f400 authored by Dave Cridland's avatar Dave Cridland

Merge pull request #62 from Redor/master

MUC Service Plugin update to 0.2.1
parents a6b7d090 5d001b0e
...@@ -44,13 +44,20 @@ ...@@ -44,13 +44,20 @@
MUC Service Plugin Changelog MUC Service Plugin Changelog
</h1> </h1>
<p><b>0.2.1</b> -- 08.09.2014</p>
<ul>
<li>Creation and modification dates, are now optional</li>
<li>Room user roles, are now optional</li>
<li>Bug fix: As persistent specified room, will be now saved to DB</li>
</ul>
<p><b>0.2.0</b> -- 07.07.2014</p> <p><b>0.2.0</b> -- 07.07.2014</p>
<ul> <ul>
<li>Extended the service with /participants endpoint to get all room participants</li> <li>Extended the service with /participants endpoint to get all room participants</li>
<li>Extended the muc service to manage chat room roles (owners, admins, members, outcasts)</li> <li>Extended the muc service to manage chat room roles (owners, admins, members, outcasts)</li>
</ul> </ul>
<p><b>0.1.0</b> -- 23.06.2014</p> <p><b>0.1.0</b> -- 06.23.2014</p>
<ul> <ul>
<li>Initial setup of MUC Service Plugin</li> <li>Initial setup of MUC Service Plugin</li>
</ul> </ul>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<name>MUC Service</name> <name>MUC Service</name>
<description>MUC administration over REST Interface</description> <description>MUC administration over REST Interface</description>
<author>Roman Soldatow</author> <author>Roman Soldatow</author>
<version>0.2.0</version> <version>0.2.1</version>
<date>07.07.2014</date> <date>08.09.2014</date>
<minServerVersion>3.9.1</minServerVersion> <minServerVersion>3.9.1</minServerVersion>
</plugin> </plugin>
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -162,9 +162,6 @@ public class MUCRoomController { ...@@ -162,9 +162,6 @@ public class MUCRoomController {
"IllegalArgumentException"); "IllegalArgumentException");
} }
// Set modification date
mucRoomEntity.setModificationDate(new Date());
createRoom(mucRoomEntity, serviceName); createRoom(mucRoomEntity, serviceName);
} catch (NotAllowedException e) { } catch (NotAllowedException e) {
throw new MUCServiceException("Could not update the channel", roomName, "NotAllowedException"); throw new MUCServiceException("Could not update the channel", roomName, "NotAllowedException");
...@@ -203,7 +200,7 @@ public class MUCRoomController { ...@@ -203,7 +200,7 @@ public class MUCRoomController {
} }
MUCRoom room = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName) MUCRoom room = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(serviceName)
.getChatRoom(mucRoomEntity.getRoomName(), owner); .getChatRoom(mucRoomEntity.getRoomName().toLowerCase(), owner);
// Set values // Set values
room.setNaturalLanguageName(mucRoomEntity.getNaturalName()); room.setNaturalLanguageName(mucRoomEntity.getNaturalName());
...@@ -235,6 +232,18 @@ public class MUCRoomController { ...@@ -235,6 +232,18 @@ public class MUCRoomController {
} else { } else {
room.setCreationDate(new Date()); room.setCreationDate(new Date());
} }
// Set modification date
if (mucRoomEntity.getModificationDate() != null) {
room.setModificationDate(mucRoomEntity.getModificationDate());
} else {
room.setModificationDate(new Date());
}
// Save the room to the DB if the room should be persistant
if (room.isPersistent()) {
room.saveToDB();
}
} }
/** /**
...@@ -350,12 +359,18 @@ public class MUCRoomController { ...@@ -350,12 +359,18 @@ public class MUCRoomController {
} }
room.addOwners(MUCRoomUtils.convertStringsToJIDs(mucRoomEntity.getOwners()), room.getRole()); room.addOwners(MUCRoomUtils.convertStringsToJIDs(mucRoomEntity.getOwners()), room.getRole());
if (mucRoomEntity.getAdmins() != null) {
room.addAdmins(MUCRoomUtils.convertStringsToJIDs(mucRoomEntity.getAdmins()), room.getRole()); room.addAdmins(MUCRoomUtils.convertStringsToJIDs(mucRoomEntity.getAdmins()), room.getRole());
}
if (mucRoomEntity.getMembers() != null) {
for (String memberJid : mucRoomEntity.getMembers()) { for (String memberJid : mucRoomEntity.getMembers()) {
room.addMember(new JID(memberJid), null, room.getRole()); room.addMember(new JID(memberJid), null, room.getRole());
} }
}
if (mucRoomEntity.getOutcasts() != null) {
for (String outcastJid : mucRoomEntity.getOutcasts()) { for (String outcastJid : mucRoomEntity.getOutcasts()) {
room.addOutcast(new JID(outcastJid), null, room.getRole()); room.addOutcast(new JID(outcastJid), null, room.getRole());
} }
} }
}
} }
\ No newline at end of file
...@@ -25,8 +25,8 @@ public class MUCRoomUtils { ...@@ -25,8 +25,8 @@ public class MUCRoomUtils {
* the jids * the jids
* @return the array list< string> * @return the array list< string>
*/ */
public static ArrayList<String> convertJIDsToStringList(Collection<JID> jids) { public static List<String> convertJIDsToStringList(Collection<JID> jids) {
ArrayList<String> result = new ArrayList<String>(); List<String> result = new ArrayList<String>();
for (JID jid : jids) { for (JID jid : jids) {
result.add(jid.toBareJID()); result.add(jid.toBareJID());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment