Changeset 24067
- Timestamp:
- 06/24/2008 07:56:34 PM (5 months ago)
- Files:
-
- trunk/Source/ESAddressBookIntegrationPlugin.m (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Source/ESAddressBookIntegrationPlugin.m
r24027 r24067 354 354 } 355 355 } 356 357 } else if (automaticSync && [inModifiedKeys containsObject:KEY_USER_ICON]) { 358 356 } 357 358 return modifiedAttributes; 359 } 360 361 - (void)listObjectAttributesChanged:(NSNotification *)notification 362 { 363 AIListObject *inObject = [notification object]; 364 NSSet *keys = [[notification userInfo] objectForKey:@"Keys"]; 365 366 if ([keys containsObject:KEY_USER_ICON] && 367 [inObject isKindOfClass:[AIListContact class]]) { 368 AIListContact *listContact = (AIListContact *)inObject; 369 359 370 //Only update when the serverside icon changes if there is no Adium preference overriding it 360 371 if (![AIUserIcons manuallySetUserIconDataForObject:listContact]) { 361 372 //Find the person 362 373 ABPerson *person = [listContact addressBookPerson]; 363 374 364 375 if (person && (person != [sharedAddressBook me])) { 365 376 if (person) { … … 368 379 NSImage *objectUserIcon = [listContact userIcon]; 369 380 NSData *objectUserIconData = nil; 370 381 371 382 if (!existingABImage || 372 383 (objectUserIcon && [(objectUserIconData = [objectUserIcon PNGRepresentation]) isEqualToData:[existingABImage PNGRepresentation]])) { … … 383 394 } 384 395 } 385 } 386 } 387 388 return modifiedAttributes; 396 } 397 } 389 398 } 390 399 … … 533 542 //Update all contacts, which will update objects and then our "me" card information 534 543 [self updateAllContacts]; 544 } 545 546 if (automaticSync) { 547 [[adium notificationCenter] addObserver:self 548 selector:@selector(listObjectAttributesChanged:) 549 name:ListObject_AttributesChanged 550 object:nil]; 551 } else { 552 [[adium notificationCenter] removeObserver:self name:ListObject_AttributesChanged object:nil]; 535 553 } 536 554