mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
More debug options
This commit is contained in:
parent
af9abbe196
commit
112a7cf26a
@ -118,6 +118,15 @@ namespace Acacia.Features.GAB
|
|||||||
}
|
}
|
||||||
private static readonly BoolOption OPTION_PROCESS_MESSAGE = new BoolOption("ProcessMessage", true);
|
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. " +
|
[AcaciaOption("If disabled, contacts are not created from incoming GAB messages. " +
|
||||||
"This should only be disabled for debug purposes.")]
|
"This should only be disabled for debug purposes.")]
|
||||||
public bool CreateContacts
|
public bool CreateContacts
|
||||||
|
@ -268,18 +268,21 @@ namespace Acacia.Features.GAB
|
|||||||
_feature?.BeginProcessing();
|
_feature?.BeginProcessing();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Delete the old contacts from this chunk
|
if (_feature.ProcessMessageDeleteExisting)
|
||||||
using (ISearch<IItem> search = Contacts.Search<IItem>())
|
|
||||||
{
|
{
|
||||||
search.AddField(PROP_SEQUENCE, true).SetOperation(SearchOperation.Equal, index.numberOfChunks);
|
// Delete the old contacts from this chunk
|
||||||
search.AddField(PROP_CHUNK, true).SetOperation(SearchOperation.Equal, index.chunk);
|
using (ISearch<IItem> search = Contacts.Search<IItem>())
|
||||||
foreach (IItem oldItem in search.Search())
|
|
||||||
{
|
{
|
||||||
// TODO: Search should handle this, like folder enumeration
|
search.AddField(PROP_SEQUENCE, true).SetOperation(SearchOperation.Equal, index.numberOfChunks);
|
||||||
using (oldItem)
|
search.AddField(PROP_CHUNK, true).SetOperation(SearchOperation.Equal, index.chunk);
|
||||||
|
foreach (IItem oldItem in search.Search())
|
||||||
{
|
{
|
||||||
Logger.Instance.Trace(this, "Deleting GAB entry: {0}", oldItem.Subject);
|
// TODO: Search should handle this, like folder enumeration
|
||||||
oldItem.Delete();
|
using (oldItem)
|
||||||
|
{
|
||||||
|
Logger.Instance.Trace(this, "Deleting GAB entry: {0}", oldItem.Subject);
|
||||||
|
oldItem.Delete();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user