final String group = tempGroup;
if( buddy.getRosterEntry() == null ) add = false;
BuddyGroup gObj = getGroupObject(group);
if (gObj == null)
return;
gObj.addBuddy(buddy);
if (add) {
final AutomatedTreeNode node = checkGroup(gObj);
node.setUserObject(gObj);
// find the group that the buddy belongs to
int index = getBuddyIndex(gObj.getGroupName(), buddy);
if (!isInTree(buddy)) {
node.insert(new AutomatedTreeNode(buddy), index);
}