These changes where made on github as #1354 but got lost due mirroring
issued from the development branch. Original author is mexon.
https://github.com/friendica/friendica-addons/pull/1354
msgid "Save Settings"
msgstr ""
msgid "Save Settings"
msgstr ""
-#: mailstream.php:314 mailstream.php:317
+#: mailstream.php:324 mailstream.php:327
msgid "Friendica post"
msgstr ""
msgid "Friendica post"
msgstr ""
msgid "Diaspora post"
msgstr ""
msgid "Diaspora post"
msgstr ""
msgid "Feed item"
msgstr ""
msgid "Feed item"
msgstr ""
msgid "Friendica Item"
msgstr ""
msgid "Friendica Item"
msgstr ""
msgid "Upstream"
msgstr ""
msgid "Upstream"
msgstr ""
+#: mailstream.php:420
+msgid "URI"
+msgstr ""
+
+#: mailstream.php:421
msgid "Enabled"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "Email Address"
msgstr ""
msgid "Email Address"
msgstr ""
msgid "Leave blank to use your account email address"
msgstr ""
msgid "Leave blank to use your account email address"
msgstr ""
msgid "Exclude Likes"
msgstr ""
msgid "Exclude Likes"
msgstr ""
msgid "Check this to omit mailing \"Like\" notifications"
msgstr ""
msgid "Check this to omit mailing \"Like\" notifications"
msgstr ""
msgid "Attach Images"
msgstr ""
msgid "Attach Images"
msgstr ""
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr ""
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr ""
msgid "Mail Stream Settings"
msgstr ""
msgid "Mail Stream Settings"
msgstr ""
-# Aditoo, 2018
-# michal_s <msupler@gmail.com>, 2014
+# Michal Šupler <msupler@gmail.com>, 2014
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-11-21 19:15-0500\n"
-"PO-Revision-Date: 2014-06-23 09:54+0000\n"
-"Last-Translator: Aditoo, 2018\n"
-"Language-Team: Czech (http://app.transifex.com/Friendica/friendica/language/cs/)\n"
+"POT-Creation-Date: 2014-06-23 14:45+0200\n"
+"PO-Revision-Date: 2014-07-07 19:19+0000\n"
+"Last-Translator: Michal Šupler <msupler@gmail.com>\n"
+"Language-Team: Czech (http://www.transifex.com/projects/p/friendica/language/cs/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: cs\n"
-"Plural-Forms: nplurals=4; plural=(n == 1 && n % 1 == 0) ? 0 : (n >= 2 && n <= 4 && n % 1 == 0) ? 1: (n % 1 != 0 ) ? 2 : 3;\n"
+"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
msgid "From Address"
msgstr "Adresa odesílatele"
msgid "From Address"
msgstr "Adresa odesílatele"
msgid "Email address that stream items will appear to be from."
msgstr "Adresa, která vysílá položky, se objeví jako odesílatel."
msgid "Email address that stream items will appear to be from."
msgstr "Adresa, která vysílá položky, se objeví jako odesílatel."
+#: mailstream.php:60 mailstream.php:282
-msgstr "Uložit nastavení"
+msgstr "Uložit Nastavení"
-#: mailstream.php:314 mailstream.php:317
-msgstr "Příspěvek z Friendica"
+msgstr "Friendica příspěvky"
-msgstr "Příspěvek z Diaspora"
+msgstr "Diaspora příspvěvky"
+msgstr "Zdrojová položka"
msgid "Email"
msgstr "E-mail"
msgid "Email"
msgstr "E-mail"
-msgstr "Položka z Friendica"
+msgstr "Friendica položka"
msgid "Upstream"
msgstr "Upstream"
msgid "Upstream"
msgstr "Upstream"
-#: mailstream.php:481
-msgid "Enabled"
-msgstr "Povoleno"
-
-#: mailstream.php:486
msgid "Email Address"
msgstr "E-mailová adresa"
msgid "Email Address"
msgstr "E-mailová adresa"
msgid "Leave blank to use your account email address"
msgstr "Ponechte prázdné pro použití vaší e-mailové adresy"
msgid "Leave blank to use your account email address"
msgstr "Ponechte prázdné pro použití vaší e-mailové adresy"
-#: mailstream.php:492
-msgid "Exclude Likes"
-msgstr "Vynechávat \"lajky\""
-
-#: mailstream.php:494
-msgid "Check this to omit mailing \"Like\" notifications"
-msgstr "Zaškrtnutím vypnete posílání oznámení o \"To se mi líbí\""
-
-#: mailstream.php:498
-msgid "Attach Images"
-msgstr "Připojit obrázky"
-
-#: mailstream.php:500
-msgid ""
-"Download images in posts and attach them to the email. Useful for reading "
-"email while offline."
-msgstr "Stahovat obrázky v příspěvcích a připojovat je k e-mailu. Užitečné pro čtení e-mailu, když jste offline."
+#: mailstream.php:279
+msgid "Enabled"
+msgstr "Povoleno"
msgid "Mail Stream Settings"
msgid "Mail Stream Settings"
-msgstr "Nastavení Mail Stream"
+msgstr "Mail Stream nastavení"
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
if(! function_exists("string_plural_select_cs")) {
function string_plural_select_cs($n){
$n = intval($n);
- if (($n == 1 && $n % 1 == 0)) { return 0; } else if (($n >= 2 && $n <= 4 && $n % 1 == 0)) { return 1; } else if (($n % 1 != 0 )) { return 2; } else { return 3; }
+ if (($n==1)) { return 0; } else if (($n>=2 && $n<=4)) { return 1; } else { return 2; }
}}
$a->strings['From Address'] = 'Adresa odesílatele';
$a->strings['Email address that stream items will appear to be from.'] = 'Adresa, která vysílá položky, se objeví jako odesílatel.';
}}
$a->strings['From Address'] = 'Adresa odesílatele';
$a->strings['Email address that stream items will appear to be from.'] = 'Adresa, která vysílá položky, se objeví jako odesílatel.';
-$a->strings['Save Settings'] = 'Uložit nastavení';
+$a->strings['Save Settings'] = 'Uložit Nastavení';
$a->strings['Re:'] = 'Re:';
$a->strings['Re:'] = 'Re:';
-$a->strings['Friendica post'] = 'Příspěvek z Friendica';
-$a->strings['Diaspora post'] = 'Příspěvek z Diaspora';
-$a->strings['Feed item'] = 'Položka kanálu';
+$a->strings['Friendica post'] = 'Friendica příspěvky';
+$a->strings['Diaspora post'] = 'Diaspora příspvěvky';
+$a->strings['Feed item'] = 'Zdrojová položka';
$a->strings['Email'] = 'E-mail';
$a->strings['Email'] = 'E-mail';
-$a->strings['Friendica Item'] = 'Položka z Friendica';
+$a->strings['Friendica Item'] = 'Friendica položka';
$a->strings['Upstream'] = 'Upstream';
$a->strings['Upstream'] = 'Upstream';
-$a->strings['Local'] = 'Místní';
-$a->strings['Enabled'] = 'Povoleno';
+$a->strings['Local'] = 'Lokální';
$a->strings['Email Address'] = 'E-mailová adresa';
$a->strings['Leave blank to use your account email address'] = 'Ponechte prázdné pro použití vaší e-mailové adresy';
$a->strings['Email Address'] = 'E-mailová adresa';
$a->strings['Leave blank to use your account email address'] = 'Ponechte prázdné pro použití vaší e-mailové adresy';
-$a->strings['Exclude Likes'] = 'Vynechávat "lajky"';
-$a->strings['Check this to omit mailing "Like" notifications'] = 'Zaškrtnutím vypnete posílání oznámení o "To se mi líbí"';
-$a->strings['Attach Images'] = 'Připojit obrázky';
-$a->strings['Download images in posts and attach them to the email. Useful for reading email while offline.'] = 'Stahovat obrázky v příspěvcích a připojovat je k e-mailu. Užitečné pro čtení e-mailu, když jste offline.';
-$a->strings['Mail Stream Settings'] = 'Nastavení Mail Stream';
+$a->strings['Enabled'] = 'Povoleno';
+$a->strings['Mail Stream Settings'] = 'Mail Stream nastavení';
#
# Translators:
# Andreas H., 2014
#
# Translators:
# Andreas H., 2014
-# foss <oss@disr.it>, 2022
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2018
# Ulf Rompe <transifex.com@rompe.org>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
# Tobias Diekershoff <tobias.diekershoff@gmx.net>, 2018
# Ulf Rompe <transifex.com@rompe.org>, 2019
msgid ""
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-11-21 19:15-0500\n"
-"PO-Revision-Date: 2014-06-23 09:54+0000\n"
-"Last-Translator: foss <oss@disr.it>, 2022\n"
-"Language-Team: German (http://app.transifex.com/Friendica/friendica/language/de/)\n"
+"POT-Creation-Date: 2018-03-11 19:13+0100\n"
+"PO-Revision-Date: 2019-02-18 15:05+0000\n"
+"Last-Translator: Ulf Rompe <transifex.com@rompe.org>\n"
+"Language-Team: German (http://www.transifex.com/Friendica/friendica/language/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
msgid "Email address that stream items will appear to be from."
msgstr "E-Mail-Adresse, die in hochgeladenen Artikeln erscheint."
msgid "Email address that stream items will appear to be from."
msgstr "E-Mail-Adresse, die in hochgeladenen Artikeln erscheint."
+#: mailstream.php:82 mailstream.php:380
msgid "Save Settings"
msgstr "Einstellungen speichern"
msgid "Save Settings"
msgstr "Einstellungen speichern"
-#: mailstream.php:314 mailstream.php:317
msgid "Friendica post"
msgstr "Friendica-Veröffentlichung"
msgid "Friendica post"
msgstr "Friendica-Veröffentlichung"
msgid "Diaspora post"
msgstr "Diaspora-Veröffentlichung"
msgid "Diaspora post"
msgstr "Diaspora-Veröffentlichung"
msgid "Feed item"
msgstr "Artikel-Feed"
msgid "Feed item"
msgstr "Artikel-Feed"
msgid "Email"
msgstr "E-Mail"
msgid "Email"
msgstr "E-Mail"
msgid "Friendica Item"
msgstr "Friendica-Artikel"
msgid "Friendica Item"
msgstr "Friendica-Artikel"
msgid "Upstream"
msgstr "Upstream"
msgid "Upstream"
msgstr "Upstream"
msgid "Local"
msgstr "Lokal"
msgid "Local"
msgstr "Lokal"
msgid "Email Address"
msgstr "E-Mail-Adresse"
msgid "Email Address"
msgstr "E-Mail-Adresse"
msgid "Leave blank to use your account email address"
msgstr "Leer lassen für deine Konto-E-Mail-Addresse"
msgid "Leave blank to use your account email address"
msgstr "Leer lassen für deine Konto-E-Mail-Addresse"
msgid "Exclude Likes"
msgstr "Likes ignorieren"
msgid "Exclude Likes"
msgstr "Likes ignorieren"
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Diese Option verhindert das Versenden von \"Like\"-Benachrichtigungen per E-Mail."
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Diese Option verhindert das Versenden von \"Like\"-Benachrichtigungen per E-Mail."
msgid "Attach Images"
msgstr "Bilder anhängen"
msgid "Attach Images"
msgstr "Bilder anhängen"
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Sollen Bilder, die im Beitrag eingebettet sind, als Dateianhang in den E-Mails verschickt werden?"
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Sollen Bilder, die im Beitrag eingebettet sind, als Dateianhang in den E-Mails verschickt werden?"
msgid "Mail Stream Settings"
msgstr "Mail-Nachrichten-Einstellungen"
msgid "Mail Stream Settings"
msgstr "Mail-Nachrichten-Einstellungen"
$a->strings['Friendica Item'] = 'Friendica-Artikel';
$a->strings['Upstream'] = 'Upstream';
$a->strings['Local'] = 'Lokal';
$a->strings['Friendica Item'] = 'Friendica-Artikel';
$a->strings['Upstream'] = 'Upstream';
$a->strings['Local'] = 'Lokal';
-$a->strings['Enabled'] = 'Aktiv';
+$a->strings['Enabled'] = 'eingeschaltet';
$a->strings['Email Address'] = 'E-Mail-Adresse';
$a->strings['Leave blank to use your account email address'] = 'Leer lassen für deine Konto-E-Mail-Addresse';
$a->strings['Exclude Likes'] = 'Likes ignorieren';
$a->strings['Email Address'] = 'E-Mail-Adresse';
$a->strings['Leave blank to use your account email address'] = 'Leer lassen für deine Konto-E-Mail-Addresse';
$a->strings['Exclude Likes'] = 'Likes ignorieren';
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
msgstr ""
"Project-Id-Version: friendica\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-11-21 19:15-0500\n"
-"PO-Revision-Date: 2014-06-23 09:54+0000\n"
-"Last-Translator: fabrixxm <fabrix.xm@gmail.com>, 2014,2018\n"
-"Language-Team: Italian (http://app.transifex.com/Friendica/friendica/language/it/)\n"
+"POT-Creation-Date: 2021-02-01 18:15+0100\n"
+"PO-Revision-Date: 2018-03-19 13:12+0000\n"
+"Last-Translator: fabrixxm <fabrix.xm@gmail.com>\n"
+"Language-Team: Italian (http://www.transifex.com/Friendica/friendica/language/it/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: it\n"
-"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "From Address"
msgstr "Indirizzo di invio"
msgid "From Address"
msgstr "Indirizzo di invio"
msgid "Email address that stream items will appear to be from."
msgstr "Indirizzo email da cui i messaggi appariranno inviati"
msgid "Email address that stream items will appear to be from."
msgstr "Indirizzo email da cui i messaggi appariranno inviati"
+#: mailstream.php:71 mailstream.php:382
msgid "Save Settings"
msgstr "Salva Impostazioni"
msgid "Save Settings"
msgstr "Salva Impostazioni"
-#: mailstream.php:314 mailstream.php:317
msgid "Friendica post"
msgstr "Messaggio Friendica"
msgid "Friendica post"
msgstr "Messaggio Friendica"
msgid "Diaspora post"
msgstr "Messaggio Diaspora"
msgid "Diaspora post"
msgstr "Messaggio Diaspora"
msgid "Feed item"
msgstr "Elemento da feed"
msgid "Feed item"
msgstr "Elemento da feed"
msgid "Email"
msgstr "Email"
msgid "Email"
msgstr "Email"
msgid "Friendica Item"
msgstr "Elemento da Friendica"
msgid "Friendica Item"
msgstr "Elemento da Friendica"
msgid "Upstream"
msgstr "Upstream"
msgid "Upstream"
msgstr "Upstream"
msgid "Local"
msgstr "Locale"
msgid "Local"
msgstr "Locale"
msgid "Enabled"
msgstr "Abilitato"
msgid "Enabled"
msgstr "Abilitato"
msgid "Email Address"
msgstr "Indirizzo Email"
msgid "Email Address"
msgstr "Indirizzo Email"
msgid "Leave blank to use your account email address"
msgstr "Lascia in bianco per usare l'indirizzo email del tuo account"
msgid "Leave blank to use your account email address"
msgstr "Lascia in bianco per usare l'indirizzo email del tuo account"
msgid "Exclude Likes"
msgstr "Escludi \"Mi Piace\""
msgid "Exclude Likes"
msgstr "Escludi \"Mi Piace\""
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Seleziona per evitare di inviare notifiche per \"Mi Piace\""
msgid "Check this to omit mailing \"Like\" notifications"
msgstr "Seleziona per evitare di inviare notifiche per \"Mi Piace\""
msgid "Attach Images"
msgstr "Allega Immagini"
msgid "Attach Images"
msgstr "Allega Immagini"
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Scarica le immagini nei messaggi e le allega alle email. Utile per leggere le email mentre si è offline."
msgid ""
"Download images in posts and attach them to the email. Useful for reading "
"email while offline."
msgstr "Scarica le immagini nei messaggi e le allega alle email. Utile per leggere le email mentre si è offline."
msgid "Mail Stream Settings"
msgstr "Impostazioni Mail Stream"
msgid "Mail Stream Settings"
msgstr "Impostazioni Mail Stream"
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
$n = intval($n);
if(! function_exists("string_plural_select_it")) {
function string_plural_select_it($n){
$n = intval($n);
- if ($n == 1) { return 0; } else if ($n != 0 && $n % 1000000 == 0) { return 1; } else { return 2; }
+ return intval($n != 1);
}}
$a->strings['From Address'] = 'Indirizzo di invio';
$a->strings['Email address that stream items will appear to be from.'] = 'Indirizzo email da cui i messaggi appariranno inviati';
}}
$a->strings['From Address'] = 'Indirizzo di invio';
$a->strings['Email address that stream items will appear to be from.'] = 'Indirizzo email da cui i messaggi appariranno inviati';
Hook::register('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Hook::register('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Hook::register('addon_settings_post', 'addon/mailstream/mailstream.php', 'mailstream_addon_settings_post');
Hook::register('post_local_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
Hook::register('post_remote_end', 'addon/mailstream/mailstream.php', 'mailstream_post_hook');
- Hook::register('cron', 'addon/mailstream/mailstream.php', 'mailstream_cron');
Hook::register('mailstream_send_hook', 'addon/mailstream/mailstream.php', 'mailstream_send_hook');
Logger::info("mailstream: installed");
Hook::register('mailstream_send_hook', 'addon/mailstream/mailstream.php', 'mailstream_send_hook');
Logger::info("mailstream: installed");
/**
* Adds an item in "addon features" in the admin menu of the site
*
/**
* Adds an item in "addon features" in the admin menu of the site
*
+ * @param App $a App object (unused)
* @param string $o HTML form data
*/
* @param string $o HTML form data
*/
-function mailstream_addon_admin(string &$o)
+function mailstream_addon_admin(App $a, string &$o)
{
$frommail = DI::config()->get('mailstream', 'frommail');
$template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
{
$frommail = DI::config()->get('mailstream', 'frommail');
$template = Renderer::getMarkupTemplate('admin.tpl', 'addon/mailstream/');
*/
function mailstream_generate_id(string $uri): string
{
*/
function mailstream_generate_id(string $uri): string
{
- $host = DI::baseUrl()->getHost();
+ $host = DI::baseUrl()->getHostname();
$resource = hash('md5', $uri);
$message_id = "<" . $resource . "@" . $host . ">";
Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri);
return $message_id;
}
$resource = hash('md5', $uri);
$message_id = "<" . $resource . "@" . $host . ">";
Logger::debug('mailstream: Generated message ID ' . $message_id . ' for URI ' . $uri);
return $message_id;
}
-function mailstream_send_hook(array $data)
+function mailstream_send_hook(App $a, array $data)
{
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
$item = Post::selectFirst([], $criteria);
{
$criteria = array('uid' => $data['uid'], 'contact-id' => $data['contact-id'], 'uri' => $data['uri']);
$item = Post::selectFirst([], $criteria);
* mailstream is enabled and the necessary data is available, forks a
* workerqueue item to send the email.
*
* mailstream is enabled and the necessary data is available, forks a
* workerqueue item to send the email.
*
+ * @param App $a App object (unused)
* @param array $item content of the item (may or may not already be stored in the item table)
* @return void
*/
* @param array $item content of the item (may or may not already be stored in the item table)
* @return void
*/
-function mailstream_post_hook(array &$item)
+function mailstream_post_hook(App $a, array &$item)
{
mailstream_check_version();
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
{
mailstream_check_version();
if (!DI::pConfig()->get($item['uid'], 'mailstream', 'enabled')) {
- Logger::debug('mailstream: not enabled for item ' . $item['id']);
+ Logger::debug('mailstream: not enabled.', ['item' => $item['id'], ' uid ' => $item['uid']]);
return;
}
if (!$item['uid']) {
return;
}
if (!$item['uid']) {
Logger::debug('mailstream: no uri for item ' . $item['id']);
return;
}
Logger::debug('mailstream: no uri for item ' . $item['id']);
return;
}
- if (!$item['plink']) {
- Logger::debug('mailstream: no plink for item ' . $item['id']);
+ if ($item['verb'] == Activity::ANNOUNCE) {
+ Logger::debug('mailstream: announce item ', ['item' => $item['id']]);
return;
}
if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
return;
}
if (DI::pConfig()->get($item['uid'], 'mailstream', 'nolikes')) {
$mail->addCustomHeader('In-Reply-To: ' . mailstream_generate_id($item['thr-parent']));
}
$mail->addCustomHeader('X-Friendica-Mailstream-URI: ' . $item['uri']);
$mail->addCustomHeader('In-Reply-To: ' . mailstream_generate_id($item['thr-parent']));
}
$mail->addCustomHeader('X-Friendica-Mailstream-URI: ' . $item['uri']);
- $mail->addCustomHeader('X-Friendica-Mailstream-Plink: ' . $item['plink']);
+ if ($item['plink']) {
+ $mail->addCustomHeader('X-Friendica-Mailstream-Plink: ' . $item['plink']);
+ }
$encoding = 'base64';
foreach ($attachments as $url => $image) {
$mail->AddStringEmbeddedImage(
$encoding = 'base64';
foreach ($attachments as $url => $image) {
$mail->AddStringEmbeddedImage(
$template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/');
$mail->AltBody = BBCode::toPlaintext($item['body']);
$item['body'] = BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::CONNECTORS);
$template = Renderer::getMarkupTemplate('mail.tpl', 'addon/mailstream/');
$mail->AltBody = BBCode::toPlaintext($item['body']);
$item['body'] = BBCode::convertForUriId($item['uri-id'], $item['body'], BBCode::CONNECTORS);
- $item['url'] = DI::baseUrl() . '/display/' . $item['guid'];
+ $item['url'] = DI::baseUrl()->get() . '/display/' . $item['guid'];
$mail->Body = Renderer::replaceMacros($template, [
'$upstream' => DI::l10n()->t('Upstream'),
$mail->Body = Renderer::replaceMacros($template, [
'$upstream' => DI::l10n()->t('Upstream'),
+ '$uri' => DI::l10n()->t('URI'),
'$local' => DI::l10n()->t('Local'),
'$item' => $item]);
'$local' => DI::l10n()->t('Local'),
'$item' => $item]);
- mailstream_html_wrap($mail->Body);
+ $mail->Body = mailstream_html_wrap($mail->Body);
if (!$mail->Send()) {
throw new Exception($mail->ErrorInfo);
}
if (!$mail->Send()) {
throw new Exception($mail->ErrorInfo);
}
* bbcode's output suitable for transmission, we try to break things
* up so that lines are about 200 characters.
*
* bbcode's output suitable for transmission, we try to break things
* up so that lines are about 200 characters.
*
- * @param string $text text to word wrap - modified in-place
+ * @param string $text text to word wrap
+ * @return string wrapped text
*/
function mailstream_html_wrap(string &$text)
{
*/
function mailstream_html_wrap(string &$text)
{
$lines[$i] = preg_replace('/ /', "\n", $lines[$i], 1);
}
$text = implode($lines);
$lines[$i] = preg_replace('/ /', "\n", $lines[$i], 1);
}
$text = implode($lines);
'message_id' => $ms_item_id['message-id'],
'tries' => 0);
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
'message_id' => $ms_item_id['message-id'],
'tries' => 0);
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
- Logger::info('mailstream_cron: Item ' .
- $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id');
+ Logger::info('mailstream_convert_table_entries: item has no message-id.', 'item' => $ms_item_id['id'], 'uri' => $ms_item_id['uri']]);
continue;
}
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
continue;
}
Logger::info('mailstream_convert_table_entries: convert item to workerqueue', $send_hook_data);
/**
* Form for configuring mailstream features for a user
*
/**
* Form for configuring mailstream features for a user
*
+ * @param App $a App object
* @param array $data Hook data array
* @throws \Friendica\Network\HTTPException\ServiceUnavailableException
*/
* @param array $data Hook data array
* @throws \Friendica\Network\HTTPException\ServiceUnavailableException
*/
-function mailstream_addon_settings(array &$data)
+function mailstream_addon_settings(App &$a, array &$data)
{
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'enabled');
$address = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'address');
{
$enabled = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'enabled');
$address = DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'mailstream', 'address');
/**
* Process data submitted to user's mailstream features form
/**
* Process data submitted to user's mailstream features form
* @param array $post POST data
* @return void
*/
* @param array $post POST data
* @return void
*/
-function mailstream_addon_settings_post(array $post)
+function mailstream_addon_settings_post(App $a, array $post)
{
if (!DI::userSession()->getLocalUserId() || empty($post['mailstream-submit'])) {
return;
{
if (!DI::userSession()->getLocalUserId() || empty($post['mailstream-submit'])) {
return;
<div class="mailstream-item-body">{{$item.body nofilter}}</div>
{{if $item.plink}}
<div>{{$upstream}}: <a class="mailstream-item-plink" href="{{$item.plink}}">{{$item.plink}}</a><div>
<div class="mailstream-item-body">{{$item.body nofilter}}</div>
{{if $item.plink}}
<div>{{$upstream}}: <a class="mailstream-item-plink" href="{{$item.plink}}">{{$item.plink}}</a><div>
+<div>{{$uri}}: <a class="mailstream-item-uri" href="{{$item.uri}}">{{$item.uri}}</a><div>
<div>{{$local}}: <a class="mailstream-item-url" href="{{$item.url}}">{{$item.url}}</a></div>
{{/if}}
<div>{{$local}}: <a class="mailstream-item-url" href="{{$item.url}}">{{$item.url}}</a></div>
{{/if}}