ExtractDCCDataChannel extracts file from IRC DCC data channel
(conv *core.ConversationInfo, data []byte, conn *IRCDCCConnection)
| 155 | |
| 156 | // ExtractDCCDataChannel extracts file from IRC DCC data channel |
| 157 | func ExtractDCCDataChannel(conv *core.ConversationInfo, data []byte, conn *IRCDCCConnection) error { |
| 158 | if len(data) == 0 { |
| 159 | return nil |
| 160 | } |
| 161 | |
| 162 | // Use file extraction framework |
| 163 | extractor, ok := file.GetExtractor("IRC") |
| 164 | if !ok { |
| 165 | ircLog.Error("IRC file extractor not registered") |
| 166 | return nil |
| 167 | } |
| 168 | |
| 169 | metadata := file.FileMetadata{ |
| 170 | ConnectionUID: conv.Ident, |
| 171 | FlowDirection: "server_to_client", // DCC SEND is typically download |
| 172 | Filename: filepath.Base(conn.Filename), |
| 173 | Host: conn.IP, |
| 174 | } |
| 175 | |
| 176 | return extractor.ExtractFile(conv, data, metadata) |
| 177 | } |
| 178 | |
| 179 | // RemoveDCCConnection removes a tracked DCC connection |
| 180 | func RemoveDCCConnection(key string) { |
no test coverage detected