#NEWLINE# @ staticmethod #NEWLINE# def MaySendMsg( from_userid , to_userid , to_userinfo , sender_mode = 4 ) : #NEWLINE# #INDENT# from_user = UserManager . UserManager . LoadUser ( from_userid ) #NEWLINE# if ( not from_user . CanSee ( to_userinfo ) ) : #NEWLINE# #INDENT# return ( - 2 ) #NEWLINE# #UNINDENT# if ( ( to_userinfo . mode == modes . LOCKSCREEN ) and ( sender_mode != 3 ) ) : #NEWLINE# #INDENT# return ( - 1 ) #NEWLINE# #UNINDENT# if ( from_user . BeIgnored ( to_userid ) and ( sender_mode != 3 ) ) : #NEWLINE# #INDENT# return ( - 11 ) #NEWLINE# #UNINDENT# to_msgbox = MsgBox . MsgBox ( to_userid ) #NEWLINE# if ( ( to_userinfo . mode != modes . WEBEXPLORE ) and ( sender_mode != 3 ) ) : #NEWLINE# #INDENT# if ( to_msgbox . GetUnreadCount ( ) > Config . MAXMESSAGE ) : #NEWLINE# #INDENT# return ( - 12 ) #NEWLINE# #UNINDENT# #UNINDENT# to_login = to_userinfo . GetIndex ( ) #NEWLINE# pid = Utmp . Utmp . GetPid ( ( to_login - 1 ) ) #NEWLINE# active = Utmp . Utmp . IsActive ( ( to_login - 1 ) ) #NEWLINE# userid = Utmp . Utmp . GetUserId ( ( to_login - 1 ) ) #NEWLINE# if ( ( active == 0 ) or ( pid == 0 ) or ( userid != to_userid ) ) : #NEWLINE# #INDENT# Log . debug ( ( 'error -14: %d %d' % ( active , pid ) ) ) #NEWLINE# return ( - 14 ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# os . kill ( pid , 0 ) #NEWLINE# #UNINDENT# except OSError : #NEWLINE# #INDENT# Log . debug ( 'error -14: kill fail, process gone' ) #NEWLINE# return ( - 14 ) #NEWLINE# #UNINDENT# return 1