public void ProcessRequest(GDPRMessage message)
        {
            this.Request = message;

            GDPRSubject s = new GDPRSubject(message.Subject);

            switch (message.GetType().Name)
            {
            case "DeleteMessage":
                this.RecordDeleteIn(message.Subject);
                break;

            case "DataRequestMessage":
                List <GDPRSubject> customers = this.RecordSearch(s);

                foreach (GDPRSubject c in customers)
                {
                    string storageLocation = this.ExportData(c.ApplicationSubjectId);

                    //send a export message...
                    ExportMessage em = new ExportMessage();
                    em.ApplicationId        = Request.ApplicationId;
                    em.ApplicationSubjectId = c.ApplicationSubjectId;
                    em.SubjectRequestId     = Request.SubjectRequestId;
                    em.Subject    = Request.Subject;
                    em.BlobUrl    = storageLocation;
                    this.Response = em;

                    MasterGDPRHelper.SendMessage(em);
                }
                break;
            }
        }
Example #2
0
        public static void SendMessage(object exportOperation, MessageType type)
        {
            var message = new ExportMessage
            {
                ExportOperation = exportOperation,
                Type            = type
            };

            AsyncSendMessage(message);
        }
Example #3
0
        public void LoadChats()
        {
            int count = Skype.Chats.Count;
            int i     = 0;

            //Iterate chats
            foreach (SKYPE4COMLib.IChat chat in Skype.Chats)
            {
                if (_closing)
                {
                    return;
                }

                i++;

                if (chat.Messages.Count > 0)
                {
                    LabelText = string.Format("[chat {0} of {1}] [{2}] {3} [messages {4}]", i, count, chat.Timestamp.ToString(), chat.DialogPartner, chat.Messages.Count);

                    // get chat members
                    ExportMemberCollection memberCollection = new ExportMemberCollection();

                    foreach (SKYPE4COMLib.IUser chatMember in chat.Members)
                    {
                        if (_closing)
                        {
                            return;
                        }

                        ExportMember member = new ExportMember();
                        member.Name        = chatMember.Handle;
                        member.DisplayName = chatMember.FullName;

                        if (!memberCollection.MemberExists(member.Name))
                        {
                            memberCollection.Add(member);
                        }
                    }

                    ExportChat exportChat = ExportCM.Configuration.Chats.GetChat(memberCollection);

                    if (exportChat == null)
                    {
                        exportChat = new ExportChat();

                        ExportCM.Configuration.Chats.Add(exportChat);

                        MainText = "[+] " + memberCollection.ToString();

                        exportChat.Name    = memberCollection.ToString();
                        exportChat.Members = memberCollection;
                    }
                    else
                    {
                        MainText = "[ ] " + memberCollection.ToString();
                    }

                    foreach (SKYPE4COMLib.IChatMessage chatMessage in chat.Messages)
                    {
                        if (_closing)
                        {
                            return;
                        }

                        ExportMessage exportMessage = new ExportMessage();
                        exportMessage.Id   = chatMessage.Id.ToString();
                        exportMessage.From = chatMessage.FromHandle;

                        exportMessage.Timestamp = chatMessage.Timestamp.ToString();
                        exportMessage.Body      = chatMessage.Body;

                        //LabelText = string.Format("[{0}:{1}] [{2} -> {3}]: {4}", exportMessage.Id, exportMessage.Timestamp, exportMessage.From, exportMessage.To, exportMessage.Body);

                        if (!string.IsNullOrEmpty(chatMessage.EditedBy))
                        {
                            exportMessage.EditBy = chatMessage.EditedBy;
                        }

                        exportMessage.MessageType = chatMessage.Type.ToString();

                        if (!exportChat.Messages.MessageExists(exportMessage))
                        {
                            exportChat.Messages.Add(exportMessage);
                        }

                        // -----
                        //break;
                    }
                }
            }

            LabelText = "";
        }