Exemple #1
0
        public void appendMsg(String jid, String Message)
        {
            if (Message.Contains("/*/*OTR_REQUEST*"))
            {
                //OTR does not work yet, working to get a random session ID first.
                String[] otrMsg = Message.Split('*');
                remoteUID = otrMsg[3];
                //Process the OTR request:
                otr    newOtrSess = new otr();
                String SessionID  = newOtrSess.generateSessionID();
                //newOtrSess.createSession(SessionID);
                Console.WriteLine("Status - Conversation - New OTR ID" + SessionID);
                return; //Do NOT process the rest of this function!!!!
            }

            String timeNow = DateTime.Now.ToString("hh:mm:ss tt");

            if (jid == "You")
            {
                richTextBox1.SelectionColor = Color.Cyan;
                richTextBox1.AppendText("[" + timeNow + "]" + jid + ": ");
                richTextBox1.SelectionColor = Color.White;
                Console.WriteLine(Message + Environment.NewLine);
            }
            else
            {
                richTextBox1.SelectionColor = Color.LightGreen;
                richTextBox1.AppendText("[" + timeNow + "]" + jid + ": ");
                richTextBox1.SelectionColor = Color.White;
                Console.WriteLine(Message + Environment.NewLine);
            }
            richTextBox1.SelectionStart = richTextBox1.TextLength;
            richTextBox1.ScrollToCaret();
        }
        public void appendMsg(String jid, String Message)
        {

            if (Message.Contains("/*/*OTR_REQUEST*"))
            {
                //OTR does not work yet, working to get a random session ID first.
                String[] otrMsg = Message.Split('*');
                remoteUID = otrMsg[3];
                //Process the OTR request:
                otr newOtrSess = new otr();
                String SessionID = newOtrSess.generateSessionID();
                //newOtrSess.createSession(SessionID);
                msg("Status - Conversation - New OTR ID", SessionID);
                return; //Do NOT process the rest of this function!!!!
            }
            if(ApplicationIsActivated() == false)
            {
                FlashWindowEx(this);
                WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer();
                wplayer.URL = Properties.Settings.Default.notification;
                wplayer.controls.play();

            }
            String timeNow = DateTime.Now.ToString("hh:mm:ss tt");
            if (jid == "You")
            {
                richTextBox1.SelectionColor = Color.Cyan;
                richTextBox1.AppendText("["+timeNow + "]" + jid + ": ");
                richTextBox1.SelectionColor = Color.White;
                richTextBox1.AppendText(Message + Environment.NewLine);
            } else
            {
                richTextBox1.SelectionColor = Color.LightGreen;
                richTextBox1.AppendText("[" + timeNow + "]" + jid + ": ");
                richTextBox1.SelectionColor = Color.White;
                richTextBox1.AppendText(Message + Environment.NewLine);

            }
            richTextBox1.SelectionStart = richTextBox1.TextLength;
            richTextBox1.ScrollToCaret();

        }