Exemplo n.º 1
0
        private static string GetLogFilePath(InstantMessageModality messageInfo)
        {
            string path = ConfigurationManager.AppSettings["LOG_PATH"];

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string username;

            if (messageInfo.Conversation.Participants.Count > 2)
            {
                username = "******";
            }
            else
            {
                Participant participant = LyncHelper.GetConversationParticipant(messageInfo.Conversation);
                username = LyncHelper.GetContactUsername(participant.Contact);
            }

            path += "/" + username;

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }

            string conversationId = (string)messageInfo.Conversation.Properties[ConversationProperty.Id];
            string filename       = GetConversationFilename(conversationId);

            path += "/" + filename;

            return(path);
        }
Exemplo n.º 2
0
        public static void Open(Conversation conversation)
        {
            Participant participant = LyncHelper.GetConversationParticipant(conversation);

            if (participant != null)
            {
                string username = LyncHelper.GetContactUsername(participant.Contact);

                DebugLog.Write("Conversation with {0} started at {1} {2}", username, DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString());
            }
        }
Exemplo n.º 3
0
        public static void Close(Conversation conversation)
        {
            string conversationId = (string)conversation.Properties[ConversationProperty.Id];

            if (_logs.ContainsKey(conversationId))
            {
                _logs.Remove(conversationId);
            }

            Participant participant = LyncHelper.GetConversationParticipant(conversation);

            if (participant != null)
            {
                string username = LyncHelper.GetContactUsername(participant.Contact);

                DebugLog.Write("Conversation with {0} ended at {1} {2}", username, DateTime.Now.ToShortDateString(), DateTime.Now.ToLongTimeString());
            }
        }