Index: attachment.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/attachment/attachment.module,v
retrieving revision 1.17
diff -U2 -F^f -r1.17 attachment.module
--- attachment.module	28 Sep 2006 09:59:31 -0000	1.17
+++ attachment.module	2 Oct 2006 19:04:38 -0000
@@ -121,4 +121,34 @@ function attachment_nodeapi(&$node, $op,
 
       return;
+
+    case 'rss item':
+
+      if (is_array($node->attachments)) {
+        $attachments = array();
+        foreach ($node->attachments as $attachment) {
+          if (!$attachment['hidden'] && !$attachment['deleted']) {
+            $attachments[] = $attachment;
+          }
+        }
+
+        if (count($attachments) > 0) {
+          // RSS only allows one enclosure per item
+          $attachment = array_shift($attachments);
+          $file = module_invoke('filemanager', 'get_file_info', $attachment['fid']);
+          return array(
+            array(
+              'key' => 'enclosure',
+              'attributes' => array(
+                'url' => module_invoke('filemanager', 'url', $file),
+                'length' => $file->size,
+                'type' => $file->mimetype
+              )
+            )
+          );
+        }
+      }
+
+      return;
+
   }
 }
