Commit 0f83415c authored by Matt Tucker's avatar Matt Tucker Committed by matt

UI work, changed offline message defaults.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@634 b35dd754-fafc-0310-a699-88a17e54d16e
parent c244ac78
...@@ -26,8 +26,8 @@ import org.xmpp.packet.PacketError; ...@@ -26,8 +26,8 @@ import org.xmpp.packet.PacketError;
*/ */
public class OfflineMessageStrategy extends BasicModule { public class OfflineMessageStrategy extends BasicModule {
private static int quota = -1; private static int quota = 100*1024; // Default to 100 K.
private static Type type = Type.store; private static Type type = Type.store_and_bounce;
private SessionManager sessionManager; private SessionManager sessionManager;
private XMPPServer xmppServer; private XMPPServer xmppServer;
......
...@@ -84,18 +84,18 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter { ...@@ -84,18 +84,18 @@ public class PacketRouterImpl extends BasicModule implements PacketRouter {
} }
public void route(Presence packet) { public void route(Presence packet) {
if(!hasRouted(packet)){ if (!hasRouted(packet)) {
presenceRouter.route(packet); presenceRouter.route(packet);
} }
} }
public boolean hasRouted(Packet packet){ public boolean hasRouted(Packet packet){
if(packet.getTo() == null){ if (packet.getTo() == null) {
return false; return false;
} }
// Check for registered components // Check for registered components
Component component = componentManager.getComponent(packet.getTo().toBareJID()); Component component = componentManager.getComponent(packet.getTo().toBareJID());
if(component != null){ if (component != null) {
component.processPacket(packet); component.processPacket(packet);
return true; return true;
} }
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
url="reg-settings.jsp" url="reg-settings.jsp"
description="Click to edit registration & login policies" /> description="Click to edit registration & login policies" />
<item id="server-session-conflict" name="Resource Conflict Policy" <item id="server-session-conflict" name="Resource Policy"
url="session-conflict.jsp" url="session-conflict.jsp"
description="" /> description="" />
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
java.text.DateFormat, java.text.DateFormat,
java.util.HashMap, java.util.HashMap,
java.util.Map, java.util.Map,
org.jivesoftware.admin.*" org.jivesoftware.admin.*,
java.text.DecimalFormat"
errorPage="error.jsp" errorPage="error.jsp"
%> %>
...@@ -54,7 +55,8 @@ ...@@ -54,7 +55,8 @@
boolean update = request.getParameter("update") != null; boolean update = request.getParameter("update") != null;
int strategy = ParamUtils.getIntParameter(request,"strategy",-1); int strategy = ParamUtils.getIntParameter(request,"strategy",-1);
int storeStrategy = ParamUtils.getIntParameter(request,"storeStrategy",-1); int storeStrategy = ParamUtils.getIntParameter(request,"storeStrategy",-1);
int quota = ParamUtils.getIntParameter(request,"quota",0); double quota = ParamUtils.getIntParameter(request,"quota",0);
DecimalFormat format = new DecimalFormat("#0.0");
// Get the offline message manager // Get the offline message manager
OfflineMessageStrategy manager = admin.getXMPPServer().getOfflineMessageStrategy(); OfflineMessageStrategy manager = admin.getXMPPServer().getOfflineMessageStrategy();
...@@ -107,7 +109,7 @@ ...@@ -107,7 +109,7 @@
} }
} }
manager.setQuota(quota); manager.setQuota((int)(quota*1024));
%> %>
<c:set var="success" value="true" /> <c:set var="success" value="true" />
<% <%
...@@ -142,7 +144,7 @@ ...@@ -142,7 +144,7 @@
} }
} }
quota = manager.getQuota(); quota = ((double)manager.getQuota()) / (1024);
if (quota < 0) { if (quota < 0) {
quota = 0; quota = 0;
} }
...@@ -183,11 +185,11 @@ ...@@ -183,11 +185,11 @@
<% } %> <% } %>
<p> <p>
XMPP provides the option for servers to store-and-forward IM messages when they sent to a user that XMPP provides the option for servers to store-and-forward IM messages when they are sent to a
is not logged in. Supporting store-and-forward of 'offline messages' can be a very convenient user that is not logged in. Supporting store-and-forward of 'offline messages' can be a very convenient
feature of an XMPP deployment. However, offline messages, like email, can take up a significant feature of an XMPP deployment. However, offline messages, like email, can take up a significant
amount of space on a server. <fmt:message key="title" /> provides the option to handle offline messages in a amount of space on a server. There are several options for handling offline messages; select
variety of ways. Select the offline message handling strategy that best suites your needs. the policy that best suites your needs.
</p> </p>
<form action="offline-messages.jsp"> <form action="offline-messages.jsp">
...@@ -203,8 +205,8 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -203,8 +205,8 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((strategy==BOUNCE) ? "checked" : "") %>> <%= ((strategy==BOUNCE) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb01"><b>Always Bounce</b></label> - Never store the message, bounce the user <label for="rb01"><b>Bounce</b></label> - Never store offline messages and bounce
back to the sender. messages back to the sender.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
...@@ -213,8 +215,8 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -213,8 +215,8 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((strategy==DROP) ? "checked" : "") %>> <%= ((strategy==DROP) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb02"><b>Always Drop</b></label> - Never store the message, drop the message <label for="rb02"><b>Drop</b></label> - Never store offline messages and drop
so the sender is not notified. messages so the sender is not notified.
</td> </td>
</tr> </tr>
<tr valign="top" class=""> <tr valign="top" class="">
...@@ -223,9 +225,9 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -223,9 +225,9 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((strategy==STORE) ? "checked" : "") %>> <%= ((strategy==STORE) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb03"><b>Store the Message</b></label> - Store the message for later. The <label for="rb03"><b>Store</b></label> - Store offline messages for later
message will be delivered when the recipient next logs-in. Choose a storage policy and retrieval. Messages will be delivered the next time the recipient logs in.
storage store max size below. Choose a storage policy and storage store max size below.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
...@@ -242,7 +244,8 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -242,7 +244,8 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((storeStrategy==ALWAYS_STORE) ? "checked" : "") %>> <%= ((storeStrategy==ALWAYS_STORE) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb05"><b>Always Store</b></label> - Always save the message. <label for="rb05"><b>Always Store</b></label> - Always store messages,
even if the max storage size has been exceeded.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
...@@ -252,8 +255,9 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -252,8 +255,9 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((storeStrategy==STORE_AND_BOUNCE) ? "checked" : "") %>> <%= ((storeStrategy==STORE_AND_BOUNCE) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb06"><b>Always Store then Bounce</b></label> - Always save the message <label for="rb06"><b>Store or Bounce</b></label> - Store messages
but bounce the message back to the sender. up to the max storage size. After the max size has been exceeded, bounce
the message back to the sender.
</td> </td>
</tr> </tr>
<tr valign="top"> <tr valign="top">
...@@ -263,25 +267,21 @@ variety of ways. Select the offline message handling strategy that best suites y ...@@ -263,25 +267,21 @@ variety of ways. Select the offline message handling strategy that best suites y
<%= ((storeStrategy==STORE_AND_DROP) ? "checked" : "") %>> <%= ((storeStrategy==STORE_AND_DROP) ? "checked" : "") %>>
</td> </td>
<td width="99%"> <td width="99%">
<label for="rb07"><b>Always Store then Drop</b></label> - Always save the message <label for="rb07"><b>Store or Drop</b></label> - Store messages
but drop the message so the sender is not notified. for a user up to the max storage size. After the max size has been exceeded,
</td> silently drop messages.
</tr>
<tr>
<td colspan="2">
Offline message storage limit (in bytes):
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
Per-user offline message storage limit:
<input type="text" size="5" maxlength="12" name="quota" <input type="text" size="5" maxlength="12" name="quota"
value="<%= (quota>0 ? ""+quota : "") %>" value="<%= (quota>0 ? ""+format.format(quota) : "") %>"
onclick="this.form.strategy[2].checked=true;"> onclick="this.form.strategy[2].checked=true;">
bytes (1024 bytes = 1 K, 1048576 bytes = 1 Megabyte) KB
</td> </td>
</tr> </tr>
</table> </table>
</td> </td>
</tr> </tr>
</tbody> </tbody>
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
%> %>
<p> <p>
<fmt:message key="title" /> allows multiple logins to the same user account by assigning a unique "resource name" XMPP allows multiple logins to the same user account by assigning a unique "resource name"
to each connection. If a connection requests a resource name that is already in use, the server must to each connection. If a connection requests a resource name that is already in use, the server must
decide how to handle the conflict. The options on this page allow you to determine if the server decide how to handle the conflict. The options on this page allow you to determine if the server
always kicks off existing connections, never kicks off existing connections, or sets the number of always kicks off existing connections, never kicks off existing connections, or sets the number of
......
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