Package plugins.Freetalk.WoT

Examples of plugins.Freetalk.WoT.WoTIdentityManager$WebOfTrustCache


      final String boardName = request.getPartAsStringFailsafe("BoardName", Board.MAX_BOARDNAME_TEXT_LENGTH);
      final String threadID = request.getPartAsStringFailsafe("ThreadID", 128);
      final String messageID = request.getPartAsStringFailsafe("MessageID", 128);
     
      try {
        WoTIdentityManager identityManager = mFreetalk.getIdentityManager();
        WoTMessageManager messageManager = mFreetalk.getMessageManager();
 
        synchronized(identityManager) {
          final WoTOwnIdentity own = (WoTOwnIdentity)webInterface.getLoggedInOwnIdentity(context);
          boolean removeRating = request.getPartAsStringFailsafe("RemoveRating", 16).equals("true");
View Full Code Here


      // ATTENTION: The same code is used in WoT's WebInterface.java. Please synchronize any changes which happen there.
     
        if(!ctx.checkFullAccess(this))
            return;
     
      WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();
     
      ByteArrayInputStream puzzleInputStream = null;
      ByteArrayOutputStream puzzleOutputStream = null;
      Bucket puzzleDataBucket = null;
      FilterStatus filterStatus = null;
      try {
        IntroductionPuzzle puzzle = identityManager.getIntroductionPuzzle(req.getParam("PuzzleID"));
       
        // TODO: Store the list of allowed mime types in a constant. Also consider that we might have introduction puzzles with "Type=Audio" in the future.
        if(!puzzle.MimeType.equalsIgnoreCase("image/jpeg") &&
            !puzzle.MimeType.equalsIgnoreCase("image/gif") &&
            !puzzle.MimeType.equalsIgnoreCase("image/png")) {
View Full Code Here

           
            boolean autoSubscribeToNNTPBoards = mRequest.getPartAsStringFailsafe("AutoSubscribeToNNTPBoards", 4).equals("true");
           
            boolean allowImageDisplay = mRequest.getPartAsStringFailsafe("DisplayImages", 4).equals("true");
           
            WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();
           
            synchronized(identityManager) {
              try {
                // Ensure that the identity still exists.
                WoTOwnIdentity identity = identityManager.getOwnIdentity(mOwnIdentity.getID());
               
                synchronized (identity) {
                  identity.setAutoSubscribeToNewboards(autoSubscribeToNewBoards);
                  identity.setNntpAutoSubscribeBoards(autoSubscribeToNNTPBoards);
                  identity.setWantsImageDisplay(allowImageDisplay);
View Full Code Here

    super(myWebInterface, viewer, request);
  }

  @Override
  public void make() throws RedirectException {
    final WoTIdentityManager identityManager = mFreetalk.getIdentityManager();
    final WoTMessageManager messageManager = mFreetalk.getMessageManager();
   
    synchronized(identityManager)
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.IdentityStatistics.Title"));
      statsbox.addChild("p", l10n().getString("StatisticsPage.IdentityStatistics.NonOwnIdentities") + " " + identityManager.countKnownIdentities());
      statsbox.addChild("p", l10n().getString("StatisticsPage.IdentityStatistics.OwnIdentities") + " " + identityManager.ownIdentityIterator().size());
    }

    synchronized(messageManager) {
    {
      HTMLNode statsbox = addContentBox(l10n().getString("StatisticsPage.MessageListStatistics.Title"));
View Full Code Here

   
    DateFormat dateFormat = DateFormat.getInstance();
   
    HTMLNode table = threadsTable.addChild("tbody");
   
    final WoTIdentityManager identityManager = mFreetalk.getIdentityManager();
   
    // TODO: We don't want to lock the identity manager here to make the displaying of the board FAST - it shouldn't wait until the lock
    // is available: Introduce a non-locking getIdentity() in the identity manager and use it - the locking one will cause deadlocks
    // if we do not lock the identity manager before the board.
    synchronized(identityManager) {
    synchronized(mBoard) {
        boolean firstUnread = true;
       
      for(BoardThreadLink threadReference : mBoard.getThreads()) {
        // TODO: The author in the threadReference is guessed from the ID if the thread was not downloaded...
        // we should display a warning that the fact "the original thread was written by X" might not be true because
        // thread-IDs can be spoofed - dunno how to do that in the table, maybe with colors?
       
        String authorText;
        String authorScore;
       
        // Author related stuff
        {
          Identity author = null;
         
          // TODO: Use a colored "unknown" if the author/score is unknown
          // TODO: Use a special color if author == yourself
          authorText = "?"; // TODO: l10n
          authorScore = "?";
         
          try {
            author = identityManager.getIdentity(threadReference.getAuthorID());
            authorText = author.getShortestUniqueName();
           
            // TODO: Get rid of the cast somehow, we should maybe call this WoTBoardPage :|
            final int score = ((WoTOwnIdentity)mOwnIdentity).getScoreFor((WoTIdentity)author);
            if (score == Integer.MAX_VALUE)
View Full Code Here

      parent.addChild("#", lines[i]);
    }
  }

  private void addTrustersInfo(HTMLNode parent, Identity author) throws Exception {
    WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();

    int trustedBy = identityManager.getReceivedTrustsCount(author, 1);
    int distrustedBy = identityManager.getReceivedTrustsCount(author, -1);

    parent.addChild("abbr", new String[]{"title", "class"}, new String[]{ l10n().getString("Common.WebOfTrust.TrustedByCount.Description"), "trust-count"},
        String.valueOf(trustedBy));

    parent.addChild("#", " / ");
View Full Code Here

    parent.addChild("abbr", new String[]{"title", "class"}, new String[]{ l10n().getString("Common.WebOfTrust.DistrustedByCount.Description"), "distrust-count"},
        String.valueOf(distrustedBy));
  }

  private void addTrusteesInfo(HTMLNode parent, Identity author) throws Exception {
    WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();

    int trustsCount = identityManager.getGivenTrustsCount(author, 1);
    int distrustsCount = identityManager.getGivenTrustsCount(author, -1);

    parent.addChild("abbr", new String[]{"title", "class"},
        new String[]{ l10n().getString("Common.WebOfTrust.PositiveGivenTrustsCount.Description"), "trust-count"},
        String.valueOf(trustsCount));
View Full Code Here

  private void rateMessage(byte value) {
    if(value == 0) // No change
      return;

    try {
      WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();
      WoTMessageManager messageManager = (WoTMessageManager)mFreetalk.getMessageManager();

      synchronized(identityManager) {
      synchronized (messageManager) {
        WoTMessage message = (WoTMessage)messageManager.get(mParentMessage.getID()); // It might have be deleted meanwhile, we must re-query
View Full Code Here

   
    mConfig = Configuration.loadOrCreate(this, db);
    if(mConfig.getDatabaseFormatVersion() != Freetalk.DATABASE_FORMAT_VERSION)
      throw new RuntimeException("The Freetalk plugin's database format is newer than the Freetalk plugin which is being used.");
   
    mIdentityManager = new WoTIdentityManager(this);
    mMessageManager = new WoTMessageManager(this);
    mTaskManager = new PersistentTaskManager(this, db);
  }
View Full Code Here

      throw new RuntimeException("The Freetalk plugin's database format is newer than the Freetalk plugin which is being used.");
   
    // Create & start the core classes
   
    if(logDEBUG) Logger.debug(this, "Creating identity manager...");
    mIdentityManager = new WoTIdentityManager(this, mPluginRespirator.getNode().executor);
   
    if(logDEBUG) Logger.debug(this, "Creating message manager...");
    mMessageManager = new WoTMessageManager(db, mIdentityManager, this, mPluginRespirator);
   
    if(logDEBUG) Logger.debug(this, "Creating task manager...");
View Full Code Here

TOP

Related Classes of plugins.Freetalk.WoT.WoTIdentityManager$WebOfTrustCache

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.