More debug options

This commit is contained in:
Patrick Simpson 2017-02-08 16:54:47 +01:00
parent 7e05792d8c
commit 3117418785
2 changed files with 21 additions and 9 deletions

View File

@ -118,6 +118,15 @@ namespace Acacia.Features.GAB
}
private static readonly BoolOption OPTION_PROCESS_MESSAGE = new BoolOption("ProcessMessage", true);
[AcaciaOption("If disabled, existing contacts are not deleted when a chunk is processed. " +
"This should only be disabled for debug purposes.")]
public bool ProcessMessageDeleteExisting
{
get { return GetOption(OPTION_PROCESS_MESSAGE_DELETE_EXISTING); }
set { SetOption(OPTION_PROCESS_MESSAGE_DELETE_EXISTING, value); }
}
private static readonly BoolOption OPTION_PROCESS_MESSAGE_DELETE_EXISTING = new BoolOption("ProcessMessageDeleteExisting", true);
[AcaciaOption("If disabled, contacts are not created from incoming GAB messages. " +
"This should only be disabled for debug purposes.")]
public bool CreateContacts

View File

@ -267,6 +267,8 @@ namespace Acacia.Features.GAB
Logger.Instance.Trace(this, "Processing: {0} - {1} - {2}", item.Subject, item.Location, lastProcessed);
_feature?.BeginProcessing();
try
{
if (_feature.ProcessMessageDeleteExisting)
{
// Delete the old contacts from this chunk
using (ISearch<IItem> search = Contacts.Search<IItem>())
@ -283,6 +285,7 @@ namespace Acacia.Features.GAB
}
}
}
}
// Create the new contacts
ProcessChunkBody(item, index);