From 1e0d3173f8ca37eb448d9a45a0f1235da43e84a1 Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 1 Jun 2011 21:15:20 -0700 Subject: [PATCH 1/7] i before e, except after.... --- boot.php | 2 +- doc/Connectors.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boot.php b/boot.php index f42d6beda2..ea119411e2 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.997' ); +define ( 'FRIENDIKA_VERSION', '2.2.998' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1059 ); diff --git a/doc/Connectors.md b/doc/Connectors.md index d9ad0e9b05..9b2430d094 100644 --- a/doc/Connectors.md +++ b/doc/Connectors.md @@ -26,7 +26,7 @@ These are described as the "federated social web" or OStatus contacts. Please note that there are **no** privacy provisions on the OStatus network. Any message which is delivered to **any** OStatus member is visible to anybody in the world and will negate any privacy settings that you have in effect. These messages will also turn up in public searches. -Since OStatus communications do not use authentication, if you select the profile privacy option to hide your profile and messages from unknown viewers, OStatus members will **not** be able to recieve your communications. +Since OStatus communications do not use authentication, if you select the profile privacy option to hide your profile and messages from unknown viewers, OStatus members will **not** be able to receive your communications. To connect with an OStatus member insert their profile URL or Identity address into the Connect box on your [Contacts](contacts) page. From 55e727de648cc932fb849f01c5dbda350ad7ad5e Mon Sep 17 00:00:00 2001 From: Friendika Date: Wed, 1 Jun 2011 22:06:53 -0700 Subject: [PATCH 2/7] make 'visible to everybody' warning toggle correctly in photos and settings --- mod/photos.php | 26 ++++++++++++++++++++++++++ mod/settings.php | 26 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/mod/photos.php b/mod/photos.php index 71d00ed254..926b33dbe2 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -45,6 +45,32 @@ function photos_init(&$a) { if(! x($a->page,'aside')) $a->page['aside'] = ''; $a->page['aside'] .= $o; + + + $a->page['htmlhead'] .= " +EOT; } return; diff --git a/mod/settings.php b/mod/settings.php index f898f171cc..86d1ae015c 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -6,6 +6,32 @@ function settings_init(&$a) { profile_load($a,$a->user['nickname']); } + $a->page['htmlhead'] .= " +EOT; + + } From 558962169ffe947906703f179d81aabccbd84a24 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 2 Jun 2011 00:52:26 -0700 Subject: [PATCH 3/7] warning message if Facebook post does not succeed. It happens quite a lot. --- addon/facebook/facebook.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index dc1aa02dd9..00098a7ddc 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -624,19 +624,23 @@ function facebook_post_hook(&$a,&$b) { // "test_mode" prevents anything from actually being posted. // Otherwise, let's do it. - if(! get_config('facebook','test_mode')) + if(! get_config('facebook','test_mode')) { $x = post_url($url, $postvars); - $retj = json_decode($x); - if($retj->id) { - q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1", - dbesc('fb::' . $retj->id), - intval($b['id']) - ); + $retj = json_decode($x); + if($retj->id) { + q("UPDATE `item` SET `extid` = '%s' WHERE `id` = %d LIMIT 1", + dbesc('fb::' . $retj->id), + intval($b['id']) + ); + } + else { + // FIXME queue the message so we can attempt to redeliver, see include/notifier.php and include/queue.php + notice( t('Facebook delivery failed.') . EOL); + } + + logger('Facebook post returns: ' . $x, LOGGER_DEBUG); } - - logger('Facebook post returns: ' . $x, LOGGER_DEBUG); - } } } From 2fcb5922c3ff883960f1dbb0aa63c2597dc38f15 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 2 Jun 2011 17:41:04 -0700 Subject: [PATCH 4/7] don't notify failed FB delivery of likes, which have no id. --- addon/facebook/facebook.php | 5 +++-- boot.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/addon/facebook/facebook.php b/addon/facebook/facebook.php index 00098a7ddc..3cc40330c3 100644 --- a/addon/facebook/facebook.php +++ b/addon/facebook/facebook.php @@ -438,7 +438,7 @@ function facebook_post_hook(&$a,&$b) { logger('facebook reply id=' . $reply); } - if($b['private'] && $reply == false) { + if($b['private'] && $reply === false) { $allow_people = expand_acl($b['allow_cid']); $allow_groups = expand_groups(expand_acl($b['allow_gid'])); $deny_people = expand_acl($b['deny_cid']); @@ -636,7 +636,8 @@ function facebook_post_hook(&$a,&$b) { } else { // FIXME queue the message so we can attempt to redeliver, see include/notifier.php and include/queue.php - notice( t('Facebook delivery failed.') . EOL); + if(! $likes) + notice( t('Facebook delivery failed.') . EOL); } logger('Facebook post returns: ' . $x, LOGGER_DEBUG); diff --git a/boot.php b/boot.php index ea119411e2..0af73c4684 100644 --- a/boot.php +++ b/boot.php @@ -4,7 +4,7 @@ set_time_limit(0); ini_set('pcre.backtrack_limit', 250000); -define ( 'FRIENDIKA_VERSION', '2.2.998' ); +define ( 'FRIENDIKA_VERSION', '2.2.999' ); define ( 'DFRN_PROTOCOL_VERSION', '2.21' ); define ( 'DB_UPDATE_VERSION', 1059 ); From 1eb177235bafe63bd021e86a963b5d78f9bd0cd1 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 2 Jun 2011 18:26:06 -0700 Subject: [PATCH 5/7] add queue_deliver plugin hook --- include/queue.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/queue.php b/include/queue.php index d4fc7dbd62..ff280cb53b 100644 --- a/include/queue.php +++ b/include/queue.php @@ -97,7 +97,7 @@ function queue_run($argv, $argc){ $deliver_status = 0; switch($contact['network']) { - case 'dfrn': + case NETWORK_DFRN: logger('queue: dfrndelivery: item ' . $q_item['id'] . ' for ' . $contact['name']); $deliver_status = dfrn_deliver($owner,$contact,$data); @@ -109,7 +109,7 @@ function queue_run($argv, $argc){ remove_queue_item($q_item['id']); } break; - default: + case NETWORK_OSTATUS: if($contact['notify']) { logger('queue: slapdelivery: item ' . $q_item['id'] . ' for ' . $contact['name']); $deliver_status = slapper($owner,$contact['notify'],$data); @@ -120,6 +120,18 @@ function queue_run($argv, $argc){ remove_queue_item($q_item['id']); } break; + default: + $a = get_app(); + $params = array('owner' => $owner, 'contact' => $contact, 'queue' => $q_item, 'result' => false); + call_hooks('queue_deliver', $a, $params); + + if($params['result']) + remove_queue_item($q_item['id']); + else + update_queue_time($q_item['id']); + + break; + } } From 20d1de4ceda3390f65adb9b9915dc9f36eeb3ed4 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 2 Jun 2011 20:42:09 -0700 Subject: [PATCH 6/7] got it wrong - apparently no need to fix json slashes --- mod/friendika.php | 2 +- mod/match.php | 1 + mod/qsearch.php | 2 +- mod/uexport.php | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mod/friendika.php b/mod/friendika.php index 8bd6e34377..7762bfbb52 100644 --- a/mod/friendika.php +++ b/mod/friendika.php @@ -24,7 +24,7 @@ function friendika_init(&$a) { ); - echo str_replace('\\/','/',json_encode($data)); + echo json_encode($data); killme(); } } diff --git a/mod/match.php b/mod/match.php index 2742b4a887..12138a26c7 100644 --- a/mod/match.php +++ b/mod/match.php @@ -38,6 +38,7 @@ function match_content(&$a) { if(count($j->results)) { foreach($j->results as $jj) { + $o .= '
'; $o .= '' . '' . $jj->name . '
'; $o .= '
'; diff --git a/mod/qsearch.php b/mod/qsearch.php index 9b3f2b087a..c35e253b67 100644 --- a/mod/qsearch.php +++ b/mod/qsearch.php @@ -44,7 +44,7 @@ function qsearch_init(&$a) { $results[] = array( (int) $rr['id'], 0, $rr['name'],$rr['url'],$rr['photo']); } - echo str_replace('\\/','/',json_encode((object) $results)); + echo json_encode((object) $results); killme(); } diff --git a/mod/uexport.php b/mod/uexport.php index 96f062c41c..e1fb22855a 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -39,7 +39,7 @@ function uexport_init(&$a) { $output = array('user' => $user, 'contact' => $contact, 'profile' => $profile ); header("Content-type: application/json"); - echo str_replace('\\/','/',json_encode($output)); + echo json_encode($output); $r = q("SELECT count(*) as `total` FROM `item` WHERE `uid` = %d ", intval(local_user()) @@ -63,7 +63,7 @@ function uexport_init(&$a) { } $output = array('item' => $item); - echo str_replace('\\/','/',json_encode($output)); + echo json_encode($output); } From f2bdcb19e7f2748d3c368ab11deeb98d63fedca7 Mon Sep 17 00:00:00 2001 From: Friendika Date: Thu, 2 Jun 2011 20:58:44 -0700 Subject: [PATCH 7/7] adjust acl_selector max name length to prevent div overflow --- include/acl_selectors.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/acl_selectors.php b/include/acl_selectors.php index b1bcf51086..90fdf9c1c9 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -90,7 +90,7 @@ function contact_select($selname, $selclass, $preselected = false, $size = 4, $p else $selected = ''; - $trimmed = mb_substr($rr['name'],0,22); + $trimmed = mb_substr($rr['name'],0,20); $o .= "\r\n"; }