Trigger an event when account is activated manually.

@param SubscriptionInterface $subscription
@param string                $note
180924
public function triggerSubscriptionCustomActivated(SubscriptionInterface $subscription, $note)
    {
        $this->trigger(self::ON_SUBSCRIPTION_CUSTOM_ACTIVATED, $subscription, $note);
    }
1177512
public function activate()
    {
        if (!$this->active) {
            $this->client->sendFrame(
                $this->getProtocol()->getSubscribeFrame(
                    $this->subscription->getDestination(),
                    $this->subscription->getSubscriptionId(),
                    $this->subscription->getAck(),
                    $this->subscription->getSelector(),
                    true
                )->addHeaders(
                    $this->options->getOptions()
                )
            );
            $this->active = true;
        }
    }
179658
public function addSubscriber(SubscriberInterface $subscriber)
    {
        foreach ($subscriber->getSubscribedEvents() as $eventName => $callable) {
            $this->addListener($eventName, $callable);
        }
    }
153114
private function changeSubscription($subscription, $type)
    {
        if ($subscription->getSubscriberEmail()) {
            $this
                ->filterEmail($subscription->getSubscriberEmail())
                ->filterCustomer($subscription->getCustomerId());

            if ($this->customerModelConfigShare->isWebsiteScope()) {
                $this
                    ->joinWebsite()
                    ->filterWebsite($subscription->getWebsiteId());
            }

            /** @var Subscriber $subscriber |bool */
            $subscriber = $this->subscriptionCollection->fetchItem();

            if (!$subscriber) {
                if ($type !== Subscriber::STATUS_SUBSCRIBED) {
                    return false;
                }

                $subscriber = $this->subscriberFactory->create();
            }

            foreach ($subscription->getData() as $key => $value) {
                $subscriber->setData($key, $value);
            }

            $subscriber->setStatus($type);
            $subscriber->setStatusChanged(true);

            $subscriber->save();
            return true;
        }
        return false;
    }
1174608
public static void registerSubscription(Subscription subscription) {
        mSubscriptions.add(subscription);
        if (isConnected()) {
            executeQuery(subscription.getQuery());
        }
    }
436729
private function genericSubscribeInit($subscribeAction)
    {
        if (isset($this->options[$subscribeAction])) {
            $this->$subscribeAction($this->options[$subscribeAction]);
        }
    }
265712
public function publishState(Subscription $subscription)
    {
        //Pause all non-state building event messages
        $subscription->pauseForState();

        $sessionId = $subscription->getSession()->getSessionId();

        $this->clientSession->call($this->getProcedureName(),
            [$subscription->getUri(), $sessionId, $subscription->getOptions(), $subscription->getSession()->getAuthenticationDetails()])->then(
            function ($res) use ($subscription) {
                $pubId = null;
                if (isset($res[0])) {
                    $pubId = $res[0];
                }
                $subscription->unPauseForState($pubId);
            },
            function ($error) use ($subscription) {
                Logger::error($this, "Could not call '{$this->getProcedureName()}'");
                $subscription->unPauseForState();
            }
        );

    }
439519
public void activate(String clientID) {
        for (Subscription s : m_subscriptions) {
            if (s.clientId.equals(clientID)) {
                s.setActive(true);
            }
        }

        //go deep
        for (TreeNode child : m_children) {
            child.activate(clientID);
        }

    }
542368
public function dispatchSubscribeEvent(NewsletterSubscriptionInterface $newsletterSubscription)
    {
        $newsletterSubscriptionEvent = new NewsletterSubscriptionEvent($newsletterSubscription);
        $this->eventDispatcher->dispatch(
            ElcodiNewsletterEvents::NEWSLETTER_SUBSCRIBE,
            $newsletterSubscriptionEvent
        );
    }
8903
private function tryDispatch(Subscription $subscription, Event $event)
        {
            $dispatched = false;

            try {
                $dispatched = $this->doDispatch($subscription, $event);
            } catch (\Exception $ex) {
                if (! $this->silent) {
                    throw new \RuntimeException('Dispatch triggered an exception', 0, $ex);
                }

                $message = sprintf(self::FMT_ERR_DISPATCH, $event->getId(), $ex->getMessage());

                $this->logger->error($message, array(
                'event-category' => $event->getCategory(),
                'subscription-filter' => $subscription->getCategoryFilter(),
                'subscriber_class' => get_class($subscription->getSubscriber()),
                'message' => $ex->getMessage(),
                'trace' => $ex->getTraceAsString()
                ));
            }

            return $dispatched;
        }
