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

20 lines
549 B
Python
Raw Normal View History

2019-10-07 19:28:12 +05:30
"""
2019-10-09 18:57:51 +05:30
Insert values into sent table
2019-10-07 19:28:12 +05:30
"""
import uuid
from bmconfigparser import BMConfigParser
2019-12-23 15:19:03 +05:30
from helper_sql import sqlExecute
2019-10-09 18:57:51 +05:30
def insert(t):
2019-10-09 18:57:51 +05:30
"""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 02:35:32 -04:00
sqlExecute('''INSERT INTO sent VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)''', *t)