Пример #1
0
    def _Notify(self):
        """Creates notifications:
       1. Notifies removed followers that conversation has new activity.
       2. Notifies users with contacts that have become prospective users.
       3. Notifies existing followers of the viewpoint that new followers have been added.
       4. Notifies new followers that they have been added to a viewpoint.
    """
        # Creates notifications for any new prospective users.
        identity_keys = [
            contact_dict['identity']
            for contact_dict, (
                user_exists, user_id,
                webapp_dev_id) in zip(self._contact_dicts, self._contact_ids)
            if not user_exists
        ]
        yield NotificationManager.NotifyCreateProspective(
            self._client, identity_keys, self._op.timestamp)

        # Creates notifications for any revived followers.
        yield NotificationManager.NotifyReviveFollowers(
            self._client, self._viewpoint_id, self._revive_follower_ids,
            self._op.timestamp)

        # Creates notification of new viewpoint for each new follower.
        yield NotificationManager.NotifyAddFollowers(
            self._client, self._viewpoint_id, self._existing_followers,
            self._new_followers, self._contact_user_ids, self._act_dict,
            self._op.timestamp)
Пример #2
0
    def _Notify(self):
        """Creates notifications:
       1. Notifies removed followers that conversation has new activity.
       2. Notifies existing followers of the viewpoint that photos have been added.
    """
        # Creates notifications for any revived followers.
        yield NotificationManager.NotifyReviveFollowers(
            self._client, self._viewpoint_id, self._revive_follower_ids,
            self._op.timestamp)

        # Notify followers of the changes made by the share operation.
        yield NotificationManager.NotifyShareExisting(
            self._client, self._viewpoint_id, self._followers, self._act_dict,
            self._ep_dicts, self._need_cover_photo)
Пример #3
0
    def _Notify(self):
        """Creates notifications:
       1. Notifies removed followers that conversation has new activity.
       2. Notifies existing followers of the viewpoint that metadata has changed.
    """
        # Creates notifications for any revived followers.
        yield NotificationManager.NotifyReviveFollowers(
            self._client, self._viewpoint_id, self._revive_follower_ids,
            self._op.timestamp)

        # Notifies followers that viewpoint metadata has changed.
        yield NotificationManager.NotifyUpdateViewpoint(
            self._client, self._vp_dict, self._followers, self._prev_values,
            self._act_dict)
Пример #4
0
  def _Notify(self):
    """Creates notifications:
       1. Notifies removed followers that conversation has new activity.
       2. Notifies existing followers of the viewpoint that a new comment has been added.
    """
    # Creates notifications for any revived followers.
    yield NotificationManager.NotifyReviveFollowers(self._client,
                                                    self._viewpoint_id,
                                                    self._revive_follower_ids,
                                                    self._op.timestamp)

    # Notifies followers that a comment has been added.
    yield NotificationManager.NotifyPostComment(self._client,
                                                self._followers,
                                                self._act_dict,
                                                self._cm_dict)