/// <summary>
        /// Initializes a new instance of the <see cref="XmppEntityCapabilities"/> class.
        /// </summary>
        protected XmppEntityCapabilities(XmppSession session)
            : base()
        {
            this.session = session;

            this.SubscribeToSessionState();
        }
Exemple #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:XmppChat"/> class.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="contact">The contact.</param>
        internal XmppChat(XmppSession session, XmppContact contact)
        {
            this.session            = session;
            this.contact            = contact;
            this.pendingMessages    = new Queue<XmppMessage>();

            this.Subscribe();
        }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:XmppContact"/> class.
        /// </summary>
        /// <param name="session">The session.</param>
        /// <param name="contactId">The contact id.</param>
        /// <param name="name">The name.</param>
        /// <param name="subscription">The subscription.</param>
        /// <param name="groups">The groups.</param>
        internal XmppContact(XmppSession session, string contactId, string name, XmppContactSubscriptionType subscription, IList<string> groups)
        {
            this.session    = session;
            this.syncObject = new object();
            this.contactId  = contactId;
            this.resources  = new List<XmppContactResource>();

            this.RefreshData(name, subscription, groups);
            this.AddDefaultResource();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="XmppContactResource"/> class.
        /// </summary>
        internal XmppContactResource(XmppSession session, XmppContact contact, XmppJid resourceId)
        {
            this.session    		= session;
            this.contact    		= contact;
            this.resourceId 		= resourceId;
            this.presence			= new XmppContactPresence(this.session);
            this.capabilities 		= new XmppClientCapabilities();
            this.pendingMessages	= new List<string>();

            this.Subscribe();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="XmppEntityCapabilities"/> class.
        /// </summary>
        internal XmppSessionEntityCapabilities(XmppSession session)
            : base(session)
        {
            this.session = session;

            // Supported features
            this.Features.Add(new XmppServiceFeature(XmppFeatures.ServiceDiscoveryInfo));
            // this.Features.Add(new XmppServiceFeature(XmppFeatures.ServiceDiscoveryItems));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.EntityCapabilities));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.BidirectionalStreamsOverSynchronousHTTP));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.ChatStateNotifications));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.MultiUserChat));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.MultiUserChatUser));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.UserMood));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.UserMoodWithNotify));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.UserTune));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.UserTuneWithNotify));
            this.Features.Add(new XmppServiceFeature(XmppFeatures.XmppPing));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="">XmppContactPresence</see>
 /// </summary>
 /// <param name="session"></param>
 internal XmppContactPresence(XmppSession session)
 {
     this.session        = session;
     this.presenceStatus = XmppPresenceState.Offline;
 }
Exemple #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="XmppPresence"/> class using
 /// the given session.
 /// </summary>
 /// <param name="session"></param>
 internal XmppPresence(XmppSession session)
 {
     this.session = session;
 }
Exemple #8
0
        /// <summary>
        /// Closes this instance.
        /// </summary>
        public void Close()
        {
            if (this.ChatClosing != null)
            {
                this.ChatClosing(this, new EventArgs());
            }

            this.SendChatStateNotification(XmppChatStateNotification.Gone);
            this.pendingMessages.Clear();
            this.Unsubscribe();
            this.pendingMessages = null;

            if (this.ChatClosed != null)
            {
                this.ChatClosed(this, new EventArgs());
            }

            this.session = null;
            this.contact = null;
        }