Sorry, but no, I'm not using a list.
As I said previously, I'm using the SP OOTB Colleagues functionality (http://office.microsoft.com/en-001/sharepoint-server-help/add-new-colleagues-and-manage-your-colleague-list-HA101665476.aspx).
For the time being I have found a workaround. I need to synchronize the Colleagues with a third party membership, so for now I have a Timer Job looking into the profile changes using a UserProfileChangeQuery
and getting all the profile changements for all users since the last execution of the TimerJob.
I leave you with the piece of code that manages that, in case someone needs to do the same.
//profile refers to the current user UserProfile
//change query is the UserProfileChangeQuery object
UserProfileChangeCollection changes = profile.GetChanges(changeQuery);
foreach (UserProfileChange change in changes)
{
if (change.ObjectType == ObjectTypes.Colleague)
{
var colleageChange = (UserProfileColleagueChange)change;
SPUser user = web.SiteUsers[colleageChange.Colleague["AccountName"].ToString()];
switch (colleageChange.ChangeType)
{
case ChangeTypes.Add:
//user added a colleague
break;
case ChangeTypes.Delete:
//user removed a colleague
break;
default:
break;
}
}
}
Cheers