Merge branch 'master' of git://github.com/friendika/friendika

This commit is contained in:
Tobias Diekershoff 2011-06-03 08:21:28 +02:00
commit 9b93bd2521
11 changed files with 90 additions and 20 deletions

View File

@ -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']);
@ -624,19 +624,24 @@ 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
if(! $likes)
notice( t('Facebook delivery failed.') . EOL);
}
logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
}
logger('Facebook post returns: ' . $x, LOGGER_DEBUG);
}
}
}

View File

@ -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.999' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1059 );

View File

@ -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.

View File

@ -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 .= "<option value=\"{$rr['id']}\" $selected title=\"{$rr['name']}|{$rr['url']}\" >$trimmed</option>\r\n";
}

View File

@ -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;
}
}

View File

@ -24,7 +24,7 @@ function friendika_init(&$a) {
);
echo str_replace('\\/','/',json_encode($data));
echo json_encode($data);
killme();
}
}

View File

@ -38,6 +38,7 @@ function match_content(&$a) {
if(count($j->results)) {
foreach($j->results as $jj) {
$o .= '<div class="profile-match-wrapper"><div class="profile-match-photo">';
$o .= '<a href="' . $jj->url . '">' . '<img src="' . $jj->photo . '" alt="' . $jj->name . '" title="' . $jj->name . '[' . $jj->url . ']' . '" /></a></div>';
$o .= '<div class="profile-match-break"></div>';

View File

@ -45,6 +45,32 @@ function photos_init(&$a) {
if(! x($a->page,'aside'))
$a->page['aside'] = '';
$a->page['aside'] .= $o;
$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
$a->page['htmlhead'] .= <<< EOT
$(document).ready(function() {
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
selstr = $(this).text();
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
$('#jot-public').hide();
});
if(selstr == null) {
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
$('#jot-public').show();
}
}).trigger('change');
});
</script>
EOT;
}
return;

View File

@ -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();
}

View File

@ -6,6 +6,32 @@ function settings_init(&$a) {
profile_load($a,$a->user['nickname']);
}
$a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
$a->page['htmlhead'] .= <<< EOT
$(document).ready(function() {
$('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
var selstr;
$('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
selstr = $(this).text();
$('#jot-perms-icon').removeClass('unlock').addClass('lock');
$('#jot-public').hide();
});
if(selstr == null) {
$('#jot-perms-icon').removeClass('lock').addClass('unlock');
$('#jot-public').show();
}
}).trigger('change');
});
</script>
EOT;
}

View File

@ -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);
}