Package net.pterodactylus.sone.freenet.wot

Examples of net.pterodactylus.sone.freenet.wot.Trust


    @SuppressWarnings("synthetic-access")
    public void run() {
      try {
        if (score != null) {
          if (trustee instanceof DefaultIdentity) {
            ((DefaultIdentity) trustee).setTrust(truster, new Trust(score, null, 0));
          }
          webOfTrustConnector.setTrust(truster, trustee, score, comment);
        } else {
          if (trustee instanceof DefaultIdentity) {
            ((DefaultIdentity) trustee).setTrust(truster, null);
View Full Code Here


    Sone postSone = post.getSone();
    if (postSone == null) {
      return false;
    }
    if (sone != null) {
      Trust trust = postSone.getIdentity().getTrust((OwnIdentity) sone.getIdentity());
      if (trust != null) {
        if ((trust.getExplicit() != null) && (trust.getExplicit() < 0)) {
          return false;
        }
        if ((trust.getExplicit() == null) && (trust.getImplicit() != null) && (trust.getImplicit() < 0)) {
          return false;
        }
      } else {
        /*
         * a null trust means that the trust updater has not yet
View Full Code Here

  /**
   * {@inheritDoc}
   */
  @Override
  public Object get(TemplateContext templateContext, Object object, String member) {
    Trust trust = (Trust) object;
    if ("assigned".equals(member)) {
      return trust.getExplicit() != null;
    } else if ("maximum".equals(member)) {
      return ((trust.getExplicit() != null) && (trust.getExplicit() >= 100)) || ((trust.getImplicit() != null) && (trust.getImplicit() >= 100));
    } else if ("hasDistance".equals(member)) {
      return (trust.getDistance() != null) && (trust.getDistance() != Integer.MAX_VALUE);
    }
    return super.get(templateContext, object, member);
  }
View Full Code Here

        return avatarId;
      }
      if (showCustomAvatars == ShowCustomAvatars.FOLLOWED) {
        return currentSone.hasFriend(remoteSone.getId()) ? avatarId : null;
      }
      Trust trust = remoteSone.getIdentity().getTrust((OwnIdentity) currentSone.getIdentity());
      if (trust == null) {
        return null;
      }
      if ((showCustomAvatars == ShowCustomAvatars.MANUALLY_TRUSTED) && (trust.getExplicit() != null) && (trust.getExplicit() > 0)) {
        return avatarId;
      }
      if ((showCustomAvatars == ShowCustomAvatars.TRUSTED) && (((trust.getExplicit() != null) && (trust.getExplicit() > 0)) || ((trust.getImplicit() != null) && (trust.getImplicit() > 0)))) {
        return avatarId;
      }
      return null;
    }
    return super.get(templateContext, object, member);
View Full Code Here

    } else if (member.equals("trust")) {
      Sone currentSone = (Sone) templateContext.get("currentSone");
      if (currentSone == null) {
        return null;
      }
      Trust trust = sone.getIdentity().getTrust((OwnIdentity) currentSone.getIdentity());
      logger.log(Level.FINEST, String.format("Trust for %s by %s: %s", sone, currentSone, trust));
      if (trust == null) {
        return new Trust(null, null, null);
      }
      return trust;
    } else if (member.equals("allImages")) {
      return from(asList(sone.getRootAlbum())).transformAndConcat(FLATTENER).transformAndConcat(IMAGES);
    } else if (member.equals("albums")) {
View Full Code Here

TOP

Related Classes of net.pterodactylus.sone.freenet.wot.Trust

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.