private void beforeIdentityDeletion(Identity identity) {
    Logger.normal(this, "beforeIdentityDeletion " + identity);

    doIdentityDeletedCallbacks(identity);

    if (!(identity instanceof OwnIdentity)) // Don't call it twice
    onShouldFetchStateChanged(identity, true, false);
  }
  private void onNewIdentityAdded(Identity identity) {
    Logger.normal(this, "onNewIdentityAdded " + identity);

    mShortestUniqueNicknameCacheNeedsUpdate = true;

    doNewIdentityCallbacks(identity);

    if (!(identity instanceof OwnIdentity)) onShouldFetchStateChanged(identity, false, true);
  }
  /**
   * Called by this WoTIdentityManager after a new WoTIdentity has been stored to the database and
   * before committing the transaction.
   *
   * <p>You have to lock this WoTIdentityManager, the PersistentTaskManager and the database before
   * calling this function.
   *
   * @param newIdentity
   * @throws Exception If adding the Freetalk context to the identity in WoT failed.
   */
  private void onNewOwnIdentityAdded(OwnIdentity identity) {
    Logger.normal(this, "onNewOwnIdentityAdded " + identity);

    WoTOwnIdentity newIdentity = (WoTOwnIdentity) identity;

    // TODO: Do after an own message is posted. I have not decided at which place to do this :|
    try {
      addFreetalkContext(newIdentity);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    PersistentTask introductionTask = new IntroduceIdentityTask((WoTOwnIdentity) newIdentity);
    mFreetalk.getTaskManager().storeTaskWithoutCommit(introductionTask);

    doNewOwnIdentityCallbacks(newIdentity);
    onShouldFetchStateChanged(newIdentity, false, true);
  }
  private void beforeOwnIdentityDeletion(OwnIdentity identity) {
    Logger.normal(this, "beforeOwnIdentityDeletion " + identity);

    doOwnIdentityDeletedCallbacks(identity);
    onShouldFetchStateChanged(identity, true, false);
  }