Commit 5ec89f18 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Don't show shutdown message by default (JM-12).


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@892 b35dd754-fafc-0310-a699-88a17e54d16e
parent 10ac4ad8
...@@ -45,6 +45,7 @@ import org.xmpp.packet.Presence; ...@@ -45,6 +45,7 @@ import org.xmpp.packet.Presence;
* @author Derek DeMoro * @author Derek DeMoro
*/ */
public class SessionManager extends BasicModule implements ConnectionCloseListener { public class SessionManager extends BasicModule implements ConnectionCloseListener {
private int sessionCount = 0; private int sessionCount = 0;
public static final int NEVER_KICK = -1; public static final int NEVER_KICK = -1;
...@@ -242,7 +243,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen ...@@ -242,7 +243,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen
* @param packet * @param packet
*/ */
private void broadcast(Packet packet) throws UnauthorizedException, PacketException { private void broadcast(Packet packet) throws UnauthorizedException, PacketException {
// TODO Should we filter existing sessions whose presence is not available?
for (Session session : resources.values()) { for (Session session : resources.values()) {
packet.setTo(session.getAddress()); packet.setTo(session.getAddress());
session.getConnection().deliver(packet); session.getConnection().deliver(packet);
...@@ -789,7 +789,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen ...@@ -789,7 +789,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen
* @param packet The packet to be broadcast * @param packet The packet to be broadcast
*/ */
public void broadcast(Packet packet) throws UnauthorizedException { public void broadcast(Packet packet) throws UnauthorizedException {
// TODO Should we filter existing sessions whose presence is not available?
Iterator values = sessions.values().iterator(); Iterator values = sessions.values().iterator();
while (values.hasNext()) { while (values.hasNext()) {
((SessionMap)values.next()).broadcast(packet); ((SessionMap)values.next()).broadcast(packet);
...@@ -808,7 +807,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen ...@@ -808,7 +807,6 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen
* @param packet The packet to be broadcast * @param packet The packet to be broadcast
*/ */
public void userBroadcast(String username, Packet packet) throws UnauthorizedException, PacketException { public void userBroadcast(String username, Packet packet) throws UnauthorizedException, PacketException {
// TODO Should we filter existing sessions whose presence is not available?
SessionMap sessionMap = sessions.get(username); SessionMap sessionMap = sessions.get(username);
if (sessionMap != null) { if (sessionMap != null) {
sessionMap.broadcast(packet); sessionMap.broadcast(packet);
...@@ -816,11 +814,13 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen ...@@ -816,11 +814,13 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen
} }
/** /**
* TODO Requires better error checking to ensure the session count is maintained properly (removal actually does remove) * Removes a session.
* *
* @param session * @param session the session.
*/ */
public void removeSession(Session session) { public void removeSession(Session session) {
// TODO: Requires better error checking to ensure the session count is maintained
// TODO: properly (removal actually does remove).
if (session == null) { if (session == null) {
return; return;
} }
...@@ -977,7 +977,9 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen ...@@ -977,7 +977,9 @@ public class SessionManager extends BasicModule implements ConnectionCloseListen
public void stop() { public void stop() {
serverName = null; serverName = null;
sendServerMessage(null, LocaleUtils.getLocalizedString("admin.shutdown.now")); if (JiveGlobals.getBooleanProperty("shutdownMessage.enabled")) {
sendServerMessage(null, LocaleUtils.getLocalizedString("admin.shutdown.now"));
}
try { try {
for (Session session : getSessions()) { for (Session session : getSessions()) {
try { try {
......
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