]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: The own avatar was (sometimes?) changed back when it was changed.
authorMichael Vogel <icarus@dabo.de>
Tue, 17 Nov 2015 07:39:09 +0000 (08:39 +0100)
committerMichael Vogel <icarus@dabo.de>
Tue, 17 Nov 2015 07:39:09 +0000 (08:39 +0100)
include/items.php
mod/dfrn_poll.php

index 65c49bf26373d5262136aba2e964c0c713f26828..c4310c24e2233a3a83761ae38429d8d42483b1b0 100644 (file)
@@ -2384,7 +2384,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                $photos = import_profile_photo($photo_url,$contact['uid'],$contact['id']);
 
                q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s'
-                       WHERE `uid` = %d AND `id` = %d",
+                       WHERE `uid` = %d AND `id` = %d AND NOT `self`",
                        dbesc(datetime_convert()),
                        dbesc($photos[0]),
                        dbesc($photos[1]),
@@ -2403,7 +2403,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
                        intval($contact['id'])
                );
 
-               $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s'",
+               $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s' AND NOT `self`",
                        dbesc(notags(trim($new_name))),
                        dbesc(datetime_convert()),
                        intval($contact['uid']),
@@ -3083,7 +3083,7 @@ function local_delivery($importer,$data) {
                $photos = import_profile_photo($photo_url,$importer['importer_uid'],$importer['id']);
 
                q("UPDATE `contact` SET `avatar-date` = '%s', `photo` = '%s', `thumb` = '%s', `micro` = '%s'
-                       WHERE `uid` = %d AND `id` = %d",
+                       WHERE `uid` = %d AND `id` = %d AND NOT `self`",
                        dbesc(datetime_convert()),
                        dbesc($photos[0]),
                        dbesc($photos[1]),
@@ -3102,7 +3102,7 @@ function local_delivery($importer,$data) {
                        intval($importer['id'])
                );
 
-               $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s'",
+               $x = q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `id` = %d AND `name` != '%s' AND NOT `self`",
                        dbesc(notags(trim($new_name))),
                        dbesc(datetime_convert()),
                        intval($importer['importer_uid']),
index b5f60a0397e39020cd77253b925e2386136e0277..d6a07186aca299e007e7a14ba9d436b42fa1affd 100644 (file)
@@ -476,8 +476,8 @@ function dfrn_poll_content(&$a) {
                        // URL reply
 
                        if($dfrn_version < 2.2) {
-                               $s = fetch_url($r[0]['poll'] 
-                                       . '?dfrn_id=' . $encrypted_id 
+                               $s = fetch_url($r[0]['poll']
+                                       . '?dfrn_id=' . $encrypted_id
                                        . '&type=profile-check'
                                        . '&dfrn_version=' . DFRN_PROTOCOL_VERSION
                                        . '&challenge=' . $challenge
@@ -493,7 +493,7 @@ function dfrn_poll_content(&$a) {
                                        'sec' => $sec
                                ));
                        }
-                       
+
                        $profile = ((count($r) && $r[0]['nickname']) ? $r[0]['nickname'] : $nickname);
 
                        switch($destination_url) {
@@ -506,7 +506,7 @@ function dfrn_poll_content(&$a) {
                                case 'status':
                                case '':
                                        $dest = $a->get_baseurl() . '/profile/' . $profile;
-                                       break;          
+                                       break;
                                default:
                                        $dest = $destination_url . '?f=&redir=1';
                                        break;
@@ -564,5 +564,3 @@ function dfrn_poll_content(&$a) {
                }
        }
 }
-
-