Esempio n. 1
0
 private static void OnIq(object sender, IQ iq)
 {
     try
     {
         if (iq.Query == null) return;
         if (iq.Type != IqType.get) return;
         if (iq.Query.GetType() == typeof(agsXMPP.protocol.iq.version.Version))
         {
             VersionIq _iq = new VersionIq();
             _iq.To = iq.From;
             _iq.Id = iq.Id;
             _iq.Type = IqType.result;
             _iq.Query.Name = "";
             _iq.Query.Ver = "";
             _iq.Query.Os = "";
             _mCon.Send(_iq);
         }
         else
             if (iq.Query.GetType() == typeof(Time))
             {
                 TimeIq _iq = new TimeIq();
                 _iq.To = iq.From;
                 _iq.Id = iq.Id;
                 _iq.Type = IqType.result;
                 _iq.Query.Tz = Common.Now.ToString();
                 _mCon.Send(_iq);
             }
             else
                 if (iq.Query.GetType() == typeof(Ping))
                 {
                     PingIq _iq = new PingIq();
                     _iq.To = iq.From;
                     _iq.Id = iq.Id;
                     _iq.Type = IqType.result;
                     _mCon.Send(_iq);
                 }
     }
     catch (Exception e)
     {
         LogManager.GetLogger("Debug").Error(e.Message);
     }
 }
Esempio n. 2
0
 public void AskVersion(IContact contact)
 {
     VersionIq viq = new VersionIq(IqType.get, contact.FullJid);
     Account.Instance.XmppConnection.IqGrabber.SendIq(viq, new IqCB(VersionIqResult), contact);
 }