2013-08-27 14:13:40 +02:00
from helper_sql import *
2013-09-03 21:56:07 +02:00
import shared
2013-06-21 01:25:01 +02:00
def insert ( t ) :
2013-08-27 14:13:40 +02:00
sqlExecute ( ''' INSERT INTO inbox VALUES (?,?,?,?,?,?,?,?,?) ''' , * t )
2013-11-29 02:05:53 +01:00
shared . UISignalQueue . put ( ( ' changedInboxUnread ' , None ) )
2013-06-21 01:25:01 +02:00
def trash ( msgid ) :
2013-08-27 14:13:40 +02:00
sqlExecute ( ''' UPDATE inbox SET folder= ' trash ' WHERE msgid=? ''' , msgid )
2013-06-21 01:25:01 +02:00
shared . UISignalQueue . put ( ( ' removeInboxRowByMsgid ' , msgid ) )
2014-07-26 19:15:28 +02:00
def isMessageAlreadyInInbox ( toAddress , fromAddress , subject , body , encodingType ) :
queryReturn = sqlQuery (
''' SELECT COUNT(*) FROM inbox WHERE toaddress=? AND fromaddress=? AND subject=? AND message=? AND encodingtype=? ''' , toAddress , fromAddress , subject , body , encodingType )
return queryReturn [ 0 ] [ 0 ] != 0