diff --git a/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java index 055f614ba..42c7fc8f8 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java @@ -87,7 +87,7 @@ public class ContactGroupIcqImpl for (int i = 0; i < groupMembers.size(); i++) { addContact( new ContactIcqImpl((Buddy)groupMembers.get(i), - ssclCallback) ); + ssclCallback, true) ); } } @@ -420,4 +420,17 @@ String getNameCopy() { return this.nameCopy; } + + /** + * Determines whether or not this contact group is being stored by the + * server. Non persistent contact groups exist for the sole purpose of + * containing non persistent contacts. + * @return true if the contact group is persistent and false otherwise. + */ + public boolean isPersistent() + { + return joustSimSourceGroup != null; + } + + } diff --git a/src/net/java/sip/communicator/impl/protocol/icq/ContactIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/ContactIcqImpl.java index e526add73..f28eb36aa 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/ContactIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/ContactIcqImpl.java @@ -17,12 +17,15 @@ public class ContactIcqImpl private byte[] image = null; private PresenceStatus icqStatus = IcqStatusEnum.OFFLINE; private ServerStoredContactListIcqImpl ssclCallback = null; + private boolean isPersistent = false; /** * Creates an IcqContactImpl * @param buddy the JoustSIM object that we will be encapsulating. */ - ContactIcqImpl(Buddy buddy, ServerStoredContactListIcqImpl ssclCallback) + ContactIcqImpl(Buddy buddy, + ServerStoredContactListIcqImpl ssclCallback, + boolean isPersistent) { this.joustSimBuddy = buddy; this.isLocal = isLocal; @@ -165,4 +168,21 @@ public ProtocolProviderService getProtocolProvider() { return ssclCallback.getParentProvider(); } + + /** + * Determines whether or not this contact is being stored by the server. + * Non persistent contacts are common in the case of simple, non-persistent + * presence operation sets. They could however also be seen in persistent + * presence operation sets when for example we have received an event + * from someone not on our contact list. Non persistent contacts are + * volatile even when coming from a persistent presence op. set. They would + * only exist until the application is closed and will not be there next + * time it is loaded. + * @return true if the contact is persistent and false otherwise. + */ + public boolean isPersistent() + { + return isPersistent; + } + } diff --git a/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java index 010582673..4cf5e73d0 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java @@ -244,4 +244,15 @@ public ProtocolProviderService getProtocolProvider() return this.ownerProvider; } + /** + * Determines whether or not this contact group is being stored by the + * server. Non persistent contact groups exist for the sole purpose of + * containing non persistent contacts. + * @return true if the contact group is persistent and false otherwise. + */ + public boolean isPersistent() + { + return true; + } + } diff --git a/src/net/java/sip/communicator/service/protocol/Contact.java b/src/net/java/sip/communicator/service/protocol/Contact.java index 6f516548b..5af1f12dc 100644 --- a/src/net/java/sip/communicator/service/protocol/Contact.java +++ b/src/net/java/sip/communicator/service/protocol/Contact.java @@ -71,4 +71,17 @@ public interface Contact */ public ProtocolProviderService getProtocolProvider(); + /** + * Determines whether or not this contact is being stored by the server. + * Non persistent contacts are common in the case of simple, non-persistent + * presence operation sets. They could however also be seen in persistent + * presence operation sets when for example we have received an event + * from someone not on our contact list. Non persistent contacts are + * volatile even when coming from a persistent presence op. set. They would + * only exist until the application is closed and will not be there next + * time it is loaded. + * @return true if the contact is persistent and false otherwise. + */ + public boolean isPersistent(); + } diff --git a/src/net/java/sip/communicator/service/protocol/ContactGroup.java b/src/net/java/sip/communicator/service/protocol/ContactGroup.java index 4f4170f71..bf82e1e74 100644 --- a/src/net/java/sip/communicator/service/protocol/ContactGroup.java +++ b/src/net/java/sip/communicator/service/protocol/ContactGroup.java @@ -103,4 +103,13 @@ public interface ContactGroup * ContactGroup belongs to. */ public ProtocolProviderService getProtocolProvider(); + + /** + * Determines whether or not this contact group is being stored by the + * server. Non persistent contact groups exist for the sole purpose of + * containing non persistent contacts. + * @return true if the contact group is persistent and false otherwise. + */ + public boolean isPersistent(); + } diff --git a/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContact.java b/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContact.java index 096e158e8..4dcd95ea3 100644 --- a/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContact.java +++ b/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContact.java @@ -22,6 +22,7 @@ public class MockContact private MockProvider parentProvider = null; private MockContactGroup parentGroup = null; private PresenceStatus presenceStatus = MockStatusEnum.MOCK_STATUS_50; + private boolean isPersistent = true; /** * Creates an instance of a meta contact with the specified string used @@ -146,4 +147,20 @@ public String toString() return buff.toString(); } + /** + * Determines whether or not this contact is being stored by the server. + * Non persistent contacts are common in the case of simple, non-persistent + * presence operation sets. They could however also be seen in persistent + * presence operation sets when for example we have received an event + * from someone not on our contact list. Non persistent contacts are + * volatile even when coming from a persistent presence op. set. They would + * only exist until the application is closed and will not be there next + * time it is loaded. + * @return true if the contact is persistent and false otherwise. + */ + public boolean isPersistent() + { + return isPersistent; + } + } diff --git a/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContactGroup.java b/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContactGroup.java index 1bba1a846..42a82dd64 100644 --- a/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContactGroup.java +++ b/test/net/java/sip/communicator/slick/contactlist/mockprovider/MockContactGroup.java @@ -24,7 +24,7 @@ public class MockContactGroup private Vector contacts = new Vector(); private Vector subGroups = new Vector(); private MockContactGroup parentGroup = null; - + private boolean isPersistent = true; private MockProvider parentProvider = null; /** @@ -366,5 +366,16 @@ public String toString() return buff.append("]").toString(); } + /** + * Determines whether or not this contact group is being stored by the + * server. Non persistent contact groups exist for the sole purpose of + * containing non persistent contacts. + * @return true if the contact group is persistent and false otherwise. + */ + public boolean isPersistent() + { + return true; + } + }