X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmessage.php;h=260f4bb14d30045b93c62b0eff4e10fabde70706;hb=92820c51811f80634c3e235c0ca67deea823d2d9;hp=949e5616cab554a4bb70427c1cc59891364cc0e5;hpb=50711040cbf3686f427e5ad8d0582674ef45a12b;p=friendica.git
diff --git a/mod/message.php b/mod/message.php
old mode 100755
new mode 100644
index 949e5616ca..260f4bb14d
--- a/mod/message.php
+++ b/mod/message.php
@@ -48,8 +48,7 @@ function message_post(&$a) {
$plaintext = intval(get_pconfig(local_user(),'system','plaintext'));
if(! $plaintext) {
- $body = str_replace("\r\n","\n",$body);
- $body = str_replace("\n\n","\n",$body);
+ $body = fix_mce_lf($body);
}
$ret = send_message($recipient, $body, $subject, $replyto);
@@ -192,15 +191,12 @@ function message_content(&$a) {
return $o;
}
- if(($a->argc == 1) || ($a->argc == 2 && $a->argv[1] === 'sent')) {
+ if($a->argc == 1) {
+
+ // list messages
$o .= $header;
- if($a->argc == 2)
- $eq = sprintf( "AND `from-url` = '%s'", dbesc($myprofile));
- else
- $eq = '';
-
$r = q("SELECT count(*) AS `total` FROM `mail`
WHERE `mail`.`uid` = %d AND `from-url` $eq '%s' GROUP BY `parent-uri` ORDER BY `created` DESC",
intval(local_user()),
@@ -213,7 +209,7 @@ function message_content(&$a) {
`mail`.* , `contact`.`name`, `contact`.`url`, `contact`.`thumb` , `contact`.`network`,
count( * ) as count
FROM `mail` LEFT JOIN `contact` ON `mail`.`contact-id` = `contact`.`id`
- WHERE `mail`.`uid` = %d $eq GROUP BY `parent-uri` ORDER BY `mailcreated` DESC LIMIT %d , %d ",
+ WHERE `mail`.`uid` = %d GROUP BY `parent-uri` ORDER BY `mailcreated` DESC LIMIT %d , %d ",
intval(local_user()),
//
intval($a->pager['start']),
@@ -226,9 +222,13 @@ function message_content(&$a) {
$tpl = get_markup_template('mail_list.tpl');
foreach($r as $rr) {
- if ($rr['from-url'] == $myprofile){
+ if($rr['unknown']) {
+ $partecipants = sprintf( t("Unknown sender - %s"),$rr['from-name']);
+ }
+ elseif (link_compare($rr['from-url'],$myprofile)){
$partecipants = sprintf( t("You and %s"), $rr['name']);
- } else {
+ }
+ else {
$partecipants = sprintf( t("%s and You"), $rr['from-name']);
}
@@ -237,7 +237,7 @@ function message_content(&$a) {
'$from_name' => $partecipants,
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? $a->get_baseurl(true) . '/redir/' . $rr['contact-id'] : $rr['url']),
'$sparkle' => ' sparkle',
- '$from_photo' => $rr['thumb'],
+ '$from_photo' => (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']),
'$subject' => template_escape((($rr['mailseen']) ? $rr['title'] : '' . $rr['title'] . '')),
'$delete' => t('Delete conversation'),
'$body' => template_escape($rr['body']),
@@ -300,7 +300,11 @@ function message_content(&$a) {
$mails = array();
$seen = 0;
+ $unknown = false;
+
foreach($messages as $message) {
+ if($message['unknown'])
+ $unknown = true;
if($message['from-url'] == $myprofile) {
$from_url = $myprofile;
$sparkle = '';
@@ -326,7 +330,7 @@ function message_content(&$a) {
}
$select = $message['name'] . '';
$parent = '';
-
+
$tpl = get_markup_template('mail_display.tpl');
$o = replace_macros($tpl, array(
@@ -334,7 +338,8 @@ function message_content(&$a) {
'$thread_subject' => $message['title'],
'$thread_seen' => $seen,
'$delete' => t('Delete conversation'),
-
+ '$canreply' => (($unknown) ? false : '1'),
+ '$unknown_text' => t("No secure communications available. You may be able to respond from the sender's profile page."),
'$mails' => $mails,
// reply