#NEWLINE# @ staticmethod #NEWLINE# def SaveMsg( from_userid , to_userid , to_pid , text_body , sender_mode = 4 ) : #NEWLINE# #INDENT# to_msgbox = MsgBox . MsgBox ( to_userid ) #NEWLINE# from_msgbox = MsgBox . MsgBox ( from_userid ) #NEWLINE# to_msg = MsgHead . MsgHead ( ) #NEWLINE# to_msg . time = int ( time . time ( ) ) #NEWLINE# to_msg . sent = 0 #NEWLINE# to_msg . mode = sender_mode #NEWLINE# to_msg . id = from_userid #NEWLINE# to_msg . frompid = os . getpid ( ) #NEWLINE# to_msg . topid = to_pid #NEWLINE# from_msg = copy . copy ( to_msg ) #NEWLINE# from_msg . sent = 1 #NEWLINE# from_msg . id = to_userid #NEWLINE# if ( to_msgbox . SaveMsgText ( to_msg , text_body ) < 0 ) : #NEWLINE# #INDENT# return ( - 21 ) #NEWLINE# #UNINDENT# if ( ( to_userid != from_userid ) and ( sender_mode != 3 ) ) : #NEWLINE# #INDENT# if ( from_msgbox . SaveMsgText ( to_msgbox , text_body ) < 0 ) : #NEWLINE# #INDENT# return ( - 21 ) #NEWLINE# #UNINDENT# #UNINDENT# return 1