Skip to content

Instantly share code, notes, and snippets.

@zidel
Created July 11, 2011 22:49
Show Gist options
  • Save zidel/1076993 to your computer and use it in GitHub Desktop.
Save zidel/1076993 to your computer and use it in GitHub Desktop.
diff --git a/src/freemail/FreemailPlugin.java b/src/freemail/FreemailPlugin.java
index 6197e7b..3268e9e 100644
--- a/src/freemail/FreemailPlugin.java
+++ b/src/freemail/FreemailPlugin.java
@@ -25,6 +25,7 @@ package freemail;
import java.io.IOException;
+import freemail.config.Configurator;
import freenet.clients.http.PageNode;
import freenet.pluginmanager.FredPlugin;
import freenet.pluginmanager.FredPluginHTTP;
@@ -89,7 +90,7 @@ public class FreemailPlugin extends Freemail implements FredPlugin, FredPluginHT
"The username and password you select will be used both for sending and receiving " +
"email, and the username will also be the name of the new account. For receiving email " +
"the server is " + getIMAPServerAddress() + " and the port is " +
- configurator.get("imap_bind_port") + ". For sending the values are " +
+ configurator.get(Configurator.IMAP_BIND_PORT) + ". For sending the values are " +
getSMTPServerAddress() + " and " + configurator.get("smtp_bind_port")
+ " respectively.");
@@ -146,7 +147,7 @@ public class FreemailPlugin extends Freemail implements FredPlugin, FredPluginHT
text.addChild("#", "You now need to configure your email client to send and receive email through "
+ "Freemail using IMAP and SMTP. For IMAP the server is "
+ getIMAPServerAddress() + " and the port is " +
- configurator.get("imap_bind_port") + ". For SMTP the values are " +
+ configurator.get(Configurator.IMAP_BIND_PORT) + ". For SMTP the values are " +
getSMTPServerAddress() + " and " + configurator.get("smtp_bind_port")
+ " respectively.");
} catch (IOException ioe) {
diff --git a/src/freemail/config/Configurator.java b/src/freemail/config/Configurator.java
index 66bc72c..67dd507 100644
--- a/src/freemail/config/Configurator.java
+++ b/src/freemail/config/Configurator.java
@@ -31,6 +31,8 @@ import freemail.utils.PropsFile;
*/
public class Configurator {
+ public static final String IMAP_BIND_PORT = "imap_bind_port";
+
private final PropsFile props;
private final HashMap callbacks;
diff --git a/src/freemail/imap/IMAPListener.java b/src/freemail/imap/IMAPListener.java
index 3f3c6ea..9262509 100644
--- a/src/freemail/imap/IMAPListener.java
+++ b/src/freemail/imap/IMAPListener.java
@@ -41,13 +41,13 @@ public class IMAPListener extends ServerListener implements Runnable,ConfigClien
public IMAPListener(AccountManager accMgr, Configurator cfg) {
accountManager = accMgr;
cfg.register("imap_bind_address", this, "127.0.0.1");
- cfg.register("imap_bind_port", this, Integer.toString(LISTENPORT));
+ cfg.register(Configurator.IMAP_BIND_PORT, this, Integer.toString(LISTENPORT));
}
public void setConfigProp(String key, String val) {
if (key.equalsIgnoreCase("imap_bind_address")) {
this.bindaddress = val;
- } else if (key.equalsIgnoreCase("imap_bind_port")) {
+ } else if (key.equalsIgnoreCase(Configurator.IMAP_BIND_PORT)) {
this.bindport = Integer.parseInt(val);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment