private void updatePreview(object sender, EventArgs e)
        {
            SkypeMessage message = new SkypeMessage();
            message.senderID = "lordgreggreg";
            message.sender = "LGG";
            message.setData("Hello World!");
            message.msgDate = DateTime.Now;

            this.textBox1Preview.Text = mwf.formatMessage(message, this.getFormat());
        }
        private void updatePreview(object sender, EventArgs e)
        {
            SkypeMessage message = new SkypeMessage();

            message.senderID = "lordgreggreg";
            message.sender   = "LGG";
            message.setData("Hello World!");
            message.msgDate = DateTime.Now;

            this.textBox1Preview.Text = mwf.formatMessage(message, this.getFormat());
        }
示例#3
0
        private void copyToolStripMenuItem_Click(object sender, EventArgs e)
        {
            StringBuilder sb = new StringBuilder("");

            foreach (ListViewItem item in listView1.SelectedItems)
            {
                SkypeMessage message = item.Tag as SkypeMessage;
                sb.AppendLine("[" + message.msgDate.ToString() + "] "
                              + message.sender + ": "
                              + message.msgData);
            }
            if (sb.ToString() != "")
            {
                Clipboard.SetText(sb.ToString());
            }
        }
示例#4
0
        public String formatMessage(SkypeMessage message, String messageFormat = "[[Month]/[Day]/[Year] [Time]] [DisplayName]:")
        {
            messageFormat = messageFormat.Replace("[Day]", message.msgDate.Day.ToString());
            messageFormat = messageFormat.Replace("[Month]", message.msgDate.Month.ToString());
            messageFormat = messageFormat.Replace("[Year]", message.msgDate.Year.ToString());

            messageFormat = messageFormat.Replace("[Time]", message.msgDate.ToString("h:mm:ss tt"));


            messageFormat = messageFormat.Replace("[DisplayName]", message.sender);
            messageFormat = messageFormat.Replace("[UserName]", message.senderID);

            messageFormat += " " + message.msgData;

            return(messageFormat);
        }
示例#5
0
        public String formatMessage(SkypeMessage message, string conversationName, String messageFormat = "[[Month]/[Day]/[Year] [Time]] [DisplayName]:")
        {
            var sanitizedData = message.msgData.Replace(Environment.NewLine, "").Replace("\n", "");

            return(string.Format("{0},{1},{2},{3}", message.msgDate.ToUnixTimestamp(), conversationName, message.sender,
                                 sanitizedData));

            //messageFormat = messageFormat.Replace("[Day]", message.msgDate.Day.ToString());
            //messageFormat = messageFormat.Replace("[Month]", message.msgDate.Month.ToString());
            //messageFormat = messageFormat.Replace("[Year]", message.msgDate.Year.ToString());

            //messageFormat = messageFormat.Replace("[Time]", message.msgDate.ToString("h:mm:ss tt"));


            //messageFormat = messageFormat.Replace("[DisplayName]", message.sender);
            //messageFormat = messageFormat.Replace("[UserName]", message.senderID);

            //messageFormat += " " + message.msgData;

            //return messageFormat;
        }
        public String formatMessage(SkypeMessage message, String messageFormat = "[[Month]/[Day]/[Year] [Time]] [DisplayName]:")
        {
            
            messageFormat = messageFormat.Replace("[Day]", message.msgDate.Day.ToString());
            messageFormat = messageFormat.Replace("[Month]", message.msgDate.Month.ToString());
            messageFormat = messageFormat.Replace("[Year]", message.msgDate.Year.ToString());

            messageFormat = messageFormat.Replace("[Time]", message.msgDate.ToString("h:mm:ss tt"));


            messageFormat = messageFormat.Replace("[DisplayName]", message.sender);
            messageFormat = messageFormat.Replace("[UserName]", message.senderID);

            messageFormat += " " + message.msgData;

            return messageFormat;
        }
        private List<SkypeMessage> getSkypeMessages(Conversation c)
        {
            List<SkypeMessage> messages = new List<SkypeMessage>();

            //debugAdd("Loading messages for " + c.Identity);
            if (c.getType() == 2)
            {
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where chatname='" + c.Identity + "' order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    //debugAdd("Found message " + dataRead["body_xml"]);
                    SkypeMessage message = new SkypeMessage();
                    message.sender = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }
            else if(c.getType()==1)
            {
                if (c.chats.Length == 0) return messages;
                String wheres = "";
                foreach (string name in c.chats)
                {
                    wheres += "OR chatname='" + name + "' ";
                }
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where "
                    + wheres.Substring(3)
                    + " order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    //debugAdd("Found message " + dataRead["body_xml"]);
                    SkypeMessage message = new SkypeMessage();
                    message.sender = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }
            else if (c.getType() == 3)
            {
                String wheres = "";
                if(c.chats!=null)
                foreach (string name in c.chats)
                {
                    wheres += "OR dialog_partner='" + name + "' ";
                }
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where "
                    + "ifnull(chatname, '') = '' and from_dispname='"+c.DisplayName+"'" + wheres
                    + " order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    SkypeMessage message = new SkypeMessage();
                    message.sender = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }

            return messages;
        }
