Added an implementation of the isPersistent() method that allows us creating instances of contacts and groups for buddies not in our contact list

cusax-fix
Emil Ivov 20 years ago
parent 006e96e97c
commit 2421f5426f

@ -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;
}
}

@ -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;
}
}

@ -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;
}
}

@ -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();
}

@ -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();
}

@ -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;
}
}

@ -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;
}
}

Loading…
Cancel
Save