Beispiel #1
0
        /// <summary>
        ///   Sets the presence.
        /// </summary>
        /// <param name = "newPresence">The new presence state.</param>
        /// <param name = "status">The status.</param>
        /// <param name = "priority">The priority.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence, string status, int priority)
        {
            CheckSessionState();

            Presence.SetPresence(newPresence, status);

            return(this);
        }
Beispiel #2
0
        /// <summary>
        ///   Sets the presence state with the given state, status message and priority
        /// </summary>
        /// <param name = "showAs"></param>
        /// <param name = "statusMessage"></param>
        /// <param name = "priority"></param>
        public void SetPresence(XmppPresenceState showAs, string statusMessage, int priority)
        {
            var presence = new Presence();
            var status   = new Status();

            status.Value = statusMessage;
            presence.Id  = XmppIdentifierGenerator.Generate();

            presence.Items.Add((ShowType)showAs);
            presence.Items.Add(status);

            session.Send(presence);
        }
Beispiel #3
0
        /// <summary>
        ///   Sets the presence.
        /// </summary>
        /// <param name = "newPresence">The new presence state.</param>
        /// <param name = "status">The status.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence, string status)
        {
            switch (newPresence)
            {
            case XmppPresenceState.Invisible:
                throw new NotImplementedException();

            case XmppPresenceState.Offline:
                Close();
                break;

            default:
                SetPresence(newPresence, status, 0);
                break;
            }

            return(this);
        }
Beispiel #4
0
        /// <summary>
        ///   Sets the presence state with the given state, status message and priority
        /// </summary>
        /// <param name = "showAs"></param>
        /// <param name = "statusMessage"></param>
        /// <param name = "priority"></param>
        public void SetPresence(XmppPresenceState showAs, string statusMessage, int priority)
        {
            var presence = new Presence();
            var status = new Status();

            status.Value = statusMessage;
            presence.Id = XmppIdentifierGenerator.Generate();

            presence.Items.Add((ShowType) showAs);
            presence.Items.Add(status);

            session.Send(presence);
        }
Beispiel #5
0
 /// <summary>
 ///   Sets the presence state with the given state and status message
 /// </summary>
 /// <param name = "showAs"></param>
 /// <param name = "statusMessage"></param>
 public void SetPresence(XmppPresenceState showAs, string statusMessage)
 {
     SetPresence(showAs, statusMessage, 0);
 }
Beispiel #6
0
 /// <summary>
 ///   Sets the presense state.
 /// </summary>
 /// <param name = "presenceState"></param>
 public void SetPresence(XmppPresenceState presenceState)
 {
     SetPresence(presenceState, null);
 }
Beispiel #7
0
 /// <summary>
 ///   Initializes a new instance of the <see cref = "">XmppContactPresence</see>
 /// </summary>
 /// <param name = "session"></param>
 internal XmppContactPresence(XmppSession session)
 {
     this.session   = session;
     presenceStatus = XmppPresenceState.Offline;
 }
Beispiel #8
0
        /// <summary>
        /// Sets the presence.
        /// </summary>
        /// <param name="newPresence">The new presence state.</param>
        /// <param name="status">The status.</param>
        /// <param name="priority">The priority.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence, string status, int priority)
        {
            this.CheckSessionState();

            this.Presence.SetPresence(newPresence, status);

            return this;
        }
Beispiel #9
0
        /// <summary>
        /// Sets the presence.
        /// </summary>
        /// <param name="newPresence">The new presence state.</param>
        /// <param name="status">The status.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence, string status)
        {
            switch (newPresence)
            {
                case XmppPresenceState.Invisible:
                    throw new NotImplementedException();

                case XmppPresenceState.Offline:
                    this.Close();
                    break;

                default:
                    this.SetPresence(newPresence, status, 0);
                    break;
            }

            return this;
        }
Beispiel #10
0
        /// <summary>
        /// Sets the presence.
        /// </summary>
        /// <param name="showAs">The show as.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence)
        {
            this.SetPresence(newPresence, null);

            return this;
        }
 /// <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;
 }
Beispiel #12
0
 /// <summary>
 ///   Sets the presence state with the given state and status message
 /// </summary>
 /// <param name = "showAs"></param>
 /// <param name = "statusMessage"></param>
 public void SetPresence(XmppPresenceState showAs, string statusMessage)
 {
     SetPresence(showAs, statusMessage, 0);
 }
Beispiel #13
0
 /// <summary>
 ///   Sets the presense state.
 /// </summary>
 /// <param name = "presenceState"></param>
 public void SetPresence(XmppPresenceState presenceState)
 {
     SetPresence(presenceState, null);
 }
Beispiel #14
0
        /// <summary>
        ///   Sets the presence.
        /// </summary>
        /// <param name = "showAs">The show as.</param>
        public IXmppSession SetPresence(XmppPresenceState newPresence)
        {
            SetPresence(newPresence, null);

            return(this);
        }