示例#8
0
        private List <SkypeMessage> getSkypeMessages(Conversation c)
        {
            List <SkypeMessage> messages = new List <SkypeMessage>();

            //debugAdd("Loading messages for " + c.Identity);
            if (c.getType() == 2)
            {
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where chatname='" + c.Identity + "' order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    //debugAdd("Found message " + dataRead["body_xml"]);
                    SkypeMessage message = new SkypeMessage();
                    message.sender   = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }
            else if (c.getType() == 1)
            {
                if (c.chats.Length == 0)
                {
                    return(messages);
                }
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where convo_id = " + c.ConvoId + " order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    //debugAdd("Found message " + dataRead["body_xml"]);
                    SkypeMessage message = new SkypeMessage();
                    message.sender   = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }
            else if (c.getType() == 3)
            {
                String wheres = "";
                if (c.chats != null)
                {
                    foreach (string name in c.chats)
                    {
                        wheres += "OR dialog_partner='" + name + "' ";
                    }
                }
                SQLiteCommand cmd = connection.CreateCommand();
                cmd.CommandText = "select timestamp,from_dispname,author,body_xml from Messages where "
                                  + "ifnull(chatname, '') = '' and from_dispname='" + c.DisplayName + "'" + wheres
                                  + " order by timestamp";
                SQLiteDataReader dataRead = cmd.ExecuteReader();
                while (dataRead.Read())
                {
                    SkypeMessage message = new SkypeMessage();
                    message.sender   = dataRead["from_dispname"].ToString();
                    message.senderID = dataRead["author"].ToString();
                    message.setData(dataRead["body_xml"].ToString());
                    message.setDate(dataRead["timestamp"].ToString());
                    messages.Add(message);
                }
            }

            return(messages);
        }
示例#9
0
        public String formatMessage(SkypeMessage message, string conversationName, String messageFormat = "[[Month]/[Day]/[Year] [Time]] [DisplayName]:")
        {
            var sanitizedData = message.msgData.Replace(Environment.NewLine, "").Replace("\n", "");

            return string.Format("{0},{1},{2},{3}", message.msgDate.ToUnixTimestamp(), conversationName, message.sender,
                sanitizedData);

            //messageFormat = messageFormat.Replace("[Day]", message.msgDate.Day.ToString());
            //messageFormat = messageFormat.Replace("[Month]", message.msgDate.Month.ToString());
            //messageFormat = messageFormat.Replace("[Year]", message.msgDate.Year.ToString());

            //messageFormat = messageFormat.Replace("[Time]", message.msgDate.ToString("h:mm:ss tt"));

            //messageFormat = messageFormat.Replace("[DisplayName]", message.sender);
            //messageFormat = messageFormat.Replace("[UserName]", message.senderID);

            //messageFormat += " " + message.msgData;

            //return messageFormat;
        }