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

This commit is contained in:
Tobias Diekershoff 2011-05-31 07:36:25 +02:00
commit 745d075397
8 changed files with 46 additions and 11 deletions

View File

@ -725,8 +725,10 @@ function fb_consume_stream($uid,$j,$wall = false) {
// don't store post if we don't have a contact
if(! x($datarray,'contact-id'))
if(! x($datarray,'contact-id')) {
logger('no contact: post ignored');
continue;
}
$datarray['verb'] = ACTIVITY_POST;
if($wall) {
@ -759,8 +761,10 @@ function fb_consume_stream($uid,$j,$wall = false) {
intval($top_item),
intval($uid)
);
if(count($r))
if(count($r)) {
$orig_post = $r[0];
logger('fb: new top level item posted');
}
}
if(isset($entry->likes) && isset($entry->likes->data))

View File

@ -4,7 +4,7 @@ set_time_limit(0);
ini_set('pcre.backtrack_limit', 250000);
define ( 'FRIENDIKA_VERSION', '2.2.995' );
define ( 'FRIENDIKA_VERSION', '2.2.996' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1059 );

View File

@ -161,7 +161,7 @@ $o .= <<< EOT
EOT;
$r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d",
$r = q("SELECT * FROM `group` WHERE `deleted` = 0 AND `uid` = %d ORDER BY `name` ASC",
intval($_SESSION['uid'])
);
if(count($r)) {

View File

@ -742,6 +742,15 @@ function item_store($arr,$force_parent = false) {
$arr['uri'], // already dbesc'd
intval($arr['uid'])
);
if(! count($r)) {
// This is not good, but perhaps we encountered a rare race/cache condition, so back off and try again.
sleep(3);
$r = q("SELECT `id` FROM `item` WHERE `uri` = '%s' AND `uid` = %d LIMIT 1",
$arr['uri'], // already dbesc'd
intval($arr['uid'])
);
}
if(count($r)) {
$current_post = $r[0]['id'];
logger('item_store: created item ' . $current_post);

View File

@ -58,7 +58,7 @@ function contacts_post(&$a) {
return;
}
}
logger('contact_edit ' . print_r($_POST,true));
$priority = intval($_POST['poll']);
if($priority == (-1))
@ -269,7 +269,7 @@ function contacts_content(&$a) {
'$lbl_rep2' => t('Occasionally your friends may wish to inquire about this person\'s online legitimacy.'),
'$lbl_rep3' => t('You may help them choose whether or not to interact with this person by providing a <em>reputation</em> to guide them.'),
'$lbl_rep4' => t('Please take a moment to elaborate on this selection if you feel it could be helpful to others.'),
'$visit' => t('Visit $name\'s profile'),
'$visit' => sprintf( t('Visit %s\'s profile [%s]'),$r[0]['name'],$r[0]['url']),
'$blockunblock' => t('Block/Unblock contact'),
'$ignorecont' => t('Ignore contact'),
'$altcrepair' => t('Repair contact URL settings'),
@ -384,7 +384,7 @@ function contacts_content(&$a) {
$o .= replace_macros($tpl, array(
'$img_hover' => t('Visit $username\'s profile'),
'$img_hover' => sprintf( t('Visit %s\'s profile [%s]'),$rr['name'],$rr['url']),
'$edit_hover' => t('Edit contact'),
'$id' => $rr['id'],
'$alt_text' => $alt_text,

View File

@ -241,12 +241,13 @@ function profile_content(&$a, $update = 0) {
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`network`, `contact`.`rel`,
`contact`.`thumb`, `contact`.`self`, `contact`.`writable`,
`contact`.`id` AS `cid`, `contact`.`uid` AS `contact-uid`
FROM `item` LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
FROM `item`, (SELECT `p`.`id`,`p`.`created` FROM `item` AS `p` WHERE `p`.`parent` = `p`.`id`) AS `parentitem`, `contact`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
AND `contact`.`id` = `item`.`contact-id`
AND `contact`.`blocked` = 0 AND `contact`.`pending` = 0
AND `item`.`parent` IN ( %s )
AND `item`.`parent` = `parentitem`.`id` AND `item`.`parent` IN ( %s )
$sql_extra
ORDER BY `parent` DESC, `gravity` ASC, `item`.`id` ASC ",
ORDER BY `parentitem`.`created` DESC, `gravity` ASC, `item`.`created` ASC ",
intval($a->profile['profile_uid']),
dbesc($parents_str)
);

View File

@ -111,6 +111,22 @@ function settings_post(&$a) {
intval($mail_pubmail),
intval(local_user())
);
$r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
intval(local_user())
);
if(count($r)) {
$eacct = $r[0];
require_once('include/email.php');
$mb = construct_mailbox_name($eacct);
if(strlen($eacct['server'])) {
$dcrpass = '';
openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
$mbox = email_connect($mb,$mail_user,$dcrpass);
unset($dcrpass);
if(! $mbox)
notice( t('Failed to connect with email account using the settings provided.') . EOL);
}
}
}
$notify = 0;
@ -308,7 +324,7 @@ function settings_content(&$a) {
$mail_user = ((count($r)) ? $r[0]['user'] : '');
$mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
$mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
$mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
$pageset_tpl = get_markup_template('pagetypes.tpl');
$pagetype = replace_macros($pageset_tpl,array(
@ -484,6 +500,8 @@ function settings_content(&$a) {
'$lbl_imap6' => t("Reply-to address \x28Optional\x29:"),
'$imap_replyto' => $mail_replyto,
'$lbl_imap7' => t('Send public posts to all email contacts:'),
'$lbl_imap8' => t('Last successful email check:'),
'$lbl_imap9' => (($mail_chk === '0000-00-00 00:00:00') ? t('never') : datetime_convert('UTC', date_default_timezone_get(), $mail_chk, t('g A l F d Y'))),
'$pubmail_checked' => (($mail_pubmail) ? ' checked="checked" ' : ''),
'$mail_disabled' => (($mail_disabled) ? '<div class="info-message">' . t('Email access is disabled on this site.') . '</div>' : ''),
'$imap_disabled' => $imap_disabled

View File

@ -169,6 +169,9 @@ $profile_in_net_dir
$imap_desc
$mail_disabled
</p>
<p>
$lbl_imap8 $lbl_imap9
</p>
<label for="imap-server" id="settings-label-imap1">$lbl_imap1</label>
<input type="text" id="imap-server" name="mail_server" value="$imap_server" $imap_disabled />
<div id="imap-server-end"></div>