internal Presence() { agsXMPP.protocol.client.Presence pres = new agsXMPP.protocol.client.Presence(); pres.Show = agsXMPP.protocol.client.ShowType.xa; pres.Status = "Away from the computer."; pres.Priority = 5; Capabilities caps = new Capabilities(); caps.Node = "http://www.ag-software.de/caps"; caps.Version = "1.1.0"; // don't use the follwing anymore, its deprecated caps.Extensions = new string[] { "rtf", "html-im", "crypt"}; Avatar avatar = new Avatar(); avatar.Hash = "1bb12134f2528c4617fcc393180ddcfcc8462311"; pres.AddChild(caps); pres.AddChild(avatar); Console.WriteLine("Custom Presence Packet:"); Program.Print(pres); }
internal Presence() { agsXMPP.protocol.client.Presence pres = new agsXMPP.protocol.client.Presence(); pres.Show = agsXMPP.protocol.client.ShowType.xa; pres.Status = "Away from the computer."; pres.Priority = 5; Capabilities caps = new Capabilities(); caps.Node = "http://www.ag-software.de/caps"; caps.Version = "1.1.0"; // don't use the follwing anymore, its deprecated caps.Extensions = new string[] { "rtf", "html-im", "crypt" }; Avatar avatar = new Avatar(); avatar.Hash = "1bb12134f2528c4617fcc393180ddcfcc8462311"; pres.AddChild(caps); pres.AddChild(avatar); Console.WriteLine("Custom Presence Packet:"); Program.Print(pres); }
/// <summary> /// Change l'�tat de son status /// </summary> public void applyStatus() { if (Jabber.xmpp.Authenticated) { agsXMPP.protocol.client.Presence p = new agsXMPP.protocol.client.Presence(); p.From = Jabber.xmpp.MyJID; p.Priority = Jabber.xmpp.Priority; p.Type = Enumerations.PresenceTypeConverter(_status.type); if (p.Type == agsXMPP.protocol.client.PresenceType.available) { p.Show = Enumerations.StatusTypeConverter(_status.type); p.Status = _status.message; p.XDelay = new agsXMPP.protocol.x.Delay(); p.XDelay.Stamp = DateTime.Now; p.AddChild(Queries.getCapabilities()); Jabber.xmpp.Show = p.Show; Jabber.xmpp.Status = p.Status; p.Nickname = new agsXMPP.protocol.extensions.nickname.Nickname(Jabber._identity.nickname); } Jabber.xmpp.Send(p); } }