Merge pull request #3675 from annando/mail-profile

Links to profiles in mails now show the profile address as title
This commit is contained in:
rabuzarus 2017-09-03 11:54:21 +02:00 committed by GitHub
commit 2bf6b15833
11 changed files with 62 additions and 59 deletions

View file

@ -81,8 +81,7 @@ function message_post(App $a) {
if ($norecip) {
$a->argc = 2;
$a->argv[1] = 'new';
}
else
} else
goaway($_SESSION['return_url']);
}
@ -112,8 +111,7 @@ function item_extract_images($body) {
$new_body = $new_body . substr($orig_body, 0, $img_start) . '[!#saved_image' . $cnt . '#!]';
$cnt++;
}
else
} else
$new_body = $new_body . substr($orig_body, 0, $img_end + strlen('[/img]'));
$orig_body = substr($orig_body, $img_end + strlen('[/img]'));
@ -228,8 +226,7 @@ function message_content(App $a) {
}
//goaway(System::baseUrl(true) . '/message' );
goaway($_SESSION['return_url']);
}
else {
} else {
$r = q("SELECT `parent-uri`,`convid` FROM `mail` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($a->argv[2]),
intval(local_user())
@ -473,6 +470,7 @@ function message_content(App $a) {
'id' => $message['id'],
'from_name' => $from_name_e,
'from_url' => $from_url,
'from_addr' => $contact['addr'],
'sparkle' => $sparkle,
'from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'subject' => $subject_e,
@ -494,8 +492,7 @@ function message_content(App $a) {
if ($a->theme['template_engine'] === 'internal') {
$subjtxt_e = template_escape($message['title']);
}
else {
} else {
$subjtxt_e = $message['title'];
}
@ -571,8 +568,7 @@ function render_messages(array $msg, $t) {
$subject_e = template_escape((($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>'));
$body_e = template_escape($rr['body']);
$to_name_e = template_escape($rr['name']);
}
else {
} else {
$subject_e = (($rr['mailseen']) ? $rr['title'] : '<strong>' . $rr['title'] . '</strong>');
$body_e = $rr['body'];
$to_name_e = $rr['name'];
@ -588,6 +584,7 @@ function render_messages(array $msg, $t) {
'$id' => $rr['id'],
'$from_name' => $participants,
'$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
'$from_addr' => $contact['addr'],
'$sparkle' => ' sparkle',
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),
'$subject' => $subject_e,

View file

@ -21,12 +21,14 @@ function redir_init(App $a) {
intval(local_user())
);
if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN))
if (!dbm::is_result($r)) {
goaway(System::baseUrl());
$cid = $r[0]['id'];
}
else {
if ($r[0]['network'] !== NETWORK_DFRN) {
goaway(($url != '' ? $url : $r[0]['url']));
}
$cid = $r[0]['id'];
} else {
$cid = $a->argv[1];
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@ -34,9 +36,13 @@ function redir_init(App $a) {
intval(local_user())
);
if((! dbm::is_result($r)) || ($r[0]['network'] !== NETWORK_DFRN))
if (!dbm::is_result($r)) {
goaway(System::baseUrl());
}
if ($r[0]['network'] !== NETWORK_DFRN) {
goaway(($url != '' ? $url : $r[0]['url']));
}
}
$dfrn_id = $orig_id = (($r[0]['issued-id']) ? $r[0]['issued-id'] : $r[0]['dfrn-id']);

View file

@ -1,7 +1,7 @@
<div class="mail-conv-outside-wrapper">
<div class="mail-conv-sender" >
<a href="{{$mail.from_url}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
</div>
<div class="mail-conv-detail" >
<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>

View file

@ -1,7 +1,7 @@
<div class="mail-list-outside-wrapper">
<div class="mail-list-sender" >
<a href="{{$from_url}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" /></a>
<a href="{{$from_url}}" title="{{$from_addr}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" title="{{$from_addr}}" /></a>
</div>
<div class="mail-list-detail">
<div class="mail-list-sender-name" >{{$from_name}}</div>

View file

@ -1,14 +1,14 @@
<div id="mail_conv-{{$mail.id}}" class="mail-conv-wrapper message-{{$mail.id}}">
<div class="media">
<div class="pull-left contact-photo-wrapper">
<a href="{{$mail.from_url}}">
<img class="media-object" src="{{$mail.from_photo}}" alt="{{$mail.from_name}}" />
<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}">
<img class="media-object" src="{{$mail.from_photo}}" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" />
</a>
</div>
<div class="media-body">
<div class="text-muted time mail-ago pull-right" title="{{$mail.date}}" data-toggle="tooltip">{{$mail.date}}</div>
<div class="mail-conv-delete-end"></div>
<h4 class="media-heading"><a href="{{$mail.from_url}}">{{$mail.from_name}}</a></h4>
<h4 class="media-heading"><a href="{{$mail.from_url}}" title="{{$mail.from_addr}}">{{$mail.from_name}}</a></h4>
<div class="mail-body">
{{$mail.body}}

View file

@ -4,8 +4,8 @@
<div class="media">
<div class="pull-left contact-photo-wrapper">
<a href="{{$from_url}}">
<img class="media-object" src="{{$from_photo}}" alt="{{$from_name}}" />
<a href="{{$from_url}}" title="{{$from_addr}}">
<img class="media-object" src="{{$from_photo}}" alt="{{$from_name}}" title="{{$from_addr}}" />
</a>
</div>
<div class="media-body">

View file

@ -1,7 +1,7 @@
<div class="mail-conv-outside-wrapper">
<div class="mail-conv-sender" >
<a href="{{$mail.from_url}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" /></a>
</div>
<div class="mail-conv-detail" >
<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>

View file

@ -1,7 +1,7 @@
<div class="mail-list-outside-wrapper">
<div class="mail-list-sender" >
<a href="{{$from_url}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" /></a>
<a href="{{$from_url}}" title="{{$from_addr}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" title="{{$from_addr}}" /></a>
</div>
<div class="mail-list-detail">
<div class="mail-list-sender-name" >{{$from_name}}</div>

View file

@ -1,7 +1,7 @@
<div class="mail-conv-outside-wrapper">
<div class="mail-conv-sender" >
<a href="{{$mail.from_url}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" /></a>
</div>
<div class="mail-conv-detail" >
<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>

View file

@ -1,7 +1,7 @@
<div class="mail-list-outside-wrapper">
<div class="mail-list-sender" >
<a href="{{$from_url}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" /></a>
<a href="{{$from_url}}" title="{{$from_addr}}" class="mail-list-sender-url" ><img class="mail-list-sender-photo{{$sparkle}}" src="{{$from_photo}}" height="80" width="80" alt="{{$from_name}}" title="{{$from_addr}}" /></a>
</div>
<div class="mail-list-detail">
<div class="mail-list-sender-name" >{{$from_name}}</div>

View file

@ -23,7 +23,7 @@
<div class="wall-item-actions">
<div class="wall-item-actions-author">
<a href="{{$mail.from_url}}" target="redir"
class="wall-item-name-link"><span
class="wall-item-name-link" title="{{$mail.from_addr}}"><span
class="wall-item-name{{$mail.sparkle}}">{{$mail.from_name}}</span></a>
<span class="wall-item-ago" title="{{$mail.date}}">{{$mail.ago}}</span>
</div>
@ -47,7 +47,7 @@
<div class="mail-conv-outside-wrapper">
<div class="mail-conv-sender" >
<a href="{{$mail.from_url}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" /></a>
<a href="{{$mail.from_url}}" title="{{$mail.from_addr}}" class="mail-conv-sender-url" ><img class="mframe mail-conv-sender-photo{{$mail.sparkle}}" src="{{$mail.from_photo}}" heigth="80" width="80" alt="{{$mail.from_name}}" title="{{$mail.from_addr}}" /></a>
</div>
<div class="mail-conv-detail" >
<div class="mail-conv-sender-name" >{{$mail.from_name}}</div>