function dispatch_creation_activity_update($post_id)
 {
     if (!function_exists('bp_activity_get')) {
         return false;
     }
     // WTF
     $created = $this->_data->get_option('bp-activity_autoupdate-event_created');
     if (!$created) {
         return false;
     }
     $event = new Eab_EventModel(get_post($post_id));
     if (!$event->is_published()) {
         return false;
     }
     $user_link = bp_core_get_userlink($event->get_author());
     $update = false;
     $group_id = $this->_is_group_event($event->get_id());
     $public_announcement = $this->_is_public_announcement($event->get_id());
     if ('any' == $created) {
         $update = sprintf(__('%s created an event', Eab_EventsHub::TEXT_DOMAIN), $user_link);
     } else {
         if ('group' == $created && $group_id) {
             $group = groups_get_group(array('group_id' => $group_id));
             $group_link = bp_get_group_permalink($group);
             $group_name = bp_get_group_name($group);
             $update = sprintf(__('%s created an event in <a href="%s">%s</a>', Eab_EventsHub::TEXT_DOMAIN), $user_link, $group_link, $group_name);
         } else {
             if ('pa' == $created && $public_announcement) {
                 $update = sprintf(__('%s created a public announcement', Eab_EventsHub::TEXT_DOMAIN), $user_link);
             }
         }
     }
     if (!$update) {
         return false;
     }
     $update = sprintf("{$update}, <a href='%s'>%s</a>", get_permalink($event->get_id()), $event->get_title());
     $existing = bp_activity_get(array("filter" => array("object" => 'eab_events', "action" => 'event_created', 'primary_id' => $event->get_id())));
     if (isset($existing['activities']) && !empty($existing['activities'])) {
         return false;
     }
     $activity = array('action' => $update, 'component' => 'eab_events', 'type' => 'event_created', 'item_id' => $event->get_id(), 'user_id' => $event->get_author());
     bp_activity_add($activity);
     if ($this->_data->get_option('bp-activity_autoupdate-created_group_post') && $group_id) {
         global $bp;
         $group_activity = $activity;
         $group_activity['component'] = $bp->groups->id;
         $group_activity['item_id'] = $group_id;
         $group_activity['secondary_item_id'] = $event->get_id();
         $existing = bp_activity_get(array("filter" => array('user_id' => $user_id, "object" => $bp->groups->id, "action" => 'event_created', 'primary_id' => $group_id, 'secondary_id' => $event->get_id())));
         if (isset($existing['activities']) && !empty($existing['activities'])) {
             $old = reset($existing['activities']);
             if (is_object($old) && isset($old->id)) {
                 $group_activity['id'] = $old->id;
             }
         }
         // Add group activity update
         groups_record_activity($group_activity);
     }
 }