Example #1
0
        ///////////////////////////////////////////////////////////////////////////////
        public int SendNotification(XmppJid to, string thread, XmppChatStatus notify)
        {
            //if (!string.IsNullOrEmpty(thread))
            //thread = "<thread>" + thread + "</thread>";
            thread = "";

            string bufNotify = string.Empty;

            switch (notify)
            {
            case XmppChatStatus.NowComposing:
                bufNotify = "<composing xmlns=\"http://jabber.org/protocol/chatstates\"/>"; break;

            case XmppChatStatus.StopComposing:
                bufNotify = "<paused xmlns=\"http://jabber.org/protocol/chatstates\"/>"; break;

            case XmppChatStatus.Active:
                bufNotify = "<active xmlns=\"http://jabber.org/protocol/chatstates\"/>"; break;

            case XmppChatStatus.Inactive:
                bufNotify = "<inactive xmlns=\"http://jabber.org/protocol/chatstates\"/>"; break;

            case XmppChatStatus.Gone:
                bufNotify = "<gone xmlns=\"http://jabber.org/protocol/chatstates\"/>"; break;
            }

            string buf = string.Format("<message to=\"{0}\" type=\"chat\" id=\"{1}\" from=\"{2}\">{3}{4}</message>", to.Value, iqCount, Jid.Value, bufNotify, thread);

            sendStream(buf);
            return(iqCount++);
        }
Example #2
0
        public void SetChatNotification(XmppChatStatus chatNotify)
        {
            string message = string.Empty;

            switch (chatNotify)
            {
            case XmppChatStatus.NowComposing:
                message = string.Format("{0} is typing a message", riTo.Jid.Bare); break;

            case XmppChatStatus.StopComposing:
                message = string.Empty; break;

            case XmppChatStatus.Gone:
                message = string.Format("{0} has left the conversation", riTo.Jid.Bare); break;
                //case XmppChatStatus.Inactive:
                //case XmppChatStatus.Active:
            }

            lbBar.Text = message;
        }
Example #3
0
 public XmppChatNotifyEventArgs(XmppJid jid, string thread, XmppChatStatus chatStatus)
 {
     From       = jid;
     Thread     = thread;
     ChatStatus = chatStatus;
 }