This merge brings back dbm::is_result() where I could find it.
Merge branch 'develop' of github.com:friendica/friendica into rhaeder-develop Signed-off-by: Roland Haeder <roland@mxchange.org>
This commit is contained in:
commit
c825cc8d0d
691 changed files with 128914 additions and 43052 deletions
|
@ -183,7 +183,7 @@ function message_content(&$a) {
|
|||
return;
|
||||
}
|
||||
|
||||
$myprofile = 'profile/' . $a->user['nickname'];
|
||||
$myprofile = $a->get_baseurl().'/profile/' . $a->user['nickname'];
|
||||
|
||||
$tpl = get_markup_template('mail_head.tpl');
|
||||
$header = replace_macros($tpl, array(
|
||||
|
@ -242,7 +242,7 @@ function message_content(&$a) {
|
|||
intval($a->argv[2]),
|
||||
intval(local_user())
|
||||
);
|
||||
if(dba::is_result($r)) {
|
||||
if(dbm::is_result($r)) {
|
||||
$parent = $r[0]['parent-uri'];
|
||||
$convid = $r[0]['convid'];
|
||||
|
||||
|
@ -305,15 +305,31 @@ function message_content(&$a) {
|
|||
$prename = $preurl = $preid = '';
|
||||
|
||||
if($preselect) {
|
||||
$r = q("select name, url, id from contact where uid = %d and id = %d limit 1",
|
||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `id` = %d LIMIT 1",
|
||||
intval(local_user()),
|
||||
intval($a->argv[2])
|
||||
);
|
||||
if(dba::is_result($r)) {
|
||||
if(!dbm::is_result($r)) {
|
||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc(normalise_link(base64_decode($a->argv[2])))
|
||||
);
|
||||
}
|
||||
|
||||
if(!dbm::is_result($r)) {
|
||||
$r = q("SELECT `name`, `url`, `id` FROM `contact` WHERE `uid` = %d AND `addr` = '%s' LIMIT 1",
|
||||
intval(local_user()),
|
||||
dbesc(base64_decode($a->argv[2]))
|
||||
);
|
||||
}
|
||||
|
||||
if(dbm::is_result($r)) {
|
||||
$prename = $r[0]['name'];
|
||||
$preurl = $r[0]['url'];
|
||||
$preid = $r[0]['id'];
|
||||
}
|
||||
$preselect = array($preid);
|
||||
} else
|
||||
$preselect = false;
|
||||
}
|
||||
|
||||
$prefill = (($preselect) ? $prename : '');
|
||||
|
@ -342,7 +358,6 @@ function message_content(&$a) {
|
|||
'$wait' => t('Please wait'),
|
||||
'$submit' => t('Submit')
|
||||
));
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
|
@ -357,17 +372,16 @@ function message_content(&$a) {
|
|||
|
||||
$r = q("SELECT count(*) AS `total` FROM `mail`
|
||||
WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `created` DESC",
|
||||
intval(local_user()),
|
||||
dbesc($myprofile)
|
||||
intval(local_user())
|
||||
);
|
||||
|
||||
if (dba::is_result($r)) {
|
||||
if (dbm::is_result($r)) {
|
||||
$a->set_pager_total($r[0]['total']);
|
||||
}
|
||||
|
||||
$r = get_messages(local_user(), $a->pager['start'], $a->pager['itemspage']);
|
||||
|
||||
if(! dba::is_result($r)) {
|
||||
if(! dbm::is_result($r)) {
|
||||
info( t('No messages.') . EOL);
|
||||
return $o;
|
||||
}
|
||||
|
@ -393,7 +407,7 @@ function message_content(&$a) {
|
|||
intval(local_user()),
|
||||
intval($a->argv[1])
|
||||
);
|
||||
if(dba::is_result($r)) {
|
||||
if(dbm::is_result($r)) {
|
||||
$contact_id = $r[0]['contact-id'];
|
||||
$convid = $r[0]['convid'];
|
||||
|
||||
|
@ -449,9 +463,11 @@ function message_content(&$a) {
|
|||
if($message['from-url'] == $myprofile) {
|
||||
$from_url = $myprofile;
|
||||
$sparkle = '';
|
||||
}
|
||||
else {
|
||||
$from_url = 'redir/' . $message['contact-id'];
|
||||
} elseif ($message['contact-id'] != 0) {
|
||||
$from_url = 'redir/'.$message['contact-id'];
|
||||
$sparkle = ' sparkle';
|
||||
} else {
|
||||
$from_url = $message['from-url']."?zrl=".urlencode($myprofile);
|
||||
$sparkle = ' sparkle';
|
||||
}
|
||||
|
||||
|
@ -465,20 +481,25 @@ function message_content(&$a) {
|
|||
$subject_e = template_escape($message['title']);
|
||||
$body_e = template_escape(Smilies::replace(bbcode($message['body'])));
|
||||
$to_name_e = template_escape($message['name']);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$from_name_e = $message['from-name'];
|
||||
$subject_e = $message['title'];
|
||||
$body_e = Smilies::replace(bbcode($message['body']));
|
||||
$to_name_e = $message['name'];
|
||||
}
|
||||
|
||||
$contact = get_contact_details_by_url($message['from-url']);
|
||||
if (isset($contact["thumb"]))
|
||||
$from_photo = $contact["thumb"];
|
||||
else
|
||||
$from_photo = $message['from-photo'];
|
||||
|
||||
$mails[] = array(
|
||||
'id' => $message['id'],
|
||||
'from_name' => $from_name_e,
|
||||
'from_url' => $from_url,
|
||||
'sparkle' => $sparkle,
|
||||
'from_photo' => $message['from-photo'],
|
||||
'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
|
||||
'subject' => $subject_e,
|
||||
'body' => $body_e,
|
||||
'delete' => t('Delete message'),
|
||||
|
@ -552,19 +573,16 @@ function render_messages(array $msg, $t) {
|
|||
$tpl = get_markup_template($t);
|
||||
$rslt = '';
|
||||
|
||||
$myprofile = 'profile/' . $a->user['nickname'];
|
||||
$myprofile = $a->get_baseurl().'/profile/' . $a->user['nickname'];
|
||||
|
||||
foreach($msg as $rr) {
|
||||
|
||||
if($rr['unknown']) {
|
||||
if($rr['unknown'])
|
||||
$participants = sprintf( t("Unknown sender - %s"),$rr['from-name']);
|
||||
}
|
||||
elseif (link_compare($rr['from-url'], $myprofile)){
|
||||
elseif (link_compare($rr['from-url'], $myprofile))
|
||||
$participants = sprintf( t("You and %s"), $rr['name']);
|
||||
}
|
||||
else {
|
||||
$participants = sprintf( t("%s and You"), $rr['from-name']);
|
||||
}
|
||||
else
|
||||
$participants = sprintf(t("%s and You"), $rr['from-name']);
|
||||
|
||||
if($a->theme['template_engine'] === 'internal') {
|
||||
$subject_e = template_escape((($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>'));
|
||||
|
@ -577,12 +595,18 @@ function render_messages(array $msg, $t) {
|
|||
$to_name_e = $rr['name'];
|
||||
}
|
||||
|
||||
$contact = get_contact_details_by_url($rr['url']);
|
||||
if (isset($contact["thumb"]))
|
||||
$from_photo = $contact["thumb"];
|
||||
else
|
||||
$from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']);
|
||||
|
||||
$rslt .= replace_macros($tpl, array(
|
||||
'$id' => $rr['id'],
|
||||
'$from_name' => $participants,
|
||||
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
|
||||
'$sparkle' => ' sparkle',
|
||||
'$from_photo' => (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']),
|
||||
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
|
||||
'$subject' => $subject_e,
|
||||
'$delete' => t('Delete conversation'),
|
||||
'$body' => $body_e,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue