From 573a441d83169afa90bc564add3b7ff753ac2f7b Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sun, 22 Nov 2015 12:28:39 +0100 Subject: [PATCH 1/3] Do not notify own posts, closes #1032 --- mod/ping.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mod/ping.php b/mod/ping.php index 30b5785ae..8cbfd308e 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -41,8 +41,9 @@ function ping_init(&$a) { FROM `item` INNER JOIN `item` as `pitem` ON `pitem`.`id`=`item`.`parent` WHERE `item`.`unseen` = 1 AND `item`.`visible` = 1 AND `item`.`deleted` = 0 AND `item`.`uid` = %d AND `pitem`.`parent` != 0 + AND `item`.`contact-id` != %d ORDER BY `item`.`created` DESC", - intval(local_user()) + intval(local_user()), intval(local_user()) ); if(count($r)) { From 6d2a9e44a71c00b427b411d0af0e2125664e99d3 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 23 Nov 2015 18:42:45 +0100 Subject: [PATCH 2/3] API: Improvements for fetching the nick name --- include/api.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/include/api.php b/include/api.php index 873006ac2..caa43649e 100644 --- a/include/api.php +++ b/include/api.php @@ -2849,15 +2849,29 @@ function api_share_as_retweet(&$item) { function api_get_nick($profile) { /* To-Do: - - remove trailing jung from profile url + - remove trailing junk from profile url - pump.io check has to check the website */ $nick = ""; - $friendica = preg_replace("=https?://(.*)/profile/(.*)=ism", "$2", $profile); - if ($friendica != $profile) - $nick = $friendica; + $r = q("SELECT `nick` FROM `gcontact` WHERE `nurl` = '%s'", + dbesc(normalise_link($profile))); + if ($r) + $nick = $r[0]["nick"]; + + if (!$nick == "") { + $r = q("SELECT `nick` FROM `contact` WHERE `uid` = 0 AND `nurl` = '%s'", + dbesc(normalise_link($profile))); + if ($r) + $nick = $r[0]["nick"]; + } + + if (!$nick == "") { + $friendica = preg_replace("=https?://(.*)/profile/(.*)=ism", "$2", $profile); + if ($friendica != $profile) + $nick = $friendica; + } if (!$nick == "") { $diaspora = preg_replace("=https?://(.*)/u/(.*)=ism", "$2", $profile); From 64b3881e73ec14a2cf34c52c2e18c9672e2b6289 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 23 Nov 2015 19:16:27 +0100 Subject: [PATCH 3/3] API: Show the remote profile so that AndStatus uses the correct webfinger address --- include/api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/api.php b/include/api.php index caa43649e..531b66814 100644 --- a/include/api.php +++ b/include/api.php @@ -539,7 +539,8 @@ 'verified' => true, 'statusnet_blocking' => false, 'notifications' => false, - 'statusnet_profile_url' => $a->get_baseurl()."/contacts/".$uinfo[0]['cid'], + //'statusnet_profile_url' => $a->get_baseurl()."/contacts/".$uinfo[0]['cid'], + 'statusnet_profile_url' => $uinfo[0]['url'], 'uid' => intval($uinfo[0]['uid']), 'cid' => intval($uinfo[0]['cid']), 'self' => $uinfo[0]['self'],