Пример #1
0
        private void statistics(string chat_name)
        {
            var chat     = skype.get_Chat(chat_name);
            var messages = chat.Messages;

            for (int i = 0; i < messages.Count; i++)
            {
                var msg = messages[i + 1];
                if (msg.FromHandle == skype.CurrentUser.Handle)
                {
                    Data.my_messages_count++;
                    Data.my_symbols_count += msg.Body.Length;
                    if (msg.EditedBy.Length != 0)
                    {
                        Data.my_edited_count++;
                    }
                    if (msg.Type == TChatMessageType.cmeEmoted)
                    {
                        Data.my_filetransfer_count++;
                    }
                }
                else
                {
                    Data.comp_messages_count++;
                    Data.comp_symbols_count += msg.Body.Length;

                    if (msg.EditedBy.Length != 0)
                    {
                        Data.comp_edited_count++;
                    }
                    if (msg.Type == TChatMessageType.cmeEmoted)
                    {
                        Data.comp_filetransfer_count++;
                    }
                }
                Data.global_I++;
                Console.WriteLine(Data.global_I.ToString());
            }
            if (Data.last_msg > skype.get_Chat(chat_name).Messages[1].Timestamp)
            {
                Data.last_msg = skype.get_Chat(chat_name).Messages[1].Timestamp;
            }
            if (Data.first_msg < skype.get_Chat(chat_name).Messages[skype.get_Chat(chat_name).Messages.Count].Timestamp)
            {
                Data.first_msg = skype.get_Chat(chat_name).Messages[skype.get_Chat(chat_name).Messages.Count].Timestamp;
            }
        }
Пример #2
0
 public static void SendMessage(string message, ChatMessage pMessage)
 {
     if (!_silentMode)
     {
         lock (_lock)
         {
             try
             {
                 pMessage.Chat.SendMessage(message);
             }
             catch
             {
                 try
                 {
                     skype.get_Chat(pMessage.ChatName).SendMessage(message);
                 }
                 catch
                 {
                     skype.SendMessage(pMessage.ChatName, message);
                 }
             }
         }
     }
 }