This repository has been archived on 2024-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2024-08-21/src/helper_sent.py

20 lines
549 B
Python
Raw Normal View History

2019-10-07 15:58:12 +02:00
"""
2019-10-09 15:27:51 +02:00
Insert values into sent table
2019-10-07 15:58:12 +02:00
"""
import uuid
from bmconfigparser import BMConfigParser
2019-12-23 10:49:03 +01:00
from helper_sql import sqlExecute
2019-10-09 15:27:51 +02:00
def insert(t):
2019-10-09 15:27:51 +02:00
"""Perform an insert into the `sent` table"""
if not t[0] or not t[-1]:
temp = list(t)
if not t[0]:
temp[0] = uuid.uuid4().bytes # if msgid is empty the put uuid
if not t[-1]:
temp[-1] = BMConfigParser().getint('bitmessagesettings', 'ttl')
t = tuple(temp)
2015-03-09 07:35:32 +01:00
sqlExecute('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)