mirror of
https://github.com/Kopano-dev/kopano-ol-extension.git
synced 2023-10-10 13:37:40 +02:00
[KS-39256] Extra check for invalid group ids in GAB sync.
Added Trace logging to GAB to show all JSON contents.
This commit is contained in:
parent
297271479c
commit
29d9b2d5bf
@ -48,5 +48,10 @@ namespace Acacia.Features.GAB
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
override public string ToString()
|
||||
{
|
||||
return string.Format("{0}/{1}", chunk, numberOfChunks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -465,6 +465,8 @@ namespace Acacia.Features.GAB
|
||||
|
||||
private void ProcessChunkBody(CompletionTracker completion, IZPushItem item, ChunkIndex index)
|
||||
{
|
||||
Logger.Instance.Trace(this, "Parsing chunck: {0}: {1}", index, item.Body);
|
||||
|
||||
// Process the body
|
||||
foreach (var entry in JSONUtils.Deserialise(item.Body))
|
||||
{
|
||||
@ -732,17 +734,25 @@ namespace Acacia.Features.GAB
|
||||
if (Get<ArrayList>(value, "memberOf") != null)
|
||||
{
|
||||
ArrayList members = Get<ArrayList>(value, "memberOf");
|
||||
foreach (string memberOf in members)
|
||||
foreach (object memberOfObject in members)
|
||||
{
|
||||
using (IItem groupItem = FindItemById(memberOf))
|
||||
string memberOf = memberOfObject as string;
|
||||
if (memberOf != null)
|
||||
{
|
||||
Logger.Instance.Debug(this, "Finding group {0} for {1}: {2}", memberOf, id, groupItem?.EntryID);
|
||||
if (groupItem is IDistributionList)
|
||||
using (IItem groupItem = FindItemById(memberOf))
|
||||
{
|
||||
AddGroupMember((IDistributionList)groupItem, item);
|
||||
groupItem.Save();
|
||||
Logger.Instance.Debug(this, "Finding group {0} for {1}: {2}", memberOf, id, groupItem?.EntryID);
|
||||
if (groupItem is IDistributionList)
|
||||
{
|
||||
AddGroupMember((IDistributionList)groupItem, item);
|
||||
groupItem.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger.Instance.Warning(this, "Invalid group: {0}", memberOfObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user