Index: openacs-4/packages/spam/www/spam-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/spam/www/spam-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/spam/www/spam-edit.tcl 20 Apr 2001 20:51:25 -0000 1.1 +++ openacs-4/packages/spam/www/spam-edit.tcl 4 Sep 2001 21:14:59 -0000 1.2 @@ -39,24 +39,23 @@ # XXX: cut-and-paste programming, should be a proc -if [acs_mail_multipart_p $content_object_id] { - foreach type {plain html} { - db_1row spam_get_multipart_${type}_text " - select content - from acs_mail_multipart_parts, acs_contents - where multipart_id = :content_object_id - and content_id = content_object_id - and mime_type = 'text/$type' - " - set ${type}_text $content - } +if [acs_mail_multipart_p $content_item_id] { + + db_1row spam_get_multipart_plain_text "select content as plain_text from acs_mail_multipart_parts, acs_contents + where multipart_id = :content_item_id + and content_id = content_item_id and mime_type = 'text/plain'" + + db_1row spam_get_multipart_html_text "select content as html_text from acs_mail_multipart_parts, acs_contents + where multipart_id = :content_item_id + and content_id = content_item_id and mime_type = 'text/html'" + } else { set plain_text "" set html_text "" db_1row spam_get_text { select content, mime_type from acs_contents - where content_id = :content_object_id + where content_id = :content_item_id } if {$mime_type == "text/plain"} { set plain_text $content