@@ -55,7 +55,7 @@ class node. Any parts of other types are each stored in separate files
5555an exception, the original message is bounced back to the sender with the
5656explanatory message given in the exception.
5757
58- $Id: mailgw.py,v 1.5 2001-07-29 07:01:39 richard Exp $
58+ $Id: mailgw.py,v 1.6 2001-08-01 04:24:21 richard Exp $
5959'''
6060
6161
@@ -258,36 +258,37 @@ def handle_message(self, message):
258258 # handle the files
259259 files = []
260260 for (name , type , data ) in attachments :
261- files .append (self .db .file .create (type = type , name = name , content = data ))
261+ files .append (self .db .file .create (type = type , name = name ,
262+ content = data ))
262263
263264 # now handle the db stuff
264265 if nodeid :
265- # If an item designator (class name and id number) is found there, the
266- # newly created "msg" node is added to the "messages" property for
267- # that item, and any new "file" nodes are added to the "files"
266+ # If an item designator (class name and id number) is found there,
267+ # the newly created "msg" node is added to the "messages" property
268+ # for that item, and any new "file" nodes are added to the "files"
268269 # property for the item.
269- message_id = self .db .msg .create (author = author , recipients = recipients ,
270- date = date .Date ('.' ), summary = summary , content = content ,
271- files = files )
270+ message_id = self .db .msg .create (author = author ,
271+ recipients = recipients , date = date .Date ('.' ), summary = summary ,
272+ content = content , files = files )
272273 messages = cl .get (nodeid , 'messages' )
273274 messages .append (message_id )
274275 props ['messages' ] = messages
275- apply ( cl .set , (nodeid , ), props )
276+ cl .set (nodeid , ** props )
276277 else :
277278 # If just an item class name is found there, we attempt to create a
278279 # new item of that class with its "messages" property initialized to
279280 # contain the new "msg" node and its "files" property initialized to
280281 # contain any new "file" nodes.
281- message_id = self .db .msg .create (author = author , recipients = recipients ,
282- date = date .Date ('.' ), summary = summary , content = content ,
283- files = files )
284- if not props .has_key ('assignedto' ):
282+ message_id = self .db .msg .create (author = author ,
283+ recipients = recipients , date = date .Date ('.' ), summary = summary ,
284+ content = content , files = files )
285+ # fill out the properties with defaults where required
286+ if properties .has_key ('assignedto' ) and \
287+ not props .has_key ('assignedto' ):
285288 props ['assignedto' ] = '1' # "admin"
286- if not props .has_key ('priority' ):
287- props ['priority' ] = '1' # "bug-fatal"
288- if not props .has_key ('status' ):
289+ if properties .has_key ('status' ) and not props .has_key ('status' ):
289290 props ['status' ] = '1' # "unread"
290- if not props .has_key ('title' ):
291+ if properties . has_key ( 'title' ) and not props .has_key ('title' ):
291292 props ['title' ] = title
292293 props ['messages' ] = [message_id ]
293294 props ['nosy' ] = recipients [:]
@@ -297,6 +298,9 @@ def handle_message(self, message):
297298
298299#
299300# $Log: not supported by cvs2svn $
301+ # Revision 1.5 2001/07/29 07:01:39 richard
302+ # Added vim command to all source so that we don't get no steenkin' tabs :)
303+ #
300304# Revision 1.4 2001/07/28 06:43:02 richard
301305# Multipart message class has the getPart method now. Added some tests for it.
302306#
0 commit comments