diff --git a/resources/languages/resources.properties b/resources/languages/resources.properties
index f5a7c6023..106ede79c 100644
--- a/resources/languages/resources.properties
+++ b/resources/languages/resources.properties
@@ -336,6 +336,7 @@ service.gui.SELECT_ACCOUNT=Select account
service.gui.SELECT_COLOR=Select color
service.gui.SELECT_GROUP=Select group
service.gui.SELECT_GROUP_WIZARD_MSG=The list below contains all groups in your Contact List. Select the one, where you would like to add the new contact.
+service.gui.SELECT_GROUP_WIZARD_NO_GROUP=No group
service.gui.SELECT_GROUP_WIZARD=Specify group
service.gui.SELECT_PROVIDERS_FOR_CHAT_ROOM=The list below contains all accounts that support the multi user chat feature. Select the one you would like to use to create your chat room.
service.gui.SELECT_PROVIDERS_WIZARD_MSG=The list below contains all registered accounts. Select the one you would like to use to communicate with the new contact.
@@ -537,7 +538,7 @@ plugin.callhistoryform.INCOMING=Incoming
plugin.callhistoryform.OUTGOING=Outgoing
# facebookaccregwizz
-plugin.facebookaccregwizz.DESCRIPTION=
In order to use Facebook Chat you need to create a "Username"
from your "Account Settings" page on Facebook.
+plugin.facebookaccregwizz.DESCRIPTION=In order to use Facebook Chat you need to create a "Username"
from your "Account Settings" page on Facebook.
Note: When you create username you must logout from the webpage
and it can take a while before you are able to login with your new username!
plugin.facebookaccregwizz.INVALID_EMAIL_ADDRESS=Invalid username
plugin.facebookaccregwizz.PROTOCOL_DESCRIPTION=The Facebook Chat protocol
plugin.facebookaccregwizz.PROTOCOL_NAME=Facebook
diff --git a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
index cf11d1f0a..8086b94b6 100644
--- a/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
+++ b/src/net/java/sip/communicator/impl/contactlist/MetaContactListServiceImpl.java
@@ -392,7 +392,11 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
try
{
//create the contact in the group
- opSetPersPresence.subscribe(parentProtoGroup, contactID);
+ // if its the root group just call subscribe
+ if(parentMetaGroup.equals(rootMetaGroup))
+ opSetPersPresence.subscribe(contactID);
+ else
+ opSetPersPresence.subscribe(parentProtoGroup, contactID);
//wait for a confirmation event
evtRetriever.waitForEvent(CONTACT_LIST_MODIFICATION_TIMEOUT);
@@ -403,13 +407,13 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
== OperationFailedException.SUBSCRIPTION_ALREADY_EXISTS)
{
throw new MetaContactListException(
- "failed to create contact" + contactID
+ "failed to create contact " + contactID
, ex
, MetaContactListException.CODE_CONTACT_ALREADY_EXISTS_ERROR);
}
throw new MetaContactListException(
- "failed to create contact" + contactID
+ "failed to create contact " + contactID
, ex
, MetaContactListException.CODE_NETWORK_ERROR);
@@ -417,7 +421,7 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
catch (Exception ex)
{
throw new MetaContactListException(
- "failed to create contact" + contactID
+ "failed to create contact " + contactID
, ex
, MetaContactListException.CODE_NETWORK_ERROR);
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizard.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizard.java
index de16e2ed5..4ec69df4a 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizard.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizard.java
@@ -95,13 +95,22 @@ public AddContactWizard(MainFrame mainFrame, String contactAddress)
page2 = new AddContactWizardPage2(this, newContact);
- this.registerWizardPage(AddContactWizardPage2.IDENTIFIER, page2);
-
if (contactAddress != null)
page3 = new AddContactWizardPage3(this, newContact, contactAddress);
else
page3 = new AddContactWizardPage3(this, newContact);
+ if(page2.countGroups() == 1)
+ {
+ page2.commitPage();
+ page3.setBackPageIdentifier(AddContactWizardPage1.IDENTIFIER);
+ page1.setNextPageIdentifier(AddContactWizardPage3.IDENTIFIER);
+ }
+ else
+ {
+ this.registerWizardPage(AddContactWizardPage2.IDENTIFIER, page2);
+ }
+
this.registerWizardPage(AddContactWizardPage3.IDENTIFIER, page3);
this.setCurrentPage(AddContactWizardPage1.IDENTIFIER);
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage1.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage1.java
index 2be9b19e3..335fc15a6 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage1.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage1.java
@@ -32,6 +32,11 @@ public class AddContactWizardPage1
private WizardContainer wizard;
+ /**
+ * By default we are next to wizard page #2 but this can be changed.
+ */
+ private String nextPageIdentifier = AddContactWizardPage2.IDENTIFIER;
+
/**
* Creates an instance of AddContactWizardPage1.
*
@@ -103,7 +108,7 @@ public Object getIdentifier()
*/
public Object getNextPageIdentifier()
{
- return AddContactWizardPage2.IDENTIFIER;
+ return nextPageIdentifier;
}
/**
@@ -140,4 +145,13 @@ public void pageHiding() {}
public void pageShown() {}
public void pageBack() {}
+
+ /**
+ * Changes the back page for the current wizard page.
+ * @param identifier the new back page identifier.
+ */
+ public void setNextPageIdentifier(String identifier)
+ {
+ this.nextPageIdentifier = identifier;
+ }
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage2.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage2.java
index 94ddfa1af..295df2cb6 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage2.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage2.java
@@ -113,4 +113,13 @@ public void commitPage()
public void pageBack()
{
}
+
+ /**
+ * The number of groups.
+ * @return The number of available groups.
+ */
+ public int countGroups()
+ {
+ return selectGroupPanel.countGroups();
+ }
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage3.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage3.java
index cad4ab978..e2e9e96a2 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage3.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/AddContactWizardPage3.java
@@ -25,6 +25,11 @@ public class AddContactWizardPage3
private NewContact newContact;
+ /**
+ * By default we are back to wizard page #2 but this can be changed.
+ */
+ private String backPageIdentifier = AddContactWizardPage2.IDENTIFIER;
+
/**
* Creates an instance of AddContactWizardPage3.
* @param wizard the parent wizard
@@ -66,7 +71,7 @@ public Object getNextPageIdentifier() {
* identifier of the previous wizard page.
*/
public Object getBackPageIdentifier() {
- return AddContactWizardPage2.IDENTIFIER;
+ return backPageIdentifier;
}
/**
@@ -103,4 +108,13 @@ public void setUIN(String uin)
{
addContactPanel.setUIN(uin);
}
+
+ /**
+ * Changes the back page for the current wizard page.
+ * @param identifier the new back page identifier.
+ */
+ public void setBackPageIdentifier(String identifier)
+ {
+ this.backPageIdentifier = identifier;
+ }
}
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java
index 91e6eb527..aadade563 100644
--- a/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java
+++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/addcontact/SelectGroupPanel.java
@@ -98,9 +98,11 @@ public SelectGroupPanel(AddContactWizard wizard,
this.add(iconLabel, BorderLayout.WEST);
this.add(rightPanel, BorderLayout.CENTER);
-// groupCombo.addItem(new GroupWrapper(
-// GuiActivator.getResources().getI18NString("service.gui.ROOT_GROUP").getText(),
-// wizard.getRootGroup()));
+ // adding the root group
+ groupCombo.addItem(new GroupWrapper(
+ GuiActivator.getContactListService().getRoot(),
+ GuiActivator.getResources().
+ getI18NString("service.gui.SELECT_GROUP_WIZARD_NO_GROUP")));
String lastGroupName = ConfigurationManager.getLastContactParent();
@@ -109,37 +111,28 @@ public SelectGroupPanel(AddContactWizard wizard,
Iterator groupsList
= GuiActivator.getContactListService().getRoot().getSubgroups();
- if (groupsList.hasNext())
- {
- infoLabel.setText(
- GuiActivator.getResources().
- getI18NString("service.gui.SELECT_GROUP_WIZARD_MSG"));
-
- this.groupPanel.add(groupLabel, BorderLayout.WEST);
- this.groupPanel.add(groupCombo, BorderLayout.CENTER);
-
- while(groupsList.hasNext())
- {
- MetaContactGroup group = groupsList.next();
-
- GroupWrapper gr = new GroupWrapper(group);
-
- if(lastGroupName != null &&
- lastGroupName.equals(group.getGroupName()))
- lastSelectedGroup = gr;
-
- groupCombo.addItem(gr);
- }
-
- if(lastSelectedGroup != null)
- groupCombo.setSelectedItem(lastSelectedGroup);
- }
- else
+ infoLabel.setText(
+ GuiActivator.getResources().
+ getI18NString("service.gui.SELECT_GROUP_WIZARD_MSG"));
+
+ this.groupPanel.add(groupLabel, BorderLayout.WEST);
+ this.groupPanel.add(groupCombo, BorderLayout.CENTER);
+
+ while(groupsList.hasNext())
{
- infoLabel.setForeground(Color.RED);
- infoLabel.setText(GuiActivator.getResources()
- .getI18NString("service.gui.CREATE_FIRST_GROUP_WIZARD"));
+ MetaContactGroup group = groupsList.next();
+
+ GroupWrapper gr = new GroupWrapper(group);
+
+ if(lastGroupName != null &&
+ lastGroupName.equals(group.getGroupName()))
+ lastSelectedGroup = gr;
+
+ groupCombo.addItem(gr);
}
+
+ if(lastSelectedGroup != null)
+ groupCombo.setSelectedItem(lastSelectedGroup);
}
/**
@@ -173,12 +166,22 @@ public void setNextButtonAccordingToComboBox()
/**
* Implements ItemListener.itemStateChanged.
+ * @param e the event.
*/
public void itemStateChanged(ItemEvent e)
{
this.setNextButtonAccordingToComboBox();
}
+ /**
+ * The number of groups.
+ * @return The number of available groups.
+ */
+ public int countGroups()
+ {
+ return groupCombo.getItemCount();
+ }
+
private static class GroupWrapper
{
private final String groupName;
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
index de371b91b..b333815ce 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ServerStoredContactListJabberImpl.java
@@ -1042,6 +1042,9 @@ public void run()
ContactPropertyChangeEvent.PROPERTY_IMAGE,
contact, oldImage, imgBytes);
}
+ else
+ // set an empty image data so it won't be queried again
+ contact.setImage(new byte[0]);
}
}
}