use Friendica\Model\Notify\Type;
use Friendica\Module\Security\Login;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\Proxy as ProxyUtils;
use Friendica\Util\Strings;
use Friendica\Util\Temporal;
function message_post(App $a)
{
if (!local_user()) {
- notice(DI::l10n()->t('Permission denied.') . EOL);
+ notice(DI::l10n()->t('Permission denied.'));
return;
}
switch ($ret) {
case -1:
- notice(DI::l10n()->t('No recipient selected.') . EOL);
+ notice(DI::l10n()->t('No recipient selected.'));
$norecip = true;
break;
case -2:
- notice(DI::l10n()->t('Unable to locate contact information.') . EOL);
+ notice(DI::l10n()->t('Unable to locate contact information.'));
break;
case -3:
- notice(DI::l10n()->t('Message could not be sent.') . EOL);
+ notice(DI::l10n()->t('Message could not be sent.'));
break;
case -4:
- notice(DI::l10n()->t('Message collection failure.') . EOL);
+ notice(DI::l10n()->t('Message collection failure.'));
break;
}
Nav::setSelected('messages');
if (!local_user()) {
- notice(DI::l10n()->t('Permission denied.') . EOL);
+ notice(DI::l10n()->t('Permission denied.'));
return Login::form();
}
if ($cmd === 'drop') {
$message = DBA::selectFirst('mail', ['convid'], ['id' => $a->argv[2], 'uid' => local_user()]);
if(!DBA::isResult($message)){
- notice(DI::l10n()->t('Conversation not found.') . EOL);
+ notice(DI::l10n()->t('Conversation not found.'));
DI::baseUrl()->redirect('message');
}
if (!DBA::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
- notice(DI::l10n()->t('Message was not deleted.') . EOL);
+ notice(DI::l10n()->t('Message was not deleted.'));
}
$conversation = DBA::selectFirst('mail', ['id'], ['convid' => $message['convid'], 'uid' => local_user()]);
$parent = $r[0]['parent-uri'];
if (!DBA::delete('mail', ['parent-uri' => $parent, 'uid' => local_user()])) {
- notice(DI::l10n()->t('Conversation was not removed.') . EOL);
+ notice(DI::l10n()->t('Conversation was not removed.'));
}
}
DI::baseUrl()->redirect('message');
$r = get_messages(local_user(), $pager->getStart(), $pager->getItemsPerPage());
if (!DBA::isResult($r)) {
- notice(DI::l10n()->t('No messages.') . EOL);
+ notice(DI::l10n()->t('No messages.'));
return $o;
}
}
if (!DBA::isResult($messages)) {
- notice(DI::l10n()->t('Message not available.') . EOL);
+ notice(DI::l10n()->t('Message not available.'));
return $o;
}
$body_e = BBCode::convert($message['body']);
$to_name_e = $message['name'];
- $contact = Contact::getByURL($message['from-url'], false, ['thumb', 'addr']);
- if (isset($contact["thumb"])) {
- $from_photo = $contact["thumb"];
- } else {
- $from_photo = $message['from-photo'];
- }
+ $contact = Contact::getByURL($message['from-url'], false, ['thumb', 'addr', 'id', 'avatar']);
+ $from_photo = Contact::getThumb($contact, $message['from-photo']);
$mails[] = [
'id' => $message['id'],
'from_url' => $from_url,
'from_addr' => $contact['addr'],
'sparkle' => $sparkle,
- 'from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
+ 'from_photo' => $from_photo,
'subject' => $subject_e,
'body' => $body_e,
'delete' => DI::l10n()->t('Delete message'),
$body_e = $rr['body'];
$to_name_e = $rr['name'];
- $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr']);
- if (isset($contact["thumb"])) {
- $from_photo = $contact["thumb"];
- } else {
- $from_photo = (($rr['thumb']) ? $rr['thumb'] : $rr['from-photo']);
- }
+ $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']);
+ $from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']);
$rslt .= Renderer::replaceMacros($tpl, [
'$id' => $rr['id'],
'$from_url' => Contact::magicLink($rr['url']),
'$from_addr' => $contact['addr'] ?? '',
'$sparkle' => ' sparkle',
- '$from_photo' => ProxyUtils::proxifyUrl($from_photo, false, ProxyUtils::SIZE_THUMB),
+ '$from_photo' => $from_photo,
'$subject' => $rr['title'],
'$delete' => DI::l10n()->t('Delete conversation'),
'$body' => $body_e,