1341418
protected function _attachSubscriber(EventListenerInterface $subscriber)
    {
        foreach ((array)$subscriber->implementedEvents() as $eventKey => $function) {
            $options = [];
            $method = $function;
            if (is_array($function) && isset($function['callable'])) {
                list($method, $options) = $this->_extractCallable($function, $subscriber);
            } elseif (is_array($function) && is_numeric(key($function))) {
                foreach ($function as $f) {
                    list($method, $options) = $this->_extractCallable($f, $subscriber);
                    $this->on($eventKey, $options, $method);
                }
                continue;
            }
            if (is_string($method)) {
                $method = [$subscriber, $function];
            }
            $this->on($eventKey, $options, $method);
        }
    }
325833
public function register($subscribers)
    {
        is_array($subscribers) || $subscribers = [$subscribers];

        foreach ($subscribers as $subscriber) {
            $this->registerSubscriber($subscriber);
        }
    }
883739
public function reactivate($customerId, $subscriptionId, array $attributes = [])
    {
        if (! isset($attributes['plan'])) {
            $subscription = $this->find($customerId, $subscriptionId);

            $attributes['plan'] = $subscription['plan']['id'];
        }

        return $this->update($customerId, $subscriptionId, $attributes);
    }
858189
public function newSubscription(string $subscription, string $plan): SubscriptionBuilder
    {
        return new SubscriptionBuilder($this, $subscription, $plan);
    }
755149
public function it_should_have_listener_after_adding_service_subscriber(MockServiceSubscriber $sub)
    {
        $events = [
            'test1' => [
                [
                    [
                        'containerID1',
                        'method1'
                    ],
                    [
                        'containerID1',
                        'method2'
                    ]
                ]
            ],
            'test2' => [
                [
                    [
                        'containerID1',
                        'method1'
                    ],
                    [
                        'containerID1',
                        'method2'
                    ]
                ]
            ]
        ];
        $this->getServiceListeners()
             ->shouldHaveCount(0);
        $sub->getServiceSubscribedEvents()
            ->willReturn($events);
        $this->addServiceSubscriber($sub);
        $this->getServiceListeners()
             ->shouldHaveCount(2);
        $this->getServiceListeners()
             ->shouldHaveKey('test1');
        $this->getServiceListeners()
             ->shouldHaveKey('test2');
    }
1251926
public boolean register( String clientID , String subscriptionName )
	{
		String key = clientID+"-"+subscriptionName;
		synchronized (subscriptions)
		{
			if (subscriptions.containsKey(key))
				return false;
			
			subscriptions.put(key, new DurableTopicSubscription(System.currentTimeMillis(),
					                                            clientID,
					                                            subscriptionName));
			return true;
		}
	}
101143
public function activateSubscription( $hashString )
    {
        // 1. fetch the subscription object
        $subscription = ezcomSubscription::fetchByHashString( $hashString );
        if ( is_null( $subscription ) )
        {
            $this->tpl->setVariable( 'error_message', ezpI18n::tr( 'ezcomments/comment/activate',
                                      'There is no subscription with the hash string!' ) );
        }
        else
        {
            if ( $subscription->attribute( 'enabled' ) )
            {
                ezDebugSetting::writeNotice( 'extension-ezcomments', 'Subscription activated', __METHOD__ );
            }

            $subscriber = ezcomSubscriber::fetch( $subscription->attribute( 'subscriber_id' ) );

            if ( $subscriber->attribute( 'enabled' ) )
            {
                $subscription->enable();
                $this->tpl->setVariable( 'subscriber', $subscriber );
            }
            else
            {
                $this->tpl->setVariable( 'error_message', ezpI18n::tr( 'ezcomments/comment/activate',
                                      'The subscriber is disabled!' ) );
            }
        }
    }