Esempio n. 1
0
 internal RosterItem(JId jid, string name, RosterItemSubscriptionType subscriptionType)
 {
     JId = jid;
     Name = name;
     SubscriptionType = subscriptionType;
     Groups = new List<string>();
 }
Esempio n. 2
0
 public void Add(JId jid, string name, string[] groups)
 {
     if (jid == JId) {
         throw new InvalidOperationException("You cannot add yourself to your roster");
     }
     if (_items.ContainsKey(jid)) {
         return; //TODO what should happen here? Exception?
     }
     var content = new XElement(XName.Get("item",Namespace) , new XAttribute("jid", jid), new XAttribute("name", name));
     if(groups != null && groups.Length > 0) {
         foreach (string group in groups) {
             content.Add(new XElement(XName.Get("group", Namespace), group));
         }
     }
     SendIQ(new IQRequest("query", new []{ content },  IQRequestType.Set, null));
 }
Esempio n. 3
0
 protected DirectedStanza(JId from, JId to, string id)
 {
     From = from;
     To = to;
 }
Esempio n. 4
0
 internal static PresenceStanza CreateInitial(JId jid, string id)
 {
     return CreateBroadcastGeneral(jid, id, PresenceAvailabilityStatus.None);
 }
Esempio n. 5
0
 internal static PresenceStanza CreateCancelSubscription(JId to, string id)
 {
     return new PresenceStanza(null, to, id, PresenceType.Unsubscribed, PresenceAvailabilityStatus.None, string.Empty);
 }
Esempio n. 6
0
 internal static PresenceStanza CreateBroadcastUnavilable(JId from, string id)
 {
     return new PresenceStanza(from, null, id, PresenceType.Unavailable, PresenceAvailabilityStatus.None, string.Empty);
 }
Esempio n. 7
0
 internal static PresenceStanza CreateBroadcastGeneral(JId from,string id, PresenceAvailabilityStatus presenceAvailabilityStatus, string detailedStatus)
 {
     return new PresenceStanza(from, null, id, PresenceType.None, presenceAvailabilityStatus, detailedStatus);
 }
Esempio n. 8
0
 private PresenceStanza(JId from, JId to, string id, PresenceType presenceType, PresenceAvailabilityStatus presenceAvailabilityStatus, string detailStatus)
     : base(from, to, id)
 {
     this.presenceType = presenceType;
     this.presenceAvailabilityStatus = presenceAvailabilityStatus;
 }
Esempio n. 9
0
 private IQResponse(JId from, JId to, string innerElementLocalName, XElement[] content, IQResponseType requestType, Error error)
     : base(to, innerElementLocalName, content)
 {
     From = from;
     ResponseType = requestType;
     Error = error;
 }
Esempio n. 10
0
 internal IQResponse(JId from, JId to, Error error)
     : this(from, to, null, null, IQResponseType.Error, error)
 {
 }
Esempio n. 11
0
 internal IQResponse(JId from, JId to, string innerElementLocalName, XElement[] content)
     : this(from, to, innerElementLocalName, content, IQResponseType.Result, null)
 {
 }
Esempio n. 12
0
 internal IQRequest(JId to, string innerElementLocalName, XElement[] content, IQRequestType requestType, Action<IQResponse> responseCallback)
     : base(to, innerElementLocalName, content)
 {
     RequestType = requestType;
     ResponseCallback = responseCallback;
 }
Esempio n. 13
0
 protected IQ(JId to, string innerElementLocalName, XElement[] content)
 {
     To = to;
     InnerElementLocalName = innerElementLocalName;
     Content = content;
 }
Esempio n. 14
0
 internal ClientInitialStream(JId to, Version version)
 {
     To = to;
     Version = version;
 }
Esempio n. 15
0
 internal MessageStanza(JId from, JId to, string id, string body)
     : base(from, to, id)
 {
     this.body = body;
 }