acceptStream method

dynamic acceptStream(
  1. AtNotification notification
)

Implementation

acceptStream(AtNotification notification) async {
  _logger.info(
      'Received notification:: id:${notification.id} key:${notification.key} operation:${notification.operation} from:${notification.from} to:${notification.to}');
  if (notification.operation == Operation.update &&
      notification.to == _sdkService.atsign &&
      notification.key.contains(AppConstants.containsFollowing)) {
    await updateFollowers(notification);
    await follows_notification_service.NotificationService()
        .showNotification(notification);
  } else if (notification.operation == Operation.delete &&
      notification.to == _sdkService.atsign &&
      notification.key.contains(AppConstants.containsFollowing)) {
    await deleteFollowers(notification);
  } else if (notification.operation == Operation.delete &&
      notification.to == _sdkService.atsign &&
      notification.key.contains(AppConstants.containsFollowers)) {
    await deleteFollowing(notification);
  }
}