Пример #1
0
 /// <summary>
 /// Change la lecture en cours
 /// </summary>
 /// <param name="utune">Informations sur la lecture en cours</param>
 public void setTune(Tune utune)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/tune");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element tune = new agsXMPP.Xml.Dom.Element("tune");
         tune.Namespace = "http://jabber.org/protocol/tune";
         tune.AddChild(new agsXMPP.Xml.Dom.Element("length", Convert.ToString(utune.length, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("rating", Convert.ToString(utune.rating, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("track", Convert.ToString(utune.track, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("artist", (utune.artist != null) ? utune.artist.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("source", (utune.source != null) ? utune.source.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("title", (utune.title != null) ? utune.title.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("uri", (utune.uri != null) ? utune.uri.Trim() : string.Empty));
         item.AddChild(tune);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf   = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x      = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _tune        = new Tune();
         _tune.artist = (utune.artist != null) ? utune.artist.Trim() : string.Empty;
         _tune.length = utune.length;
         _tune.rating = utune.rating;
         _tune.source = (utune.source != null) ? utune.source.Trim() : string.Empty;
         _tune.title  = (utune.title != null) ? utune.title.Trim() : string.Empty;
         _tune.track  = utune.track;
         _tune.uri    = (utune.uri != null) ? utune.uri.Trim() : string.Empty;
     }
 }
Пример #2
0
 /// <summary>
 /// Suprimme la notification de ce que j'�coute
 /// </summary>
 public void clearTune()
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/tune");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element tune = new agsXMPP.Xml.Dom.Element("tune");
         tune.Namespace = "http://jabber.org/protocol/tune";
         item.AddChild(tune);
         ps.AddChild(item);
         pb.AddChild(ps);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _tune        = new Tune();
         _tune.artist = string.Empty;
         _tune.length = 0;
         _tune.rating = 1;
         _tune.source = string.Empty;
         _tune.title  = string.Empty;
         _tune.track  = 0;
         _tune.uri    = string.Empty;
     }
 }
Пример #3
0
 /// <summary>
 /// Change son activit�
 /// </summary>
 /// <param name="type">Type de l'activit�</param>
 /// <param name="text">Description</param>
 public void setActivity(Enumerations.ActivityType type, string text)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/activity");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element activity = new agsXMPP.Xml.Dom.Element("activity");
         activity.Namespace = "http://jabber.org/protocol/activity";
         agsXMPP.Xml.Dom.Element activityType = new agsXMPP.Xml.Dom.Element(Enum.GetName(typeof(Enumerations.ActivityType), type));
         activity.AddChild(activityType);
         agsXMPP.Xml.Dom.Element activityText = new agsXMPP.Xml.Dom.Element("text");
         activityText.Value = text;
         activity.AddChild(activityText);
         item.AddChild(activity);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf   = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x      = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _activity      = new Activity();
         _activity.type = type;
         _activity.text = text;
     }
 }
Пример #4
0
 /// <summary>
 /// Suprimme la notification de ce que j'�coute
 /// </summary>
 public void clearTune()
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/tune");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element tune = new agsXMPP.Xml.Dom.Element("tune");
         tune.Namespace = "http://jabber.org/protocol/tune";
         item.AddChild(tune);
         ps.AddChild(item);
         pb.AddChild(ps);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _tune = new Tune();
         _tune.artist = string.Empty;
         _tune.length = 0;
         _tune.rating = 1;
         _tune.source = string.Empty;
         _tune.title = string.Empty;
         _tune.track = 0;
         _tune.uri = string.Empty;
     }
 }
Пример #5
0
 /// <summary>
 /// Change la lecture en cours
 /// </summary>
 /// <param name="utune">Informations sur la lecture en cours</param>
 public void setTune(Tune utune)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/tune");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element tune = new agsXMPP.Xml.Dom.Element("tune");
         tune.Namespace = "http://jabber.org/protocol/tune";
         tune.AddChild(new agsXMPP.Xml.Dom.Element("length", Convert.ToString(utune.length, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("rating", Convert.ToString(utune.rating, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("track", Convert.ToString(utune.track, System.Globalization.CultureInfo.InvariantCulture)));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("artist", (utune.artist != null) ? utune.artist.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("source", (utune.source != null) ? utune.source.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("title", (utune.title != null) ? utune.title.Trim() : string.Empty));
         tune.AddChild(new agsXMPP.Xml.Dom.Element("uri", (utune.uri != null) ? utune.uri.Trim() : string.Empty));
         item.AddChild(tune);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _tune = new Tune();
         _tune.artist = (utune.artist != null) ? utune.artist.Trim() : string.Empty;
         _tune.length = utune.length;
         _tune.rating = utune.rating;
         _tune.source = (utune.source != null) ? utune.source.Trim() : string.Empty;
         _tune.title = (utune.title != null) ? utune.title.Trim() : string.Empty;
         _tune.track = utune.track;
         _tune.uri = (utune.uri != null) ? utune.uri.Trim() : string.Empty;
     }
 }
Пример #6
0
 /// <summary>
 /// D�finit un nouvel emplacement g�ographique
 /// </summary>
 /// <param name="location">Informations compl�te sur l'emplacement</param>
 public void setLocation(Location location)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/geoloc");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element geoloc = new agsXMPP.Xml.Dom.Element("geoloc");
         geoloc.Namespace = "http://jabber.org/protocol/geoloc";
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("alt", Convert.ToString(location.altitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("lat", Convert.ToString(location.latitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("lon", Convert.ToString(location.longitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("bearing", Convert.ToString(location.bearing, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("error", Convert.ToString(location.error, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("speed", Convert.ToString(location.speed, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("area", (location.area != null) ? location.area.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("building", (location.building != null) ? location.building.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("country", (location.country != null) ? location.country.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("datum", (location.datum != null) ? location.datum.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("description", (location.description != null) ? location.description.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("floor", (location.floor != null) ? location.floor.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("locality", (location.locality != null) ? location.locality.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("postalcode", (location.postalcode != null) ? location.postalcode.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("region", (location.region != null) ? location.region.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("room", (location.room != null) ? location.room.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("street", (location.street != null) ? location.street.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("text", (location.text != null) ? location.text.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("timestamp", agsXMPP.util.Time.ISO_8601Date(location.timestamp)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("uri", (location.uri != null) ? location.uri.Trim() : string.Empty));
         item.AddChild(geoloc);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _location = new Location();
         _location.altitude = location.altitude;
         _location.area = (location.area != null) ? location.area.Trim() : string.Empty;
         _location.bearing = location.bearing;
         _location.building = (location.building != null) ? location.building.Trim() : string.Empty;
         _location.country = (location.country != null) ? location.country.Trim() : string.Empty;
         _location.datum = (location.datum != null) ? location.datum.Trim() : string.Empty;
         _location.description = (location.description != null) ? location.description.Trim() : string.Empty;
         _location.error = location.error;
         _location.floor = (location.floor != null) ? location.floor.Trim() : string.Empty;
         _location.latitude = location.latitude;
         _location.locality = (location.locality != null) ? location.locality.Trim() : string.Empty;
         _location.longitude = location.longitude;
         _location.postalcode = (location.postalcode != null) ? location.postalcode.Trim() : string.Empty;
         _location.region = (location.region != null) ? location.region.Trim() : string.Empty;
         _location.room = (location.room != null) ? location.room.Trim() : string.Empty;
         _location.speed = location.speed;
         _location.street = (location.street != null) ? location.street.Trim() : string.Empty;
         _location.text = (location.text != null) ? location.text.Trim() : string.Empty;
         _location.timestamp = location.timestamp;
         _location.uri = (location.uri != null) ? location.uri.Trim() : string.Empty;
     }
 }
Пример #7
0
 /// <summary>
 /// Change son activit�
 /// </summary>
 /// <param name="type">Type de l'activit�</param>
 /// <param name="text">Description</param>
 public void setActivity(Enumerations.ActivityType type, string text)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/activity");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element activity = new agsXMPP.Xml.Dom.Element("activity");
         activity.Namespace = "http://jabber.org/protocol/activity";
         agsXMPP.Xml.Dom.Element activityType = new agsXMPP.Xml.Dom.Element(Enum.GetName(typeof(Enumerations.ActivityType), type));
         activity.AddChild(activityType);
         agsXMPP.Xml.Dom.Element activityText = new agsXMPP.Xml.Dom.Element("text");
         activityText.Value = text;
         activity.AddChild(activityText);
         item.AddChild(activity);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _activity = new Activity();
         _activity.type = type;
         _activity.text = text;
     }
 }
Пример #8
0
 /// <summary>
 /// D�finit un nouvel emplacement g�ographique
 /// </summary>
 /// <param name="location">Informations compl�te sur l'emplacement</param>
 public void setLocation(Location location)
 {
     if (Jabber.xmpp.Authenticated && Jabber._pepCapable)
     {
         agsXMPP.protocol.client.IQ iq = new agsXMPP.protocol.client.IQ();
         iq.Type = agsXMPP.protocol.client.IqType.set;
         iq.GenerateId();
         agsXMPP.Xml.Dom.Element pb = new agsXMPP.Xml.Dom.Element("pubsub");
         pb.Namespace = "http://jabber.org/protocol/pubsub";
         agsXMPP.Xml.Dom.Element ps = new agsXMPP.Xml.Dom.Element("publish");
         ps.Attributes.Add("node", "http://jabber.org/protocol/geoloc");
         agsXMPP.Xml.Dom.Element item = new agsXMPP.Xml.Dom.Element("item");
         item.Attributes.Add("id", "current");
         agsXMPP.Xml.Dom.Element geoloc = new agsXMPP.Xml.Dom.Element("geoloc");
         geoloc.Namespace = "http://jabber.org/protocol/geoloc";
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("alt", Convert.ToString(location.altitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("lat", Convert.ToString(location.latitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("lon", Convert.ToString(location.longitude, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("bearing", Convert.ToString(location.bearing, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("error", Convert.ToString(location.error, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("speed", Convert.ToString(location.speed, System.Globalization.CultureInfo.InvariantCulture)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("area", (location.area != null) ? location.area.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("building", (location.building != null) ? location.building.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("country", (location.country != null) ? location.country.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("datum", (location.datum != null) ? location.datum.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("description", (location.description != null) ? location.description.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("floor", (location.floor != null) ? location.floor.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("locality", (location.locality != null) ? location.locality.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("postalcode", (location.postalcode != null) ? location.postalcode.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("region", (location.region != null) ? location.region.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("room", (location.room != null) ? location.room.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("street", (location.street != null) ? location.street.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("text", (location.text != null) ? location.text.Trim() : string.Empty));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("timestamp", agsXMPP.util.Time.ISO_8601Date(location.timestamp)));
         geoloc.AddChild(new agsXMPP.Xml.Dom.Element("uri", (location.uri != null) ? location.uri.Trim() : string.Empty));
         item.AddChild(geoloc);
         ps.AddChild(item);
         pb.AddChild(ps);
         agsXMPP.Xml.Dom.Element conf   = new agsXMPP.Xml.Dom.Element("configure");
         agsXMPP.Xml.Dom.Element x      = new agsXMPP.Xml.Dom.Element("x");
         agsXMPP.Xml.Dom.Element field1 = new agsXMPP.Xml.Dom.Element("field");
         field1.Attributes.Add("type", "hidden");
         field1.Attributes.Add("var", "FORM_TYPE");
         agsXMPP.Xml.Dom.Element value1 = new agsXMPP.Xml.Dom.Element("value");
         value1.Value = "http://jabber.org/protocol/pubsub#node_config";
         field1.AddChild(value1);
         x.AddChild(field1);
         agsXMPP.Xml.Dom.Element field2 = new agsXMPP.Xml.Dom.Element("field");
         field2.Attributes.Add("var", "pubsub#access_model");
         agsXMPP.Xml.Dom.Element value2 = new agsXMPP.Xml.Dom.Element("value");
         value2.Value = "presence";
         field2.AddChild(value2);
         x.AddChild(field2);
         conf.AddChild(x);
         pb.AddChild(conf);
         iq.AddChild(pb);
         Jabber.xmpp.Send(iq);
         _location             = new Location();
         _location.altitude    = location.altitude;
         _location.area        = (location.area != null) ? location.area.Trim() : string.Empty;
         _location.bearing     = location.bearing;
         _location.building    = (location.building != null) ? location.building.Trim() : string.Empty;
         _location.country     = (location.country != null) ? location.country.Trim() : string.Empty;
         _location.datum       = (location.datum != null) ? location.datum.Trim() : string.Empty;
         _location.description = (location.description != null) ? location.description.Trim() : string.Empty;
         _location.error       = location.error;
         _location.floor       = (location.floor != null) ? location.floor.Trim() : string.Empty;
         _location.latitude    = location.latitude;
         _location.locality    = (location.locality != null) ? location.locality.Trim() : string.Empty;
         _location.longitude   = location.longitude;
         _location.postalcode  = (location.postalcode != null) ? location.postalcode.Trim() : string.Empty;
         _location.region      = (location.region != null) ? location.region.Trim() : string.Empty;
         _location.room        = (location.room != null) ? location.room.Trim() : string.Empty;
         _location.speed       = location.speed;
         _location.street      = (location.street != null) ? location.street.Trim() : string.Empty;
         _location.text        = (location.text != null) ? location.text.Trim() : string.Empty;
         _location.timestamp   = location.timestamp;
         _location.uri         = (location.uri != null) ? location.uri.Trim() : string.Empty;
     }
 }