Beispiel #1
0
 private void OnXml(object sender, string xml)
 {
     xml = Strings.Replace(xml, "\"", "'", 1, -1, CompareMethod.Text);
     if (((Strings.InStr(xml, "<query xmlns='jabber:iq:roster'>", CompareMethod.Binary) != 0)))
     {
         xmlLister = new listBox();
         this.a    = xml.Split(new char[] { '<' });
         int num4 = Information.UBound(this.a, 1);
         for (int j = Information.LBound(this.a, 1); j <= num4; j++)
         {
             if ((Strings.InStr(this.a[j], "'both'", CompareMethod.Binary) != 0))
             {
                 string addBoth;
                 addBoth        = a[j].Substring(a[j].IndexOf("jid='") + 5);
                 addBoth        = addBoth.Substring(0, addBoth.IndexOf("'") - 0);
                 xmlLister.Dock = DockStyle.Top;
                 Form1 xx = new Form1();
                 xmlLister.AddItem(addBoth);
                 Nizzc_Collection.loading ld = new Nizzc_Collection.loading();
                 ld.info("Loaded AddList: " + xmlLister.Items.Count);
             }
             if ((Strings.InStr(this.a[j], "/iq>", CompareMethod.Binary) != 0))
             {
                 if (x.Authenticated)
                 {
                     Nizzc_Collection.loading ld = new Nizzc_Collection.loading();
                     for (int i = 0; i < xmlLister.Items.Count; ++i)
                     {
                         this.x.Send(new agsXMPP.protocol.client.Message(new agsXMPP.Jid(xmlLister.Items[i].ToString()), agsXMPP.protocol.client.MessageType.chat, MTAP, Subject));
                         ld.info("Message sent to: " + xmlLister.Items[i] + "(" + i + "/" + xmlLister.Items.Count + ")");
                         ld.info(xmlLister.Items.Count, i);
                         if (i == xmlLister.Items.Count - 1)
                         {
                             Form1.x.Send(new agsXMPP.protocol.client.Message(new agsXMPP.Jid(sender1 + "@nimbuzz.com"), agsXMPP.protocol.client.MessageType.chat, mc[39].Replace("[MESSAGE]$", "").Replace("%L%", Environment.NewLine)));
                             x.Close();
                             ld.info("Message is sent to " + xmlLister.Items.Count + " Users");
                             Nizzc_Collection.loading ldg = new Nizzc_Collection.loading();
                             ldg.Sent();
                         }
                     }
                 }
             }
         }
     }
 }
Beispiel #2
0
 private void OnXML(object sender, string xml)
 {
     string[] mc = Messages.Lines;
     xml = Strings.Replace(xml, "\"", "'", 1, -1, CompareMethod.Text);
     if (((Strings.InStr(xml, "<query xmlns='jabber:iq:roster'>", CompareMethod.Binary) != 0)))
     {
         XmlLister = new listBox();
         this.a    = xml.Split(new char[] { '<' });
         int num4 = Information.UBound(this.a, 1);
         for (int j = Information.LBound(this.a, 1); j <= num4; j++)
         {
             if ((Strings.InStr(this.a[j], "'both'", CompareMethod.Binary) != 0))
             {
                 string addBoth;
                 addBoth        = a[j].Substring(a[j].IndexOf("jid='") + 5);
                 addBoth        = addBoth.Substring(0, addBoth.IndexOf("'") - 0);
                 XmlLister.Dock = DockStyle.Top;
                 Form1 xx = new Form1();
                 XmlLister.AddItem(addBoth);
             }
             if ((Strings.InStr(this.a[j], "/iq>", CompareMethod.Binary) != 0))
             {
                 if (x.Authenticated)
                 {
                     for (int i = 0; i < XmlLister.Items.Count; ++i)
                     {
                         this.x.Send(new agsXMPP.protocol.client.Message(new agsXMPP.Jid(XmlLister.Items[i].ToString()), agsXMPP.protocol.client.MessageType.chat, MTAMess, Subject));
                         if (i == XmlLister.Items.Count - 1)
                         {
                             x1.Send(new agsXMPP.protocol.client.Message(new agsXMPP.Jid(sender1 + "@nimbuzz.com"), agsXMPP.protocol.client.MessageType.chat, mc[39].Replace("[MESSAGE]$", "").Replace("%L%", Environment.NewLine)));
                             x.Close();
                         }
                     }
                 }
             }
         }
     }
 }