Fixes problem with stored groups which are marked as non persistent.

cusax-fix
Damian Minkov 15 years ago
parent 969ddcc270
commit 67a97b2e16

@ -58,6 +58,11 @@ public class ContactGroupIcqImpl
private ServerStoredContactListIcqImpl ssclCallback = null;
/**
* Whether current group is persistent.
*/
private boolean isPersistent;
/**
* Creates an ICQ group using the specified <tt>joustSimGroup</tt> as
* a source. The newly created group will always return the name of the
@ -81,10 +86,12 @@ public class ContactGroupIcqImpl
ContactGroupIcqImpl(MutableGroup joustSimGroup,
Iterable<? extends Buddy> groupMembers,
ServerStoredContactListIcqImpl ssclCallback,
boolean isResolved)
boolean isResolved,
boolean isPersistent)
{
this.joustSimSourceGroup = joustSimGroup;
this.isResolved = isResolved;
this.isPersistent = isPersistent;
this.ssclCallback = ssclCallback;
//store a copy of the name now so that we can detect changes in the
@ -420,7 +427,7 @@ String getNameCopy()
*/
public boolean isPersistent()
{
return !(joustSimSourceGroup instanceof VolatileGroup);
return isPersistent;
}
/**
@ -459,6 +466,7 @@ public boolean isResolved()
void setResolved(boolean resolved)
{
this.isResolved = resolved;
this.isPersistent = true;
}
/**

@ -511,7 +511,7 @@ ContactIcqImpl createVolatileContact(Screenname screenname)
{
List<Buddy> emptyBuddies = new LinkedList<Buddy>();
theVolatileGroup = new ContactGroupIcqImpl(
new VolatileGroup(), emptyBuddies, this, false);
new VolatileGroup(), emptyBuddies, this, false, false);
theVolatileGroup.addContact(newVolatileContact);
this.rootGroup.addSubGroup(theVolatileGroup);
@ -575,7 +575,7 @@ ContactGroupIcqImpl createUnresolvedContactGroup(String groupName)
//First create the new volatile contact;
List<Buddy> emptyBuddies = new LinkedList<Buddy>();
ContactGroupIcqImpl newUnresolvedGroup = new ContactGroupIcqImpl(
new VolatileGroup(groupName), emptyBuddies, this, false);
new VolatileGroup(groupName), emptyBuddies, this, false, true);
this.rootGroup.addSubGroup(newUnresolvedGroup);
@ -816,7 +816,7 @@ public void groupAdded(BuddyList list,
newGroup = new ContactGroupIcqImpl(
(MutableGroup) group
, buddies
, ServerStoredContactListIcqImpl.this, true);
, ServerStoredContactListIcqImpl.this, true, true);
//this is the first group so insert at 0.
rootGroup.addSubGroup(newGroup);

@ -56,6 +56,11 @@ public class ContactGroupMsnImpl
private final ServerStoredContactListMsnImpl ssclCallback;
/**
* Whether this group is persistent.
*/
private boolean isPersistent;
/**
* Creates an Msn group using the specified <tt>RosterGroup</tt> as
* a source. The newly created group will always return the name of the
@ -75,10 +80,12 @@ public class ContactGroupMsnImpl
ContactGroupMsnImpl(MsnGroup msnGroup,
MsnContact[] groupMembers,
ServerStoredContactListMsnImpl ssclCallback,
boolean isResolved)
boolean isResolved,
boolean isPersistent)
{
this.msnGroup = msnGroup;
this.isResolved = isResolved;
this.isPersistent = isPersistent;
this.ssclCallback = ssclCallback;
for (MsnContact groupMember : groupMembers)
@ -320,7 +327,7 @@ ContactMsnImpl findContact(String id)
*/
public boolean isPersistent()
{
return !(msnGroup instanceof VolatileGroup);
return isPersistent;
}
/**
@ -359,6 +366,7 @@ void setResolved(MsnGroup msnGroup)
return;
this.isResolved = true;
this.isPersistent = true;
this.msnGroup = msnGroup;

@ -454,7 +454,7 @@ ContactMsnImpl createVolatileContact(
MsnContact[] emptyBuddies = new MsnContact[]{};
theVolatileGroup = new ContactGroupMsnImpl(
new VolatileGroup(), emptyBuddies, this, false);
new VolatileGroup(), emptyBuddies, this, false, false);
theVolatileGroup.addContact(newVolatileContact);
this.rootGroup.addSubGroup(theVolatileGroup);
@ -521,7 +521,7 @@ ContactGroupMsnImpl createUnresolvedContactGroup(String groupName)
//First create the new volatile contact;
MsnContact[] emptyBuddies = new MsnContact[]{};
ContactGroupMsnImpl newUnresolvedGroup = new ContactGroupMsnImpl(
new VolatileGroup(groupName), emptyBuddies, this, false);
new VolatileGroup(groupName), emptyBuddies, this, false, true);
this.rootGroup.addSubGroup(newUnresolvedGroup);
@ -627,7 +627,7 @@ void removeContact(ContactMsnImpl contactToRemove)
*/
public void renameGroup(ContactGroupMsnImpl groupToRename, String newName)
{
printList();
//printList();
msnProvider.getMessenger().
renameGroup(groupToRename.getSourceGroup().getGroupId(), newName);
}
@ -892,6 +892,7 @@ public void contactListInitCompleted(MsnMessenger messenger)
item,
item.getContacts(),
ServerStoredContactListMsnImpl.this,
true,
true);
rootGroup.addSubGroup(newGroup);
@ -1094,6 +1095,7 @@ public void groupAddCompleted(MsnMessenger messenger, MsnGroup group)
new ContactGroupMsnImpl(group,
new MsnContact[]{},
ServerStoredContactListMsnImpl.this,
true,
true);
rootGroup.addSubGroup(newGroup);

Loading…
Cancel
Save