apps/activity/lib/GroupHelper.php
/**
	 * Add an activity to the internal array
	 *
	 * @param array $activity
	 */
Add an activity to the internal array
@param array $activity
Add an activity to the internal array @param array $activity
public function addActivity($activity) {
		$id = (int) $activity['activity_id'];
		$event = $this->arrayToEvent($activity);
		$language = $this->l->getLanguageCode();
		foreach ($this->activityManager->getProviders() as $provider) {
			try {
				$this->activityManager->setFormattingObject($event->getObjectType(), $event->getObjectId());
				if ($this->allowGrouping && $this->lastEvent !== 0 && isset($this->event[$this->lastEvent])) {
					$event = $provider->parse($language, $event, $this->event[$this->lastEvent]);
				} else {
					$event = $provider->parse($language, $event);
				}
				$this->activityManager->setFormattingObject('', 0);
				$child = $event->getChildEvent();
				if ($child instanceof IEvent) {
					unset($this->event[$this->lastEvent]);
				}
			} catch (\InvalidArgumentException $e) {
			}
		}
		if (!$event->getParsedSubject()) {
			try {
				$this->activityManager->setFormattingObject($event->getObjectType(), $event->getObjectId());
				$event = $this->legacyParser->parse($language, $event);
				$this->activityManager->setFormattingObject('', 0);
			} catch (\InvalidArgumentException $e) {
				\OC::$server->getLogger()->debug('Failed to parse activity');
				return;
			}
		}
		$this->event[$id] = $event;
		$this->lastEvent = $id;
	}
public function addActivity ( $ activity ) { $ id = ( int ) $ activity [ 'activity_id' ] ; $ event = $ this -> arrayToEvent ( $ activity ) ; $ language = $ this -> l -> getLanguageCode ( ) ; foreach ( $ this -> activityManager -> getProviders ( ) as $ provider ) { try { $ this -> activityManager -> setFormattingObject ( $ event -> getObjectType ( ) , $ event -> getObjectId ( ) ) ; if ( $ this -> allowGrouping && $ this -> lastEvent !== 0 && isset ( $ this -> event [ $ this -> lastEvent ] ) ) { $ event = $ provider -> parse ( $ language , $ event , $ this -> event [ $ this -> lastEvent ] ) ; } else { $ event = $ provider -> parse ( $ language , $ event ) ; } $ this -> activityManager -> setFormattingObject ( '' , 0 ) ; $ child = $ event -> getChildEvent ( ) ; if ( $ child instanceof IEvent ) { unset ( $ this -> event [ $ this -> lastEvent ] ) ; } } catch ( \ InvalidArgumentException $ e ) { } } if ( ! $ event -> getParsedSubject ( ) ) { try { $ this -> activityManager -> setFormattingObject ( $ event -> getObjectType ( ) , $ event -> getObjectId ( ) ) ; $ event = $ this -> legacyParser -> parse ( $ language , $ event ) ; $ this -> activityManager -> setFormattingObject ( '' , 0 ) ; } catch ( \ InvalidArgumentException $ e ) { \ OC :: $ server -> getLogger ( ) -> debug ( 'Failed to parse activity' ) ; return ; } } $ this -> event [ $ id ] = $ event ; $ this -> lastEvent = $ id ; }
Add an activity to the internal array
 @param array $activity
Add an activity to the internal array @param array $activity