- $event['id'] = DBA::lastInsertId();
-
- $item_arr = [];
-
- $item_arr['uid'] = $event['uid'];
- $item_arr['contact-id'] = $event['cid'];
- $item_arr['uri'] = $event['uri'];
- $item_arr['parent-uri'] = $event['uri'];
- $item_arr['guid'] = $event['guid'];
- $item_arr['plink'] = defaults($arr, 'plink', '');
- $item_arr['post-type'] = Item::PT_EVENT;
- $item_arr['wall'] = $event['cid'] ? 0 : 1;
- $item_arr['contact-id'] = $contact['id'];
- $item_arr['owner-name'] = $contact['name'];
- $item_arr['owner-link'] = $contact['url'];
- $item_arr['owner-avatar'] = $contact['thumb'];
- $item_arr['author-name'] = $contact['name'];
- $item_arr['author-link'] = $contact['url'];
- $item_arr['author-avatar'] = $contact['thumb'];
- $item_arr['title'] = '';
- $item_arr['allow_cid'] = $event['allow_cid'];
- $item_arr['allow_gid'] = $event['allow_gid'];
- $item_arr['deny_cid'] = $event['deny_cid'];
- $item_arr['deny_gid'] = $event['deny_gid'];
- $item_arr['private'] = $private;
- $item_arr['visible'] = 1;
- $item_arr['verb'] = ACTIVITY_POST;
- $item_arr['object-type'] = ACTIVITY_OBJ_EVENT;
- $item_arr['origin'] = $event['cid'] === 0 ? 1 : 0;
- $item_arr['body'] = self::getBBCode($event);
- $item_arr['event-id'] = $event['id'];
-
- $item_arr['object'] = '<object><type>' . xmlify(ACTIVITY_OBJ_EVENT) . '</type><title></title><id>' . xmlify($event['uri']) . '</id>';
- $item_arr['object'] .= '<content>' . xmlify(self::getBBCode($event)) . '</content>';
- $item_arr['object'] .= '</object>' . "\n";
-
- $item_id = Item::insert($item_arr);
-
- Addon::callHooks("event_created", $event['id']);
+ $item_id = 0;
+
+ // Don't create an item for birthday events
+ if ($event['type'] == 'event') {
+ $event['id'] = DBA::lastInsertId();
+
+ $item_arr = [];
+
+ $item_arr['uid'] = $event['uid'];
+ $item_arr['contact-id'] = $event['cid'];
+ $item_arr['uri'] = $event['uri'];
+ $item_arr['parent-uri'] = $event['uri'];
+ $item_arr['guid'] = $event['guid'];
+ $item_arr['plink'] = $arr['plink'] ?? '';
+ $item_arr['post-type'] = Item::PT_EVENT;
+ $item_arr['wall'] = $event['cid'] ? 0 : 1;
+ $item_arr['contact-id'] = $contact['id'];
+ $item_arr['owner-name'] = $contact['name'];
+ $item_arr['owner-link'] = $contact['url'];
+ $item_arr['owner-avatar'] = $contact['thumb'];
+ $item_arr['author-name'] = $contact['name'];
+ $item_arr['author-link'] = $contact['url'];
+ $item_arr['author-avatar'] = $contact['thumb'];
+ $item_arr['title'] = '';
+ $item_arr['allow_cid'] = $event['allow_cid'];
+ $item_arr['allow_gid'] = $event['allow_gid'];
+ $item_arr['deny_cid'] = $event['deny_cid'];
+ $item_arr['deny_gid'] = $event['deny_gid'];
+ $item_arr['private'] = $private;
+ $item_arr['visible'] = 1;
+ $item_arr['verb'] = Activity::POST;
+ $item_arr['object-type'] = Activity\ObjectType::EVENT;
+ $item_arr['origin'] = $event['cid'] === 0 ? 1 : 0;
+ $item_arr['body'] = self::getBBCode($event);
+ $item_arr['event-id'] = $event['id'];
+
+ $item_arr['object'] = '<object><type>' . XML::escape(Activity\ObjectType::EVENT) . '</type><title></title><id>' . XML::escape($event['uri']) . '</id>';
+ $item_arr['object'] .= '<content>' . XML::escape(self::getBBCode($event)) . '</content>';
+ $item_arr['object'] .= '</object>' . "\n";
+
+ $item_id = Item::insert($item_arr);
+ }
+
+ Hook::callAll("event_created", $event['id']);