/// <summary>
/// Send message to HarmonyHub to request Configuration.
/// Result is parsed by OnIq based on ClientCommandType
/// </summary>
public void GetConfig()
{
EnsureConnection();
var iqToSend = new IQ { Type = IqType.get, Namespace = "", From = "1", To = "guest" };
iqToSend.AddChild(HarmonyDocuments.ConfigDocument());
iqToSend.GenerateId();
var iqGrabber = new IqGrabber(Xmpp);
var iq = iqGrabber.SendIq(iqToSend, 10000);
if (iq != null)
{
var match = IdentityRegex.Match(iq.InnerXml);
if (match.Success)
{
RawConfig = match.Groups[1].ToString();
Config = null;
try
{
Config = new JavaScriptSerializer().Deserialize<HarmonyConfigResult>(RawConfig);
}
catch { }
}
}
}