- if(attribute_contains($x->getAttribute('class'),'photo'))
- $ret['photo'] = $x->getAttribute('src');
- if(attribute_contains($x->getAttribute('class'),'key'))
+ }
+ if((attribute_contains($x->getAttribute('class'),'photo'))
+ || (attribute_contains($x->getAttribute('class'),'avatar'))) {
+ $size = intval($x->getAttribute('width'));
+ // dfrn prefers 175, so if we find this, we set largest_size so it can't be topped.
+ if(($size > $largest_photo) || ($size == 175) || (! $largest_photo)) {
+ $ret['photo'] = $x->getAttribute('src');
+ $largest_photo = (($size == 175) ? 9999 : $size);
+ }
+ }
+ if(attribute_contains($x->getAttribute('class'),'key')) {