]> git.mxchange.org Git - friendica-addons.git/commitdiff
Bugfix: Sometimes it happened that the own contact data was deleted. This was caused...
authorMichael Vogel <icarus@dabo.de>
Sat, 18 Oct 2014 22:05:06 +0000 (00:05 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 18 Oct 2014 22:05:06 +0000 (00:05 +0200)
statusnet/statusnet.php
twitter/twitter.php

index c3591356b6237c035b79edea23bc934b58e8a533..e96a8967a95c64946e7188db05f191f9bc56fe73 100644 (file)
@@ -872,6 +872,9 @@ function statusnet_address($contact) {
 }
 
 function statusnet_fetch_contact($uid, $contact, $create_user) {
+       if ($contact->statusnet_profile_url == "")
+               return(-1);
+
        // Check if the unique contact is existing
        // To-Do: only update once a while
         $r = q("SELECT id FROM unique_contacts WHERE url='%s' LIMIT 1",
@@ -950,16 +953,12 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
                q("UPDATE `contact` SET `photo` = '%s',
                                        `thumb` = '%s',
                                        `micro` = '%s',
-                                       `name-date` = '%s',
-                                       `uri-date` = '%s',
                                        `avatar-date` = '%s'
                                WHERE `id` = %d",
                        dbesc($photos[0]),
                        dbesc($photos[1]),
                        dbesc($photos[2]),
                        dbesc(datetime_convert()),
-                       dbesc(datetime_convert()),
-                       dbesc(datetime_convert()),
                        intval($contact_id)
                );
 
@@ -971,7 +970,7 @@ function statusnet_fetch_contact($uid, $contact, $create_user) {
 
                // check that we have all the photos, this has been known to fail on occasion
 
-               if((! $r[0]['photo']) || (! $r[0]['thumb']) || (! $r[0]['micro']) || ($update_photo)) {
+               if((!$r[0]['photo']) || (!$r[0]['thumb']) || (!$r[0]['micro']) || ($update_photo)) {
 
                        logger("statusnet_fetch_contact: Updating contact ".$contact->screen_name, LOGGER_DEBUG);
 
index 1919e28cf536293bcaad3c7d41cdf2e0933bea1c..2669c46d3e79919a1eb61e141e4e51e7cc47a26b 100644 (file)
@@ -892,6 +892,9 @@ function twitter_queue_hook(&$a,&$b) {
 function twitter_fetch_contact($uid, $contact, $create_user) {
        require_once("include/Photo.php");
 
+       if ($contact->id_str == "")
+               return(-1);
+
        $avatar = str_replace("_normal.", ".", $contact->profile_image_url_https);
 
        $info = get_photo_info($avatar);