diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties
index ef0edd12b..5a07d2598 100644
--- a/resources/languages/resources.properties
+++ b/resources/languages/resources.properties
@@ -1086,6 +1086,8 @@ plugin.ircaccregwizz.HOST=Hostname:
plugin.ircaccregwizz.IRC_SERVER=Server
plugin.ircaccregwizz.EXAMPLE_SERVER=Ex: chat.freenode.net
plugin.ircaccregwizz.USE_SECURE_CONNECTION=Use secure connection
+plugin.ircaccregwizz.ENABLE_CONTACT_PRESENCE=Enable contact presence
+plugin.ircaccregwizz.ENABLE_CHAT_ROOM_PRESENCE=Enable chat room presence
# jabber accregwizz
plugin.jabberaccregwizz.PROTOCOL_NAME=XMPP
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderFactoryIrcImpl.java b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderFactoryIrcImpl.java
index de71d89d4..fb8e0efda 100644
--- a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderFactoryIrcImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderFactoryIrcImpl.java
@@ -26,16 +26,13 @@ public class ProtocolProviderFactoryIrcImpl
/**
* Property indicating whether or not to enable a periodic task for querying
* channel member presence (available, away).
- *
- * TODO add configuration option in account wizard
*/
- public static final String CHANNEL_PRESENCE_TASK = "CHANNEL_PRESENCE_TASK";
+ public static final String CHAT_ROOM_PRESENCE_TASK =
+ "CHAT_ROOM_PRESENCE_TASK";
/**
* Property indicating whether or not to enable a periodic task for querying
* contact presence (offline, online).
- *
- * TODO add configuration option in account wizard
*/
public static final String CONTACT_PRESENCE_TASK = "CONTACT_PRESENCE_TASK";
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
index 3c32591a8..3a1a0ee53 100644
--- a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
@@ -255,7 +255,7 @@ public void register(final SecurityAuthority authority)
ProtocolProviderFactory.DEFAULT_ENCRYPTION, true);
boolean channelPresenceTask =
accountID.getAccountPropertyBoolean(
- ProtocolProviderFactoryIrcImpl.CHANNEL_PRESENCE_TASK, true);
+ ProtocolProviderFactoryIrcImpl.CHAT_ROOM_PRESENCE_TASK, true);
boolean contactPresenceTask =
accountID.getAccountPropertyBoolean(
ProtocolProviderFactoryIrcImpl.CONTACT_PRESENCE_TASK, true);
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
index 9243d2914..02b8bfdad 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/FirstWizardPage.java
@@ -22,6 +22,7 @@
* and the password of the account.
*
* @author Lionel Ferreira & Michael Tarantino
+ * @author Danny van Heumen
*/
public class FirstWizardPage
extends TransparentPanel
@@ -120,6 +121,12 @@ public class FirstWizardPage
private JCheckBox useSecureConnection = new SIPCommCheckBox(
Resources.getString("plugin.ircaccregwizz.USE_SECURE_CONNECTION"));
+ private JCheckBox enableContactPresenceTask = new SIPCommCheckBox(
+ Resources.getString("plugin.ircaccregwizz.ENABLE_CONTACT_PRESENCE"));
+
+ private JCheckBox enableChatRoomPresenceTask = new SIPCommCheckBox(
+ Resources.getString("plugin.ircaccregwizz.ENABLE_CHAT_ROOM_PRESENCE"));
+
private JPanel mainPanel = new TransparentPanel();
private Object nextPageIdentifier = WizardPage.SUMMARY_PAGE_IDENTIFIER;
@@ -193,6 +200,8 @@ private void init(String userId, String server)
this.defaultPort.setSelected(true);
this.passwordNotRequired.setSelected(true);
this.useSecureConnection.setSelected(true);
+ this.enableContactPresenceTask.setSelected(true);
+ this.enableChatRoomPresenceTask.setSelected(true);
this.portField
.setText(this.useSecureConnection.isSelected() ? DEFAULT_SECURE_PORT
: DEFAULT_PLAINTEXT_PORT);
@@ -251,8 +260,13 @@ private void init(String userId, String server)
serverPanel.setBorder(BorderFactory.createTitledBorder(
Resources.getString("plugin.ircaccregwizz.IRC_SERVER")));
- optionsPanel.add(rememberPassBox, BorderLayout.CENTER);
- optionsPanel.add(autoNickChange, BorderLayout.SOUTH);
+ optionsPanel.add(rememberPassBox, BorderLayout.NORTH);
+ optionsPanel.add(autoNickChange, BorderLayout.CENTER);
+ JPanel partition = new TransparentPanel();
+ optionsPanel.add(partition);
+ partition.setLayout(new BorderLayout());
+ partition.add(enableContactPresenceTask, BorderLayout.WEST);
+ partition.add(enableChatRoomPresenceTask, BorderLayout.EAST);
optionsPanel.setBorder(BorderFactory.createTitledBorder(
Resources.getString("service.gui.OPTIONS")));
@@ -345,6 +359,11 @@ public void commitPage()
registration.setAutoChangeNick(autoNickChange.isSelected());
registration.setRequiredPassword(!passwordNotRequired.isSelected());
registration.setSecureConnection(useSecureConnection.isSelected());
+ registration
+ .setContactPresenceTaskEnabled(this.enableContactPresenceTask
+ .isSelected());
+ registration.setChatRoomPresenceTaskEnabled(enableChatRoomPresenceTask
+ .isSelected());
isCommitted = true;
}
@@ -448,6 +467,14 @@ public void loadAccount(ProtocolProviderService protocolProvider)
accountID.getAccountPropertyBoolean(
ProtocolProviderFactory.DEFAULT_ENCRYPTION, true);
+ boolean contactPresenceTaskEnabled =
+ accountID.getAccountPropertyBoolean(
+ IrcAccountRegistrationWizard.CONTACT_PRESENCE_TASK, true);
+
+ boolean chatRoomPresenceTaskEnabled =
+ accountID.getAccountPropertyBoolean(
+ IrcAccountRegistrationWizard.CHAT_ROOM_PRESENCE_TASK, true);
+
this.userIDField.setEnabled(false);
this.userIDField.setText(accountID.getUserID());
this.serverField.setText(server);
@@ -486,6 +513,9 @@ public void loadAccount(ProtocolProviderService protocolProvider)
}
this.useSecureConnection.setSelected(useSecureConnection);
+ this.enableContactPresenceTask.setSelected(contactPresenceTaskEnabled);
+ this.enableChatRoomPresenceTask
+ .setSelected(chatRoomPresenceTaskEnabled);
}
/**
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
index a597f0478..50bf657da 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccRegWizzActivator.java
@@ -109,9 +109,7 @@ public static ProtocolProviderFactory getIrcProtocolProviderFactory()
{
ServiceReference>[] serRefs = null;
- String osgiFilter = "("
- + ProtocolProviderFactory.PROTOCOL
- + "=" + "IRC" + ")";
+ String osgiFilter = "(" + ProtocolProviderFactory.PROTOCOL + "=IRC)";
try
{
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
index 62f907a2f..ef2a5e0af 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistration.java
@@ -11,6 +11,7 @@
* through the IrcAccountRegistrationWizard.
*
* @author Lionel Ferreira & Michael Tarantino
+ * @author Danny van Heumen
*/
public class IrcAccountRegistration
{
@@ -23,6 +24,16 @@ public class IrcAccountRegistration
private boolean isRequiredPassword;
private boolean secureConnection;
+ /**
+ * Option for activating contact presence task.
+ */
+ private boolean contactPresenceTaskEnabled;
+
+ /**
+ * Option for activating chat room members presence task.
+ */
+ private boolean chatroomPresenceTaskEnabled;
+
/**
* Returns the User ID of the IRC registration account.
*
@@ -191,4 +202,44 @@ public void setSecureConnection(boolean secureConnection)
{
this.secureConnection = secureConnection;
}
+
+ /**
+ * Get contact presence task enabled.
+ *
+ * @return returns true if task should be enabled
+ */
+ public boolean isContactPresenceTaskEnabled()
+ {
+ return this.contactPresenceTaskEnabled;
+ }
+
+ /**
+ * Set contact presence task.
+ *
+ * @param value value
+ */
+ public void setContactPresenceTaskEnabled(final boolean value)
+ {
+ this.contactPresenceTaskEnabled = value;
+ }
+
+ /**
+ * Get chat room presence task.
+ *
+ * @return returns true if task should be enabled
+ */
+ public boolean isChatRoomPresenceTaskEnabled()
+ {
+ return this.chatroomPresenceTaskEnabled;
+ }
+
+ /**
+ * Set chat room presence task.
+ *
+ * @param value value
+ */
+ public void setChatRoomPresenceTaskEnabled(final boolean value)
+ {
+ this.chatroomPresenceTaskEnabled = value;
+ }
}
diff --git a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
index 22fb2de41..ed76959c6 100644
--- a/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
+++ b/src/net/java/sip/communicator/plugin/ircaccregwizz/IrcAccountRegistrationWizard.java
@@ -17,8 +17,8 @@
/**
* The IrcAccountRegistrationWizard is an implementation of the
- * AccountRegistrationWizard for the IRC protocol. It allows
- * the user to create and configure a new IRC account.
+ * AccountRegistrationWizard for the IRC protocol. It allows the user
+ * to create and configure a new IRC account.
*
* @author Lionel Ferreira & Michael Tarantino
* @author Danny van Heumen
@@ -30,6 +30,23 @@ public class IrcAccountRegistrationWizard
private static final int WIZARD_DIALOG_WIDTH = 600;
+ /**
+ * Repeated contact presence task configuration key from
+ * ProtocolProviderFactoryIrcImpl here to avoid having to import irc
+ * protocol package directly. See
+ * ProtocolProviderFactoryIrcImpl.CONTACT_PRESENCE_TASK.
+ */
+ public static final String CONTACT_PRESENCE_TASK = "CONTACT_PRESENCE_TASK";
+
+ /**
+ * Repeated chat room presence task configuration key from
+ * ProtocolProviderFactoryIrcImpl here to avoid having to import irc
+ * protocol package directly. See
+ * ProtocolProviderFactoryIrcImpl.CHAT_ROOM_PRESENCE_TASK.
+ */
+ public static final String CHAT_ROOM_PRESENCE_TASK =
+ "CHAT_ROOM_PRESENCE_TASK";
+
private final Logger logger
= Logger.getLogger(IrcAccountRegistrationWizard.class);
@@ -154,11 +171,16 @@ public Iterator> getSummary()
port = ":" + port;
}
+ // FIXME i18n
summaryTable.put("Password", pass);
summaryTable.put("Nickname", registration.getUserID());
summaryTable.put("Server IRC", registration.getServer() + port);
summaryTable.put("Secure connection",
registration.isSecureConnection() ? "yes" : "no");
+ summaryTable.put("Contact presence",
+ "" + registration.isContactPresenceTaskEnabled());
+ summaryTable.put("Chat room presence",
+ "" + registration.isChatRoomPresenceTaskEnabled());
return summaryTable.entrySet().iterator();
}
@@ -251,6 +273,11 @@ private ProtocolProviderService installAccount(
accountProperties.put(ProtocolProviderFactory.DEFAULT_ENCRYPTION,
new Boolean(registration.isSecureConnection()).toString());
+ accountProperties.put(CONTACT_PRESENCE_TASK,
+ Boolean.toString(registration.isContactPresenceTaskEnabled()));
+ accountProperties.put(CHAT_ROOM_PRESENCE_TASK,
+ Boolean.toString(registration.isChatRoomPresenceTaskEnabled()));
+
if (isModification())
{
providerFactory.modifyAccount(this.protocolProvider,