Commit 7b16dc87 authored by Günther Niess's avatar Günther Niess Committed by niess

OF-32: Respect MUC service on loading rooms

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@11194 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1de45b87
......@@ -48,7 +48,7 @@ public class MUCPersistenceManager {
"SELECT roomID, creationDate, modificationDate, naturalName, description, lockedDate, " +
"emptyDate, canChangeSubject, maxUsers, publicRoom, moderated, membersOnly, canInvite, " +
"roomPassword, canDiscoverJID, logEnabled, subject, rolesToBroadcast, useReservedNick, " +
"canChangeNick, canRegister FROM ofMucRoom WHERE name=?";
"canChangeNick, canRegister FROM ofMucRoom WHERE serviceID=? AND name=?";
private static final String LOAD_AFFILIATIONS =
"SELECT jid, affiliation FROM ofMucAffiliation WHERE roomID=?";
private static final String LOAD_MEMBERS =
......@@ -163,9 +163,11 @@ public class MUCPersistenceManager {
Connection con = null;
PreparedStatement pstmt = null;
try {
Long serviceID = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatServiceID(room.getMUCService().getServiceName());
con = DbConnectionManager.getConnection();
pstmt = con.prepareStatement(LOAD_ROOM);
pstmt.setString(1, room.getName());
pstmt.setLong(1, serviceID);
pstmt.setString(2, room.getName());
ResultSet rs = pstmt.executeQuery();
if (!rs.next()) {
throw new IllegalArgumentException("Room " + room.getName() + " was not found in the database.");
......
......@@ -451,7 +451,7 @@
@<select name="mucName">
<% for (MultiUserChatService service : webManager.getMultiUserChatManager().getMultiUserChatServices()) { %>
<% if (service.isHidden()) continue; %>
<option value="<%= service.getServiceName() %>"<%= service.getServiceDomain().equals(mucName) ? " selected='selected'" : "" %>><%= service.getServiceDomain() %></option>
<option value="<%= service.getServiceDomain() %>"<%= service.getServiceDomain().equals(mucName) ? " selected='selected'" : "" %>><%= service.getServiceDomain() %></option>
<% } %>
</select>
<% } else { %>
......
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