]> git.mxchange.org Git - friendica.git/blobdiff - mod/events.php
Merge pull request #9995 from annando/issue-9948
[friendica.git] / mod / events.php
index 04a88e98bb5056eb2d845ffe65e53b9b822086e6..50ffd41a4276be549059f0d132d591bd2473d939 100644 (file)
@@ -34,6 +34,7 @@ use Friendica\DI;
 use Friendica\Model\Conversation;
 use Friendica\Model\Event;
 use Friendica\Model\Item;
+use Friendica\Model\Post;
 use Friendica\Model\User;
 use Friendica\Module\BaseProfile;
 use Friendica\Module\Security\Login;
@@ -215,10 +216,10 @@ function events_post(App $a)
                exit();
        }
 
-       $item_id = Event::store($datarray);
+       $uri_id = Event::store($datarray);
 
        if (!$cid) {
-               Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $item_id);
+               Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$uri_id, (int)$uid);
        }
 
        DI::baseUrl()->redirect('events');
@@ -589,7 +590,7 @@ function events_content(App $a)
                        Item::deleteForUser(['id' => $ev[0]['itemid']], local_user());
                }
 
-               if (Item::exists(['id' => $ev[0]['itemid']])) {
+               if (Post::exists(['id' => $ev[0]['itemid']])) {
                        notice(DI::l10n()->t('Failed to remove event'));
                }