New avatar picture fields to better cope with changing avatars
This commit is contained in:
		
					parent
					
						
							
								d6c1889a20
							
						
					
				
			
			
				commit
				
					
						6f662b8c74
					
				
			
		
					 15 changed files with 143 additions and 59 deletions
				
			
		| 
						 | 
				
			
			@ -166,13 +166,13 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
 | 
			
		|||
						"", "", "", datetime_convert(), 2, $contact["id"], $contact["uid"]);
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if (isset($author["author-avatar"]) AND ($author["author-avatar"] != $r[0]['photo'])) {
 | 
			
		||||
		if (isset($author["author-avatar"]) AND ($author["author-avatar"] != $r[0]['avatar'])) {
 | 
			
		||||
			logger("Update profile picture for contact ".$contact["id"], LOGGER_DEBUG);
 | 
			
		||||
 | 
			
		||||
			$photos = import_profile_photo($author["author-avatar"], $importer["uid"], $contact["id"]);
 | 
			
		||||
 | 
			
		||||
			q("UPDATE `contact` SET `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' WHERE `id` = %d AND `network` = '%s'",
 | 
			
		||||
				dbesc($author["author-avatar"]), dbesc($photos[1]), dbesc($photos[2]),
 | 
			
		||||
			q("UPDATE `contact` SET `avatar` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s', `avatar-date` = '%s' WHERE `id` = %d AND `network` = '%s'",
 | 
			
		||||
				dbesc($author["author-avatar"]), dbesc($photos[0]), dbesc($photos[1]), dbesc($photos[2]),
 | 
			
		||||
				dbesc(datetime_convert()), intval($contact["id"]), dbesc(NETWORK_OSTATUS));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -180,7 +180,7 @@ function ostatus_fetchauthor($xpath, $context, $importer, &$contact, $onlyfetch)
 | 
			
		|||
		if ($contact["network"] == NETWORK_OSTATUS) {
 | 
			
		||||
			/// @todo Add the "addr" field
 | 
			
		||||
			$contact["generation"] = 2;
 | 
			
		||||
			$contact["photo"] = $author["author-avatar"];
 | 
			
		||||
			$contact["avatar"] = $author["author-avatar"];
 | 
			
		||||
			update_gcontact($contact);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue