Commit bf11ac8f authored by Matt Tucker's avatar Matt Tucker Committed by matt

Minor code cleanup.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1301 b35dd754-fafc-0310-a699-88a17e54d16e
parent 5028c279
...@@ -22,11 +22,18 @@ import org.xmpp.packet.Packet; ...@@ -22,11 +22,18 @@ import org.xmpp.packet.Packet;
import java.io.File; import java.io.File;
import java.util.Map; import java.util.Map;
/**
* Registration plugin.
*
* TODO: document plugin property names here.
*
* @author Ryan Graham.
*/
public class RegistrationPlugin implements Plugin { public class RegistrationPlugin implements Plugin {
private PluginManager pluginManager;
private RegistrationUserEventListener listener = new RegistrationUserEventListener(); private RegistrationUserEventListener listener = new RegistrationUserEventListener();
private static String serverName; private String serverName;
private JID serverAddress; private JID serverAddress;
private MessageRouter router; private MessageRouter router;
...@@ -39,10 +46,12 @@ public class RegistrationPlugin implements Plugin { ...@@ -39,10 +46,12 @@ public class RegistrationPlugin implements Plugin {
serverAddress = new JID(serverName); serverAddress = new JID(serverName);
router = XMPPServer.getInstance().getMessageRouter(); router = XMPPServer.getInstance().getMessageRouter();
registrationNotificationEnabled = JiveGlobals.getBooleanProperty("registration.notification.enabled", false); registrationNotificationEnabled = JiveGlobals.getBooleanProperty(
"registration.notification.enabled", false);
setRegistrationNotificationEnabled(registrationNotificationEnabled); setRegistrationNotificationEnabled(registrationNotificationEnabled);
registrationWelcomeEnabled = JiveGlobals.getBooleanProperty("registration.welcome.enabled", false); registrationWelcomeEnabled = JiveGlobals.getBooleanProperty(
"registration.welcome.enabled", false);
setRegistrationNotificationEnabled(registrationWelcomeEnabled); setRegistrationNotificationEnabled(registrationWelcomeEnabled);
contact = JiveGlobals.getProperty("registration.notification.contact", "admin"); contact = JiveGlobals.getProperty("registration.notification.contact", "admin");
...@@ -50,32 +59,15 @@ public class RegistrationPlugin implements Plugin { ...@@ -50,32 +59,15 @@ public class RegistrationPlugin implements Plugin {
UserEventDispatcher.addListener(listener); UserEventDispatcher.addListener(listener);
} }
public String getName() {
return pluginManager.getName(this);
}
public String getDescription() {
return pluginManager.getDescription(this);
}
public String getAuthor() {
return pluginManager.getAuthor(this);
}
public String getVersion() {
return pluginManager.getVersion(this);
}
public void processPacket(Packet packet) { public void processPacket(Packet packet) {
} }
public void initializePlugin(PluginManager manager, File pluginDirectory) { public void initializePlugin(PluginManager manager, File pluginDirectory) {
pluginManager = manager;
} }
public void destroyPlugin() { public void destroyPlugin() {
UserEventDispatcher.removeListener(listener); UserEventDispatcher.removeListener(listener);
pluginManager = null; listener = null;
router = null; router = null;
} }
......
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