]> git.mxchange.org Git - friendica.git/commitdiff
add webfinger addr to gcontact for friend "connect" links
authorfriendica <info@friendica.com>
Sun, 18 Dec 2011 08:50:17 +0000 (00:50 -0800)
committerfriendica <info@friendica.com>
Sun, 18 Dec 2011 08:50:17 +0000 (00:50 -0800)
boot.php
database.sql
include/socgraph.php
update.php

index 3189f929ee028d1182658453a4cf0eb06c283a56..b01effcbfba4d86e5bbb4e28890c36bca91e2b77 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -11,7 +11,7 @@ require_once('include/cache.php');
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
 define ( 'FRIENDICA_VERSION',      '2.3.1198' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.22'    );
-define ( 'DB_UPDATE_VERSION',      1111      );
+define ( 'DB_UPDATE_VERSION',      1112      );
 
 define ( 'EOL',                    "<br />\r\n"     );
 define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
index 894ea42d98e2d92a3465cd75e240367cdd577835..e96aff4b7715bd1afba4c3dbf9d42feccf39c5ff 100644 (file)
@@ -694,6 +694,7 @@ CREATE TABLE IF NOT EXISTS `gcontact` (
 `url` CHAR( 255 ) NOT NULL ,
 `nurl` CHAR( 255 ) NOT NULL ,
 `photo` CHAR( 255 ) NOT NULL,
+`connect` CHAR( 255 ) NOT NULL,
 INDEX ( `nurl` )
 ) ENGINE = MyISAM DEFAULT CHARSET=utf8;
 
index ffd3fd5df8a8cef537648c5e523ffefb68269a46..78a5514a0d462e7ef51c2c3b6a58f02dbaa424c7 100644 (file)
@@ -52,6 +52,7 @@ function poco_load($cid,$uid = 0,$url = null) {
 
                $profile_url = '';
                $profile_photo = '';
+               $connect_url = '';
                $name = '';
 
                $name = $entry->displayName;
@@ -59,13 +60,18 @@ function poco_load($cid,$uid = 0,$url = null) {
                foreach($entry->urls as $url) {
                        if($url->type == 'profile') {
                                $profile_url = $url->value;
-                               break;
+                               continue;
                        }
+                       if($url->type == 'webfinger') {
+                               $connect_url = str_replace('acct:' , '', $url->value);
+                               continue;
+                       }
+
                } 
                foreach($entry->photos as $photo) {
                        if($photo->type == 'profile') {
                                $profile_photo = $photo->value;
-                               break;
+                               continue;
                        }
                }
 
@@ -80,21 +86,23 @@ function poco_load($cid,$uid = 0,$url = null) {
                        $gcid = $x[0]['id'];
 
                        if($x[0]['name'] != $name || $x[0]['photo'] != $profile_photo) {
-                               q("update gcontact set `name` = '%s', `photo` = '%s' where
-                                       `nurl` = '%s' limit 1",
+                               q("update gcontact set `name` = '%s', `photo` = '%s', `connect` = '%s' 
+                                       where `nurl` = '%s' limit 1",
                                        dbesc($name),
                                        dbesc($profile_photo),
+                                       dbesc($connect_url),
                                        dbesc(normalise_link($profile_url))
                                );
                        }
                }
                else {
-                       q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`)
-                               values ( '%s', '%s', '%s', '%s') ",
+                       q("insert into `gcontact` (`name`,`url`,`nurl`,`photo`,`connect`)
+                               values ( '%s', '%s', '%s', '%s','%s') ",
                                dbesc($name),
                                dbesc($profile_url),
                                dbesc(normalise_link($profile_url)),
-                               dbesc($profile_photo)
+                               dbesc($profile_photo),
+                               dbesc($connect_url)
                        );
                        $x = q("select * from `gcontact` where `nurl` = '%s' limit 1",
                                dbesc(normalise_link($profile_url))
index 61a9a80edf9d41ec5f019cc4f3b0ffdb5619db30..9b5772af1c705d1e1d084d412a4ca7842a09c6ad 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-define( 'UPDATE_VERSION' , 1111 );
+define( 'UPDATE_VERSION' , 1112 );
 
 /**
  *
@@ -944,3 +944,7 @@ function update_1110() {
 
 }
 
+function update_1111() {
+       q("ALTER TABLE `gcontact` ADD `connect` CHAR( 255 ) NOT NULL ");
+}
+