use Friendica\App;
use Friendica\Content\Text\BBCode;
+use Friendica\Content\Text\HTML;
use Friendica\Core\Addon;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
use Friendica\Model\User;
+use Friendica\Model\Item;
function windowsphonepush_install()
{
$senditemtext = PConfig::get($rr['uid'], 'windowsphonepush', 'senditemtext');
if ($senditemtext == 1) {
// load item with the max id
- $item = q("SELECT `author-name` as author, `body` as body FROM `item` where `id` = %d", intval($count[0]['max']));
+ $item = Item::selectFirst(local_user(), ['author-name', 'body'], ['id' => $count[0]['max']]);
// as user allows to send the item, we want to show the sender of the item in the toast
// toasts are limited to one line, therefore place is limited - author shall be in
// max. 15 chars (incl. dots); author is displayed in bold font
- $author = $item[0]['author'];
+ $author = $item['author-name'];
$author = ((strlen($author) > 12) ? substr($author, 0, 12) . "..." : $author);
// normally we show the body of the item, however if it is an url or an image we cannot
// show this in the toast (only test), therefore changing to an alternate text
// Otherwise BBcode-Tags will be eliminated and plain text cutted to 140 chars (incl. dots)
// BTW: information only possible in English
- $body = $item[0]['body'];
+ $body = $item['body'];
if (substr($body, 0, 4) == "[url") {
$body = "URL/Image ...";
} else {
- require_once("include/html2plain.php");
-
$body = BBCode::convert($body, false, 2, true);
- $body = html2plain($body, 0);
+ $body = HTML::toPlaintext($body, 0);
$body = ((strlen($body) > 137) ? substr($body, 0, 137) . "..." : $body);
}
} else {