Esempio n. 1
0
        protected override void ProcessConversation()
        {
            // we need a stream to read from
            var stream = new PDUStreamBasedProvider(this.CurrentConversation, EfcPDUProviderType.Breaked);

            // now we can create a reader that will be reading from the stream we just created


            //////////////////////////////////
            // reader will spawn messages, cycle through them
            do
            {
                var reader = new PDUStreamReader(stream, Encoding.ASCII)
                {
                    ReadBigEndian = true
                };
                this.OnBeforeProtocolParsing();

                var msg = new ICQMsg(reader);

                if (!msg.Valid)
                {
                    // parsing went wrong, we have to report it
                    this.SnooperExport.TimeStampFirst = msg.Timestamp;
                    this.SnooperExport.AddExportReport(ExportReport.ReportLevel.Warn, this.Name, "parsing of ICQ message failed: " + msg.InvalidReason, msg.ExportSources);
                    // skip processing, go to next message
                    continue;
                }
                this.OnAfterProtocolParsing();

                this.OnBeforeDataExporting();
                this.ProcessMsg(msg);
                this.OnAfterDataExporting();
            } while(stream.NewMessage());
        }
Esempio n. 2
0
 private void ProcessMsg(ICQMsg msg)
 {
     switch (msg.Type)
     {
     case ICQMsgType.Msg:
         if (!msg.Body.IsNullOrEmpty())
         {
             var exportObject = new SnooperExportedObjectICQ(this.SnooperExport)
             {
                 Message   = msg.Body,
                 Receiver  = msg.Receiver,
                 Sender    = msg.Sender,
                 TimeStamp = msg.Timestamp
             };
             exportObject.ExportSources.AddRange(msg.ExportSources);
             this.SnooperExport.AddExportObject(exportObject);
         }
         break;
     }
 }