* Will be executed
* - upon timeout of the mNextProcessingTime
* - when an own message is posted of the owning identity.
*/
public synchronized void process() {
WoTIdentityManager identityManager = (WoTIdentityManager)mFreetalk.getIdentityManager();
checkedActivate(1);
long now = CurrentTimeUTC.getInMillis();
if(mWasHidden && now < mNextProcessingTime)
return;
mWasHidden = false;
try {
MessageManager messageManager = mFreetalk.getMessageManager();
// We must tell the user to solve puzzles if he as written a message ...
if(messageManager.getOwnMessagesBy(getOwner()).size() > 0 // TODO: Optimization: Create & use get(Own)MessageCount() ...
|| messageManager.getMessagesBy(getOwner()).size() > 0) { // Also check for messages which are not stored as own messages anymore.
int minimumTrusterCount = mFreetalk.getConfig().getInt(Configuration.MINIMUM_TRUSTER_COUNT);
// ... and if he has not received enough trust values.
if(identityManager.getReceivedTrustsCount(mOwner) < minimumTrusterCount) {
mPuzzlesToSolve = minimumTrusterCount * 2;
mNextDisplayTime = now;
mNextProcessingTime = now + PROCESSING_INTERVAL; // schedule this task again for processing because introductions are not the only way to get onto trust lists
storeAndCommit();
return;