X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=windowsphonepush%2Fwindowsphonepush.php;h=bf160f0a4b1fcb949e0641cc482b6222202faf59;hb=1a9bfc04db2a40072986c33a753455cfe22e9008;hp=908eeb31e6de037e3e632c5362a2cd6beed64367;hpb=147ac6b774d4210f2e2cb7db88edded97e22a128;p=friendica-addons.git diff --git a/windowsphonepush/windowsphonepush.php b/windowsphonepush/windowsphonepush.php index 908eeb31..bf160f0a 100644 --- a/windowsphonepush/windowsphonepush.php +++ b/windowsphonepush/windowsphonepush.php @@ -34,6 +34,7 @@ use Friendica\Core\Logger; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Item; +use Friendica\Model\Post; use Friendica\Model\User; function windowsphonepush_install() @@ -149,7 +150,7 @@ function windowsphonepush_cron() } else { // retrieve the number of unseen items and the id of the latest one (if there are more than // one new entries since last poller run, only the latest one will be pushed) - $count = q("SELECT count(`id`) as count, max(`id`) as max FROM `item` WHERE `unseen` = 1 AND `type` <> 'activity' AND `uid` = %d", intval($rr['uid'])); + $count = q("SELECT count(`id`) as count, max(`id`) as max FROM `post-view` WHERE `unseen` = 1 AND `type` <> 'activity' AND `uid` = %d", intval($rr['uid'])); // send number of unseen items to the device (the number will be displayed on Start screen until // App will be started by user) - this update will be sent every 10 minutes to update the number to 0 if @@ -184,7 +185,7 @@ function windowsphonepush_cron() $senditemtext = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'senditemtext'); if ($senditemtext == 1) { // load item with the max id - $item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]); + $item = Post::selectFirst(['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